Skip tests properly (#31308)
* Skip tests properly * [test_all] * Add 'reason' as kwarg for skipTest * [test_all] Fix up * [test_all]
This commit is contained in:
@@ -450,7 +450,7 @@ class AwqFusedTest(unittest.TestCase):
|
||||
outputs = model.generate(**inputs, max_new_tokens=12)
|
||||
self.assertEqual(tokenizer.decode(outputs[0], skip_special_tokens=True), self.EXPECTED_GENERATION_CUSTOM_MODEL)
|
||||
|
||||
@unittest.skip("Not enough GPU memory on CI runners")
|
||||
@unittest.skip(reason="Not enough GPU memory on CI runners")
|
||||
@require_torch_multi_gpu
|
||||
def test_generation_mixtral_fused(self):
|
||||
"""
|
||||
|
||||
@@ -496,7 +496,7 @@ class Bnb4BitTestTraining(Base4bitTest):
|
||||
|
||||
def test_training(self):
|
||||
if version.parse(importlib.metadata.version("bitsandbytes")) < version.parse("0.37.0"):
|
||||
return
|
||||
self.skipTest(reason="This test requires bitsandbytes >= 0.37.0")
|
||||
|
||||
# Step 1: freeze all parameters
|
||||
model = AutoModelForCausalLM.from_pretrained(self.model_name, load_in_4bit=True)
|
||||
|
||||
@@ -826,7 +826,7 @@ class MixedInt8TestTraining(BaseMixedInt8Test):
|
||||
|
||||
def test_training(self):
|
||||
if version.parse(importlib.metadata.version("bitsandbytes")) < version.parse("0.37.0"):
|
||||
return
|
||||
self.skipTest(reason="This test requires bitsandbytes>=0.37.0")
|
||||
|
||||
# Step 1: freeze all parameters
|
||||
model = AutoModelForCausalLM.from_pretrained(self.model_name, load_in_8bit=True)
|
||||
|
||||
@@ -332,20 +332,23 @@ class QuantoQuantizationOffloadTest(QuantoQuantizationTest):
|
||||
"lm_head": 0,
|
||||
}
|
||||
|
||||
# the execution device is a gpu
|
||||
@unittest.skip(reason="The execution device is a gpu")
|
||||
def test_generate_quality_cpu(self):
|
||||
pass
|
||||
|
||||
# we can't save offloaded values
|
||||
@unittest.skip(reason="We can't save offloaded values")
|
||||
def test_serialization_bin(self):
|
||||
pass
|
||||
|
||||
@unittest.skip
|
||||
def test_serialization_safetensors(self):
|
||||
pass
|
||||
|
||||
@unittest.skip
|
||||
def test_compare_with_quanto(self):
|
||||
pass
|
||||
|
||||
@unittest.skip
|
||||
def test_load_from_quanto_saved(self):
|
||||
pass
|
||||
|
||||
@@ -370,7 +373,7 @@ class QuantoQuantizationOffloadTest(QuantoQuantizationTest):
|
||||
)
|
||||
|
||||
|
||||
@unittest.skip("Skipping test class because serialization is not supported yet")
|
||||
@unittest.skip(reason="Skipping test class because serialization is not supported yet")
|
||||
class QuantoQuantizationSerializationTest(QuantoQuantizationTest):
|
||||
"""
|
||||
Perform the same tests as in QuantoQuantizationTest but with a serialized model.
|
||||
@@ -403,7 +406,7 @@ class QuantoQuantizationSerializationTest(QuantoQuantizationTest):
|
||||
)
|
||||
|
||||
|
||||
@unittest.skip("Skipping test class because serialization is not supported yet")
|
||||
@unittest.skip(reason="Skipping test class because serialization is not supported yet")
|
||||
class QuantoQuantizationSerializationCudaTest(QuantoQuantizationTest):
|
||||
"""
|
||||
Perform the same tests as in QuantoQuantizationTest but with model on cuda
|
||||
@@ -422,7 +425,7 @@ class QuantoQuantizationQBitsTensorOffloadTest(QuantoQuantizationOffloadTest):
|
||||
weights = "int4"
|
||||
|
||||
|
||||
@unittest.skip("Skipping test class because serialization is not supported yet")
|
||||
@unittest.skip(reason="Skipping test class because serialization is not supported yet")
|
||||
class QuantoQuantizationQBitsTensorSerializationTest(QuantoQuantizationSerializationTest):
|
||||
EXPECTED_OUTPUTS = "Hello my name is Nils, I am a student of the University"
|
||||
weights = "int4"
|
||||
|
||||
Reference in New Issue
Block a user