From 83de0d9b08efcc0d086f7e6e5a986155c0b60f1f Mon Sep 17 00:00:00 2001 From: Kaihui-intel Date: Mon, 13 Oct 2025 23:06:44 -0400 Subject: [PATCH 1/2] fix rtn tuning_device Signed-off-by: Kaihui-intel --- auto_round/compressors/base.py | 2 +- test/test_cuda/test_multiple_card.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/auto_round/compressors/base.py b/auto_round/compressors/base.py index 48cf0cd1a..8ceaefc00 100644 --- a/auto_round/compressors/base.py +++ b/auto_round/compressors/base.py @@ -1422,7 +1422,7 @@ def _quantize_layer_via_rtn(self, name: str) -> None: m.zp = None else: try: - m = m.to(self.device) + m = m.to(m.tuning_device if hasattr(m, "tuning_device") else self.device) m = WrapperLinear( m, enable_minmax_tuning=False, diff --git a/test/test_cuda/test_multiple_card.py b/test/test_cuda/test_multiple_card.py index ad33f071b..43e67e957 100644 --- a/test/test_cuda/test_multiple_card.py +++ b/test/test_cuda/test_multiple_card.py @@ -241,6 +241,19 @@ def test_device_map_dict(self): device_map=device_map, ) autoround.quantize() + + # test rtn + autoround = AutoRound( + model_name, + tokenizer, + bits=bits, + group_size=group_size, + sym=sym, + iters=0, + seqlen=2, + device_map=device_map, + ) + autoround.quantize() @multi_card @require_greater_than_050 From 0719221137e49a0fa85841edc36e57e4c767be50 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 03:09:00 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- test/test_cuda/test_multiple_card.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_cuda/test_multiple_card.py b/test/test_cuda/test_multiple_card.py index 43e67e957..f2f1685be 100644 --- a/test/test_cuda/test_multiple_card.py +++ b/test/test_cuda/test_multiple_card.py @@ -241,7 +241,7 @@ def test_device_map_dict(self): device_map=device_map, ) autoround.quantize() - + # test rtn autoround = AutoRound( model_name,