File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
torchao/quantization/quantize_/workflows/int4 Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ TorchAO is an easy to use quantization library for native PyTorch. TorchAO works
6060
6161Check out our [ docs] ( https://docs.pytorch.org/ao/main/ ) for more details!
6262
63+ ## Third-party Pipeline Status
64+
65+ | Backend | Inference |
66+ | ---------- | ------------------------------------------------------------ |
67+ | Ascend NPU | [ ![ Ascend NPU] ( https://github.com/Ascend/Ascend-CI/actions/workflows/torchao.yml/badge.svg )] ( |
68+
6369## 🚀 Quick Start
6470
6571First, install TorchAO. We recommend installing the latest stable version:
Original file line number Diff line number Diff line change @@ -163,9 +163,12 @@ def _from_hp_npu(
163163 w : torch .Tensor ,
164164 block_size : List [int ],
165165):
166- # Require PyTorch 2.7.1+ for NPU backend ops and backward compatibility.
167- assert torch_version_at_least ("2.7.1" ), (
168- "Need pytorch 2.7.1+ for NPU backend op support."
166+ assert (
167+ torch .accelerator .is_available ()
168+ and torch .accelerator .current_accelerator ().type == "npu"
169+ and torch_version_at_least ("2.7.1" )
170+ ), (
171+ f"PyTorch NPU 2.7.1+ needed for int4 packing and matmul ops, { torch .__version__ } found"
169172 )
170173
171174 assert w .ndim == 2 and w .device .type == "npu" , (
You can’t perform that action at this time.
0 commit comments