Skip to content
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

Skipping aqlm non working inference tests till fix merged #34865

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions src/transformers/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,17 @@ def tooslow(test_case):
return unittest.skip(reason="test is too slow")(test_case)


def skip_if_aqlm_inference_not_fixed(test_case):
"""
Decorator marking tests for inference using aqlm models.
These tests will be skipped till the issue from aqlm side is resolved
"""
return unittest.skip(
reason="inference doesn't work with quantized aqlm models using torch.Any type with recent torch versions"
)(test_case)


Comment on lines +349 to +359
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to create a seperate function for this as this is something that we will remove. You can just use the decorator like this @skip("reason_for_skipping")

def skip_if_not_implemented(test_func):
@functools.wraps(test_func)
def wrapper(*args, **kwargs):
Expand Down
4 changes: 4 additions & 0 deletions tests/quantization/aqlm_integration/test_aqlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
require_aqlm,
require_torch_gpu,
require_torch_multi_gpu,
skip_if_aqlm_inference_not_fixed,
slow,
torch_device,
)
Expand Down Expand Up @@ -142,6 +143,7 @@ def test_quantized_model_conversion(self):

self.assertEqual(nb_linears - 1, nb_aqlm_linear)

@skip_if_aqlm_inference_not_fixed
def test_quantized_model(self):
"""
Simple test that checks if the quantized model is working properly
Expand All @@ -158,6 +160,7 @@ def test_raise_if_non_quantized(self):
with self.assertRaises(ValueError):
_ = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=quantization_config)

@skip_if_aqlm_inference_not_fixed
def test_save_pretrained(self):
"""
Simple test that checks if the quantized model is working properly after being saved and loaded
Expand All @@ -171,6 +174,7 @@ def test_save_pretrained(self):
output = model.generate(**input_ids, max_new_tokens=self.max_new_tokens)
self.assertEqual(self.tokenizer.decode(output[0], skip_special_tokens=True), self.EXPECTED_OUTPUT)

@skip_if_aqlm_inference_not_fixed
@require_torch_multi_gpu
def test_quantized_model_multi_gpu(self):
"""
Expand Down
Loading