Skip to content

Commit bd264f9

Browse files
authored
Update README.md for float8 inference (#896)
1 parent da13bf2 commit bd264f9

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

torchao/quantization/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ change_linear_weights_to_int4_woqtensors(model)
9797

9898
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.
9999

100-
#### A16W8 WeightOnly Quantization
100+
#### A16W8 Int8 WeightOnly Quantization
101101

102102
```python
103103
# for torch 2.4+
@@ -109,7 +109,7 @@ from torchao.quantization.quant_api import change_linear_weights_to_int8_woqtens
109109
change_linear_weights_to_int8_woqtensors(model)
110110
```
111111

112-
#### A8W8 Dynamic Quantization
112+
#### A8W8 Int8 Dynamic Quantization
113113

114114
```python
115115
# for torch 2.4+
@@ -121,6 +121,22 @@ from torchao.quantization.quant_api import change_linear_weights_to_int8_dqtenso
121121
change_linear_weights_to_int8_dqtensors(model)
122122
```
123123

124+
#### A16W8 Float8 WeightOnly Quantization
125+
126+
```python
127+
# for torch 2.5+
128+
from torchao.quantization import quantize_, float8_weight_only
129+
quantize_(model, float8_weight_only())
130+
```
131+
132+
#### A16W8 Float8 Dynamic Quantization with Rowwise Scaling
133+
134+
```python
135+
# for torch 2.5+
136+
from torchao.quantization.quant_api import quantize_, PerRow, float8_dynamic_activation_float8_weight
137+
quantize_(model, float8_dynamic_activation_float8_weight(granularity=PerRow()))
138+
```
139+
124140
#### A16W6 Floating Point WeightOnly Quantization
125141

126142
```python

0 commit comments

Comments
 (0)