Skip to content

Commit

Permalink
Update README.md for float8 inference (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuzo committed Sep 16, 2024
1 parent da13bf2 commit bd264f9
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions torchao/quantization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ change_linear_weights_to_int4_woqtensors(model)

Note: The quantization error incurred by applying int4 quantization to your model can be fairly significant, so using external techniques like GPTQ may be necessary to obtain a usable model.

#### A16W8 WeightOnly Quantization
#### A16W8 Int8 WeightOnly Quantization

```python
# for torch 2.4+
Expand All @@ -109,7 +109,7 @@ from torchao.quantization.quant_api import change_linear_weights_to_int8_woqtens
change_linear_weights_to_int8_woqtensors(model)
```

#### A8W8 Dynamic Quantization
#### A8W8 Int8 Dynamic Quantization

```python
# for torch 2.4+
Expand All @@ -121,6 +121,22 @@ from torchao.quantization.quant_api import change_linear_weights_to_int8_dqtenso
change_linear_weights_to_int8_dqtensors(model)
```

#### A16W8 Float8 WeightOnly Quantization

```python
# for torch 2.5+
from torchao.quantization import quantize_, float8_weight_only
quantize_(model, float8_weight_only())
```

#### A16W8 Float8 Dynamic Quantization with Rowwise Scaling

```python
# for torch 2.5+
from torchao.quantization.quant_api import quantize_, PerRow, float8_dynamic_activation_float8_weight
quantize_(model, float8_dynamic_activation_float8_weight(granularity=PerRow()))
```

#### A16W6 Floating Point WeightOnly Quantization

```python
Expand Down

0 comments on commit bd264f9

Please sign in to comment.