pytorch/test/quantization/core/experimental
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
..
apot_fx_graph_mode_ptq.py
apot_fx_graph_mode_qat.py
quantization_util.py
test_adaround_eager.py [AdaRound] Make versatile for data / extra param for callback function (#126891) 2024-05-29 20:05:27 +00:00
test_bits.py
test_fake_quantize.py
test_float8.py Enable torch.empty for float8 dtypes + deterministic mode + cpu (#128744) 2024-06-15 02:05:30 +00:00
test_linear.py
test_nonuniform_observer.py
test_quantized_tensor.py
test_quantizer.py