diff --git a/README.md b/README.md index dc5d448..71e3607 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/comfy_kitchen/tensor/fp8.py b/comfy_kitchen/tensor/fp8.py index 2c20bc1..d53e376 100644 --- a/comfy_kitchen/tensor/fp8.py +++ b/comfy_kitchen/tensor/fp8.py @@ -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()