From 00e7abf656cdf7fa95f53cadabb95c6d5c0969e8 Mon Sep 17 00:00:00 2001 From: Rhui Dih Lee Date: Fri, 19 Jul 2024 21:23:49 +0800 Subject: [PATCH] remove extra code --- tests/models/falcon/test_modeling_falcon.py | 7 ------- tests/models/gemma/test_modeling_gemma.py | 6 ------ tests/models/llama/test_modeling_llama.py | 6 ------ tests/models/mistral/test_modeling_mistral.py | 7 +------ tests/models/mixtral/test_modeling_mixtral.py | 6 ------ tests/models/phi/test_modeling_phi.py | 6 ------ tests/models/starcoder2/test_modeling_starcoder2.py | 6 ------ 7 files changed, 1 insertion(+), 43 deletions(-) diff --git a/tests/models/falcon/test_modeling_falcon.py b/tests/models/falcon/test_modeling_falcon.py index 0257e8e1c117..2fb9e664c7b3 100644 --- a/tests/models/falcon/test_modeling_falcon.py +++ b/tests/models/falcon/test_modeling_falcon.py @@ -29,10 +29,8 @@ from transformers.testing_utils import ( is_flaky, require_bitsandbytes, - require_flash_attn, require_torch, require_torch_sdpa, - require_torch_gpu, slow, torch_device, ) @@ -583,11 +581,6 @@ def test_eager_matches_sdpa_generate(self): self.assertTrue(torch.allclose(res_eager, res_sdpa)) - @require_flash_attn - @require_torch_gpu - @slow - def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): - super().test_flash_attention_2_padding_matches_padding_free_with_position_ids() @require_torch class FalconLanguageGenerationTest(unittest.TestCase): diff --git a/tests/models/gemma/test_modeling_gemma.py b/tests/models/gemma/test_modeling_gemma.py index 76b4a8781444..36f596694803 100644 --- a/tests/models/gemma/test_modeling_gemma.py +++ b/tests/models/gemma/test_modeling_gemma.py @@ -526,12 +526,6 @@ def test_flash_attn_2_equivalence(self): assert torch.allclose(logits_fa, logits, atol=3e-3) - @require_flash_attn - @require_torch_gpu - @slow - def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): - super().test_flash_attention_2_padding_matches_padding_free_with_position_ids() - @slow @require_torch_gpu class GemmaIntegrationTest(unittest.TestCase): diff --git a/tests/models/llama/test_modeling_llama.py b/tests/models/llama/test_modeling_llama.py index 79d25d051bc4..85d352fc814f 100644 --- a/tests/models/llama/test_modeling_llama.py +++ b/tests/models/llama/test_modeling_llama.py @@ -590,12 +590,6 @@ def test_use_flash_attention_2_true(self): if not has_flash: raise ValueError("The flash model should have flash attention layers") - @require_flash_attn - @require_torch_gpu - @slow - def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): - super().test_flash_attention_2_padding_matches_padding_free_with_position_ids() - @require_torch_sdpa @slow def test_eager_matches_sdpa_generate(self): diff --git a/tests/models/mistral/test_modeling_mistral.py b/tests/models/mistral/test_modeling_mistral.py index c150dfca7413..3f47ddde1fa2 100644 --- a/tests/models/mistral/test_modeling_mistral.py +++ b/tests/models/mistral/test_modeling_mistral.py @@ -490,12 +490,7 @@ def test_flash_attn_2_generate_use_cache(self): @slow def test_flash_attn_2_inference_equivalence_right_padding(self): self.skipTest(reason="Mistral flash attention does not support right padding") - - @require_flash_attn - @require_torch_gpu - @slow - def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): - super().test_flash_attention_2_padding_matches_padding_free_with_position_ids() + @require_torch_gpu class MistralIntegrationTest(unittest.TestCase): diff --git a/tests/models/mixtral/test_modeling_mixtral.py b/tests/models/mixtral/test_modeling_mixtral.py index 2ffaa4b8f166..db9641e3dcb2 100644 --- a/tests/models/mixtral/test_modeling_mixtral.py +++ b/tests/models/mixtral/test_modeling_mixtral.py @@ -492,12 +492,6 @@ def test_flash_attn_2_generate_use_cache(self): def test_flash_attn_2_inference_equivalence_right_padding(self): self.skipTest(reason="Mixtral flash attention does not support right padding") - @require_flash_attn - @require_torch_gpu - @slow - def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): - super().test_flash_attention_2_padding_matches_padding_free_with_position_ids() - # Ignore copy def test_load_balancing_loss(self): r""" diff --git a/tests/models/phi/test_modeling_phi.py b/tests/models/phi/test_modeling_phi.py index 99691a3c3942..f395b70c1ee2 100644 --- a/tests/models/phi/test_modeling_phi.py +++ b/tests/models/phi/test_modeling_phi.py @@ -495,12 +495,6 @@ def test_flash_attn_2_generate_padding_right(self): self.assertListEqual(output_native, output_fa_2) - @require_flash_attn - @require_torch_gpu - @slow - def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): - super().test_flash_attention_2_padding_matches_padding_free_with_position_ids() - @slow @require_torch class PhiIntegrationTest(unittest.TestCase): diff --git a/tests/models/starcoder2/test_modeling_starcoder2.py b/tests/models/starcoder2/test_modeling_starcoder2.py index 328c1a808804..edbc1bce6396 100644 --- a/tests/models/starcoder2/test_modeling_starcoder2.py +++ b/tests/models/starcoder2/test_modeling_starcoder2.py @@ -484,12 +484,6 @@ def test_flash_attn_2_inference_equivalence_right_padding(self): self.skipTest(reason="Starcoder2 flash attention does not support right padding") - @require_flash_attn - @require_torch_gpu - @slow - def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): - super().test_flash_attention_2_padding_matches_padding_free_with_position_ids() - @slow @require_torch_gpu class Starcoder2IntegrationTest(unittest.TestCase):