pytorch/test/quantization/core
vasiliy 2d01f87737 Enable torch.empty for float8 dtypes + deterministic mode + cpu (#128744)
Summary:

Enables creating empty float8 tensors for:
* cuda when `torch.use_deterministic_algorithms` is set to True
* cpu for all settings of `torch.use_deterministic_algorithms`

Context for NaN values of float8_e4m3fn and float8_e5m2: https://arxiv.org/pdf/2209.05433, Section 3, Table 1

Context for NaN values of float8_e4m3fnuz and float8_e5m2fnuz: https://arxiv.org/pdf/2206.02915, Section 3.2, "instead of reserving one exponent field to represent Inf and NaN, we reserve only a single codeword (corresponding to negative zero)"

Test Plan:

```
python test/test_quantization.py -k test_empty
```

Reviewers:

Subscribers:

Tasks:

Tags:

Fixes https://github.com/pytorch/pytorch/issues/128733

Pull Request resolved: https://github.com/pytorch/pytorch/pull/128744
Approved by: https://github.com/malfet, https://github.com/drisspg
2024-06-15 02:05:30 +00:00
..
experimental Enable torch.empty for float8 dtypes + deterministic mode + cpu (#128744) 2024-06-15 02:05:30 +00:00
__init__.py
test_backend_config.py
test_docs.py
test_quantized_functional.py
test_quantized_module.py Add testing and fix weights_only load for quantized types and nn.Parameters with python attrs (#124330) 2024-04-23 04:13:26 +00:00
test_quantized_op.py Revert "[cuDNN][Quantization] Don't print when plan finalization fails in cuDNN quantization backend (#128177)" 2024-06-12 02:20:15 +00:00
test_quantized_tensor.py [quant] Make per_group and per_token quant match torch.fake_quantize (#125781) 2024-05-14 18:18:54 +00:00
test_top_level_apis.py
test_utils.py
test_workflow_module.py Add testing and fix weights_only load for quantized types and nn.Parameters with python attrs (#124330) 2024-04-23 04:13:26 +00:00
test_workflow_ops.py Add testing and fix weights_only load for quantized types and nn.Parameters with python attrs (#124330) 2024-04-23 04:13:26 +00:00