Skip to content

add assertion error about config migration to prototype/autoround #1852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 8, 2025
Merged
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
10 changes: 8 additions & 2 deletions test/prototype/test_autoround.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def _check_params_and_buffers_type(module, check_fun):


class TestAutoRound(TestCase):
@pytest.mark.skip(not TORCH_VERSION_AT_LEAST_2_5, "Requires torch 2.5 or later")
@pytest.mark.skip("these tests are broken on main branch")
@pytest.mark.skipif(
not TORCH_VERSION_AT_LEAST_2_5, reason="Requires torch 2.5 or later"
)
@parametrize("device", _AVAILABLE_DEVICES)
@torch.no_grad()
def test_auto_round(self, device: str):
Expand Down Expand Up @@ -127,7 +130,10 @@ def test_auto_round(self, device: str):
after_quant = m(*example_inputs)
assert after_quant is not None, "Quantized model forward pass failed"

@pytest.mark.skip(not TORCH_VERSION_AT_LEAST_2_5, "Requires torch 2.5 or later")
@pytest.mark.skip("these tests are broken on main branch")
@pytest.mark.skipif(
not TORCH_VERSION_AT_LEAST_2_5, reason="Requires torch 2.5 or later"
)
@parametrize("device", _AVAILABLE_DEVICES)
@torch.no_grad()
def test_wrap_model_with_multi_tensor(self, device: str):
Expand Down
4 changes: 4 additions & 0 deletions torchao/prototype/autoround/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ def apply_auto_round():
More details about the auto-round can be found at https://arxiv.org/abs/2309.05516.
"""

raise AssertionError(
"Please migrate this function to direct configuration, see https://github.com/pytorch/ao/issues/1690 for details"
)

def _apply_auto_round(optimized_model: torch.nn.Module):
"""
The `optimized_model` includes `Linear` layers optimized by auto-round, which includes `qdq_weight`, `scale`, `zp`.
Expand Down
Loading