Repository: huggingface/transformers
Pull request: ! Fixed device_propreties unpacking in common tests

I added some code in a previous commit that altered `DeviceProperties`'s second element, which can now be a tuple. This broke some code outside the file it was changed in, this fixes it.

Changed files:
filename: tests/models/musicgen/test_modeling_musicgen.py
patch: @@ -31,6 +31,7 @@
     T5Config,
 )
 from transformers.testing_utils import (
+    Expectations,
     get_device_properties,
     is_torch_available,
     require_flash_attn,
@@ -1051,7 +1052,8 @@ def test_sdpa_can_dispatch_on_flash(self):
         if not self.has_attentions:
             self.skipTest(reason="Model architecture does not support attentions")
 
-        (device_type, major) = get_device_properties()
+        device_properties = get_device_properties()
+        device_type, major, minor = Expectations.unpack(device_properties)
         if device_type == "cuda" and major < 8:
             self.skipTest(reason="This test requires an NVIDIA GPU with compute capability >= 8.0")
         elif device_type == "rocm" and major < 9:

filename: tests/models/musicgen_melody/test_modeling_musicgen_melody.py
patch: @@ -30,6 +30,7 @@
     T5Config,
 )
 from transformers.testing_utils import (
+    Expectations,
     get_device_properties,
     is_torch_available,
     is_torchaudio_available,
@@ -1051,7 +1052,8 @@ def test_sdpa_can_dispatch_on_flash(self):
         if not self.has_attentions:
             self.skipTest(reason="Model architecture does not support attentions")
 
-        (device_type, major) = get_device_properties()
+        device_properties = get_device_properties()
+        device_type, major, minor = Expectations.unpack(device_properties)
         if device_type == "cuda" and major < 8:
             self.skipTest(reason="This test requires an NVIDIA GPU with compute capability >= 8.0")
         elif device_type == "rocm" and major < 9:

filename: tests/test_modeling_common.py
patch: @@ -73,6 +73,7 @@
 )
 from transformers.testing_utils import (
     CaptureLogger,
+    Expectations,
     backend_empty_cache,
     get_device_properties,
     hub_retry,
@@ -3835,7 +3836,8 @@ def test_sdpa_can_dispatch_on_flash(self):
         if not self.has_attentions:
             self.skipTest(reason="Model architecture does not support attentions")
 
-        (device_type, major) = get_device_properties()
+        device_properties = get_device_properties()
+        device_type, major, minor = Expectations.unpack(device_properties)
         if device_type == "cuda" and major < 8:
             self.skipTest(reason="This test requires an NVIDIA GPU with compute capability >= 8.0")
         elif device_type == "rocm" and major < 9:
@@ -3883,7 +3885,8 @@ def test_sdpa_can_compile_dynamic(self):
         if not self.has_attentions:
             self.skipTest(reason="Model architecture does not support attentions")
 
-        (device_type, major) = get_device_properties()
+        device_properties = get_device_properties()
+        device_type, major, minor = Expectations.unpack(device_properties)
         if device_type == "cuda" and major < 8:
             self.skipTest(reason="This test requires an NVIDIA GPU with compute capability >= 8.0")
         elif device_type == "rocm" and major < 9: