Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ The library provides `QuantizedTensor`, a `torch.Tensor` subclass that transpare
| `TensorCoreMXFP8Layout`| MXFP8 E4M3 | SM ≥ 10.0 (Blackwell) | Block quantization with 32-element blocks, E8M0 scales |

```python
from comfy_kitchen.tensor import QuantizedTensor, TensorCoreFP8Layout, TensorCoreNVFP4Layout
from comfy_kitchen.tensor import QuantizedTensor

# Quantize a tensor
x = torch.randn(128, 256, device="cuda", dtype=torch.bfloat16)
qt = QuantizedTensor.from_float(x, TensorCoreFP8Layout)
qt = QuantizedTensor.from_float(x, "TensorCoreFP8Layout")

# Operations dispatch to optimized kernels automatically
output = torch.nn.functional.linear(qt, weight_qt)
Expand Down
2 changes: 1 addition & 1 deletion comfy_kitchen/tensor/fp8.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TensorCoreFP8Layout(QuantizedLayout):

Example:
>>> x = torch.randn(128, 256, device="cuda", dtype=torch.bfloat16)
>>> qt = QuantizedTensor.from_float(x, TensorCoreFP8Layout)
>>> qt = QuantizedTensor.from_float(x, "TensorCoreFP8Layout")
>>> qt.shape
torch.Size([128, 256])
>>> dq = qt.dequantize()
Expand Down