Skip to content

Commit

Permalink
sles skips
Browse files Browse the repository at this point in the history
  • Loading branch information
Cemberk committed Jan 21, 2025
1 parent dd200d7 commit 86db1a9
Show file tree
Hide file tree
Showing 45 changed files with 377 additions and 26 deletions.
6 changes: 6 additions & 0 deletions tests/models/bert/test_modeling_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
require_torch_accelerator,
slow,
torch_device,
skipIfRocm
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -482,6 +483,11 @@ def _prepare_for_class(self, inputs_dict, model_class, return_labels=False):
)
return inputs_dict

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = BertModelTester(self)
self.config_tester = ConfigTester(self, config_class=BertConfig, hidden_size=37)
Expand Down
7 changes: 6 additions & 1 deletion tests/models/biogpt/test_modeling_biogpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import unittest

from transformers import BioGptConfig, is_sacremoses_available, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device
from transformers.testing_utils import require_torch, slow, torch_device, skipIfRocm

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
Expand Down Expand Up @@ -298,6 +298,11 @@ class BioGptModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMix
)
test_pruning = False

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = BioGptModelTester(self)
self.config_tester = ConfigTester(self, config_class=BioGptConfig, hidden_size=37)
Expand Down
6 changes: 6 additions & 0 deletions tests/models/chameleon/test_modeling_chameleon.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
require_torch,
slow,
torch_device,
skipIfRocm
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -285,6 +286,11 @@ class ChameleonModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTester
test_pruning = False
fx_compatible = False

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = ChameleonModelTester(self)
self.config_tester = ConfigTester(self, config_class=ChameleonConfig, hidden_size=37)
Expand Down
6 changes: 6 additions & 0 deletions tests/models/cohere/test_modeling_cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
require_torch_sdpa,
slow,
torch_device,
skipIfRocm,
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -287,6 +288,11 @@ class CohereModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMix
# This is because we are hitting edge cases with the causal_mask buffer
model_split_percents = [0.5, 0.7, 0.8]

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = CohereModelTester(self)
self.config_tester = ConfigTester(self, config_class=CohereConfig, hidden_size=37)
Expand Down
14 changes: 12 additions & 2 deletions tests/models/dbrx/test_modeling_dbrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,22 @@ class DbrxModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin
test_headmasking = False
test_pruning = False

@skipIfRocm(arch='gfx1201')
@skipIfRocm(os_name='sles')
def test_beam_search_low_memory(self):
super().test_beam_search_low_memory()
pass

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_with_static_cache(self):
super().test_generate_with_static_cache()
pass

@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_from_inputs_embeds_with_static_cache(self):
super().test_generate_from_inputs_embeds_with_static_cache()
pass
Expand Down
6 changes: 6 additions & 0 deletions tests/models/falcon/test_modeling_falcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
require_torch_sdpa,
slow,
torch_device,
skipIfRocm,
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -321,6 +322,11 @@ def is_pipeline_test_to_skip(
):
return True

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = FalconModelTester(self)
self.config_tester = ConfigTester(self, config_class=FalconConfig, hidden_size=37)
Expand Down
6 changes: 6 additions & 0 deletions tests/models/gemma/test_modeling_gemma.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
require_torch_sdpa,
slow,
torch_device,
skipIfRocm,
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -335,6 +336,11 @@ def is_pipeline_test_to_skip(
):
return True

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = GemmaModelTester(self)
self.config_tester = ConfigTester(self, config_class=GemmaConfig, hidden_size=37)
Expand Down
11 changes: 11 additions & 0 deletions tests/models/glm/test_modeling_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
require_torch_sdpa,
slow,
torch_device,
skipIfRocm,
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -300,6 +301,16 @@ class GlmModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin,
test_headmasking = False
test_pruning = False

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

@skipIfRocm(os_name='sles')
def test_beam_search_low_memory(self):
super().test_beam_search_low_memory()
pass

def setUp(self):
self.model_tester = GlmModelTester(self)
self.config_tester = ConfigTester(self, config_class=GlmConfig, hidden_size=37)
Expand Down
6 changes: 6 additions & 0 deletions tests/models/gpt2/test_modeling_gpt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
require_torch_gpu,
slow,
torch_device,
skipIfRocm,
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -534,6 +535,11 @@ def _prepare_for_class(self, inputs_dict, model_class, return_labels=False):
)
return inputs_dict

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = GPT2ModelTester(self)
self.config_tester = ConfigTester(self, config_class=GPT2Config, n_embd=37)
Expand Down
12 changes: 11 additions & 1 deletion tests/models/gpt_bigcode/test_modeling_gpt_bigcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from parameterized import parameterized

from transformers import GPTBigCodeConfig, is_torch_available
from transformers.testing_utils import cleanup, require_torch, slow, torch_device
from transformers.testing_utils import cleanup, require_torch, slow, torch_device, skipIfRocm

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
Expand Down Expand Up @@ -453,6 +453,11 @@ def test_disk_offload(self):
def test_past_key_values_format(self):
pass

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def test_gpt_bigcode_model(self):
config_and_inputs = self.model_tester.prepare_config_and_inputs()
self.model_tester.create_and_check_gpt_bigcode_model(*config_and_inputs)
Expand Down Expand Up @@ -503,6 +508,11 @@ class GPTBigCodeMHAModelTest(GPTBigCodeModelTest):
# `parameterized_class` breaks with mixins, so we use inheritance instead
multi_query = False

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass


@unittest.skipIf(
not is_torch_greater_or_equal_than_1_12,
Expand Down
12 changes: 11 additions & 1 deletion tests/models/gpt_neox/test_modeling_gpt_neox.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,21 @@ class GPTNeoXModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
test_model_parallel = False
test_head_masking = False

@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_with_static_cache():
super().test_generate_with_static_cache()
pass

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

@skipIfRocm(os_name='sles')
def test_beam_search_low_memory(self):
super().test_beam_search_low_memory()
pass

def setUp(self):
self.model_tester = GPTNeoXModelTester(self)
self.config_tester = ConfigTester(self, config_class=GPTNeoXConfig, hidden_size=64, num_attention_heads=8)
Expand Down
14 changes: 12 additions & 2 deletions tests/models/granite/test_modeling_granite.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,26 @@ class GraniteModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
# This is because we are hitting edge cases with the causal_mask buffer
model_split_percents = [0.5, 0.7, 0.8]

@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_from_inputs_embeds_with_static_cache(self):
super().test_generate_from_inputs_embeds_with_static_cache()
pass

@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_with_static_cache(self):
super().test_generate_with_static_cache()
pass

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

@skipIfRocm(os_name='sles')
def test_beam_search_low_memory(self):
super().test_beam_search_low_memory()
pass

def setUp(self):
self.model_tester = GraniteModelTester(self)
self.config_tester = ConfigTester(self, config_class=GraniteConfig, hidden_size=37)
Expand Down
14 changes: 12 additions & 2 deletions tests/models/granitemoe/test_modeling_granitemoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,26 @@ class GraniteMoeModelTest(ModelTesterMixin, GenerationTesterMixin, unittest.Test
# This is because we are hitting edge cases with the causal_mask buffer
model_split_percents = [0.5, 0.7, 0.8]

@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_with_static_cache(self):
super().test_generate_with_static_cache()
pass

@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_from_inputs_embeds_with_static_cache(self):
super().test_generate_from_inputs_embeds_with_static_cache()
pass

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

@skipIfRocm(os_name='sles')
def test_beam_search_low_memory(self):
super().test_beam_search_low_memory()
pass

def setUp(self):
self.model_tester = GraniteMoeModelTester(self)
self.config_tester = ConfigTester(self, config_class=GraniteMoeConfig, hidden_size=37)
Expand Down
3 changes: 2 additions & 1 deletion tests/models/hubert/test_modeling_hubert.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import pytest

from transformers import HubertConfig, is_torch_available
from transformers.testing_utils import require_soundfile, require_torch, slow, torch_device
from transformers.testing_utils import require_soundfile, require_torch, slow, torch_device, skipIfRocm
from transformers.utils import is_torch_fx_available

from ...test_configuration_common import ConfigTester
Expand Down Expand Up @@ -590,6 +590,7 @@ def test_model(self):
config_and_inputs = self.model_tester.prepare_config_and_inputs()
self.model_tester.create_and_check_model(*config_and_inputs)

@skipIfRocm(os_name='sles')
def test_batched_inference(self):
config_and_inputs = self.model_tester.prepare_config_and_inputs()
self.model_tester.create_and_check_batch_inference(*config_and_inputs)
Expand Down
5 changes: 3 additions & 2 deletions tests/models/idefics/test_modeling_idefics.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,12 @@ class IdeficsForVisionText2TextTest(IdeficsModelTest, GenerationTesterMixin, uni
all_generative_model_classes = (IdeficsForVisionText2Text,) if is_torch_available() else ()


@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_from_inputs_embeds_with_static_cache(self):
super().test_generate_from_inputs_embeds_with_static_cache()
pass

@skipIfRocm(arch='gfx1201')
@skipIfRocm(arch='gfx1201', os_name='sles')
def test_generate_with_static_cache(self):
super().test_generate_with_static_cache()
pass
Expand All @@ -626,6 +626,7 @@ def test_eager_matches_sdpa_inference(self, torch_dtype):
pass

@pytest.mark.generate
@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
"""Overwrite because IDEFICS needs image attention mask to be also padded"""
# NOTE: left-padding results in small numerical differences. This is expected.
Expand Down
5 changes: 5 additions & 0 deletions tests/models/jamba/test_modeling_jamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ class JambaModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixi
test_headmasking = False
test_pruning = False

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

def setUp(self):
self.model_tester = JambaModelTester(self)
self.config_tester = JambaConfigTester(self, config_class=JambaConfig, hidden_size=37)
Expand Down
6 changes: 6 additions & 0 deletions tests/models/jetmoe/test_modeling_jetmoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
require_torch_gpu,
slow,
torch_device,
skipIfRocm
)

from ...generation.test_utils import GenerationTesterMixin
Expand Down Expand Up @@ -299,6 +300,11 @@ class JetMoeModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMix
test_disk_offload_bin = False
test_disk_offload_safetensors = False

@skipIfRocm(os_name='sles')
def test_left_padding_compatibility(self):
super().test_left_padding_compatibility()
pass

@parameterized.expand([(1, False), (1, True), (4, False)])
def test_new_cache_format(self, num_beams, do_sample):
pass
Expand Down
Loading

0 comments on commit 86db1a9

Please sign in to comment.