Skip to content
Draft
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
21 changes: 3 additions & 18 deletions auto_round/inference/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def fp8_static_scheme_checker(

BackendInfos["auto_round_kernel_xpu"] = BackendInfo(
device=["xpu"],
sym=[True],
sym=[True, False],
packing_format=GPTQ_FORMAT_NO_ZP,
bits=[4, 8],
group_size=None,
Expand Down Expand Up @@ -486,7 +486,7 @@ def fp8_static_scheme_checker(

BackendInfos["auto_round_kernel_zp_xpu"] = BackendInfo(
device=["xpu"],
sym=[True],
sym=[True, False],
packing_format=GPTQ_FORMAT,
bits=[4, 8],
group_size=None,
Expand All @@ -500,7 +500,7 @@ def fp8_static_scheme_checker(
)

BackendInfos["auto_round_kernel_awq"] = BackendInfo(
device=["cpu"],
device=["cpu", "xpu"],
sym=[True, False],
packing_format=AWQ_FORMAT,
bits=[4],
Expand All @@ -514,21 +514,6 @@ def fp8_static_scheme_checker(
requirements=["torch>=2.8.0", "auto_round_kernel"],
)

BackendInfos["auto_round_kernel_awq_xpu"] = BackendInfo(
device=["xpu"],
sym=[True],
packing_format=AWQ_FORMAT,
bits=[4],
group_size=None,
priority=6,
checkers=[ark_feature_checker],
alias=["ark"],
compute_dtype=["float32", "float16"],
data_type=["int"],
act_bits=WOQ_DEFAULT_ACT_BITS,
requirements=["torch>=2.8.0", "auto_round_kernel"],
)

BackendInfos["ipex_gptq_cpu"] = BackendInfo(
device=["cpu"],
sym=[True, False],
Expand Down
3 changes: 1 addition & 2 deletions auto_round_extension/ark/qlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ def post_init(self):
raise NotImplementedError(
f"Device type {self.qweight.device.type} is not supported. Only CPU and XPU devices are supported."
)
if self.qweight.device.type != "cpu" and self.asym:
raise NotImplementedError("Asymmetric quantization is only supported on CPU devices")

if "awq" in self.QUANT_TYPE:
intweight, zeros = unpack_awq(
self.qweight, self.qzeros, self.bits
Expand Down
6 changes: 2 additions & 4 deletions test/test_ark/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ def main_op(self, format, bits, group_size, sym, dtype, device, fast_cfg=True, t
limit = 1000
if not torch.xpu.is_available():
pytest.skip("No XPU device")
if sym is False:
pytest.skip("No asym support for XPU")
model = AutoModelForCausalLM.from_pretrained(self.model_name, dtype="auto")
tokenizer = AutoTokenizer.from_pretrained(self.model_name)
if fast_cfg:
Expand All @@ -56,9 +54,9 @@ def main_op(self, format, bits, group_size, sym, dtype, device, fast_cfg=True, t
shutil.rmtree(self.save_folder, ignore_errors=True)

@pytest.mark.parametrize("format", ["auto_round", "auto_round:gptqmodel"])
@pytest.mark.parametrize("bits, group_size, sym", [(4, 128, True), (8, 128, True)])
@pytest.mark.parametrize("bits, group_size, sym", [(4, 128, False), (8, 128, True)])
@pytest.mark.parametrize("dtype", [torch.bfloat16])
@pytest.mark.parametrize("device", ["cpu", "xpu"])
@pytest.mark.parametrize("device", ["xpu", "cpu"])
def test_formats(self, format, bits, group_size, sym, dtype, device):
self.main_op(format, bits, group_size, sym, dtype, device)

Expand Down