-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[tests] add require_torch_sdpa
for test that needs sdpa support
#30408
Conversation
require_torch_sdpa
for test that needs sdpa support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging into this!
Looks good to me! Would be great to add the bnb requirement for the other test too
@@ -393,6 +393,7 @@ def test_batched_4bit(self): | |||
output = model.generate(**inputs, max_new_tokens=40, do_sample=False) | |||
self.assertEqual(tokenizer.batch_decode(output, skip_special_tokens=True), EXPECTED_TEXT) | |||
|
|||
@require_torch_sdpa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the test about should have require_bitsandbytes
too 👀
@ydshieh If we have this requirement, will this test be run as part of the slow overnight tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amyeroberts I pushed a commit to add the require_bitsandbytes
flag for test_batched_4bit
, test_batched_small_model_logits
is fine without bitsandbytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amyeroberts Well, I guess I made a huge mistake in #29208 where I removed
# Add bitsandbytes for mixed int8 testing
RUN python3 -m pip install --no-cache-dir bitsandbytes
because we aimed to move the quantization tests outside the main model CI job.
@younesbelkada @SunMarc I think we should add the above back to
docker/transformers-all-latest-gpu/Dockerfile
as there are some model tests using bnb
class InstructBlipModelIntegrationTest(unittest.TestCase):
@require_bitsandbytes
@require_accelerate
def test_inference_vicuna_7b(self):
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sounds great ! #30427
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that there are around 20 models with bnb tests. So yeah, let's add bitsandbytes package in the main CI.
Thanks for handling this and updating! |
What does this PR do?
I got this test failed in my XPU environment. After debugging, I found that the EXPECTED_LOGITS in this test are computed with the assumption that
_attn_implementation
is set tosdpa
. The code for setting the_attn_implementation
are this line and this line. I experimented to downgrade my torch version to make_attn_implementation
value to eager and it fails on CUDA. So we neeed to add the makerrequire_torch_sdpa
to this test.@ArthurZucker and @amyeroberts