From e42664d55022af409c9f63cf462f90106467f521 Mon Sep 17 00:00:00 2001 From: Amy Roberts <22614925+amyeroberts@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:49:51 +0000 Subject: [PATCH 1/2] Patch to skip currently failing tests --- .../bert_generation/test_modeling_bert_generation.py | 6 ++++++ tests/models/fsmt/test_modeling_fsmt.py | 6 ++++++ tests/models/marian/test_modeling_marian.py | 6 ++++++ tests/models/musicgen/test_modeling_musicgen.py | 4 ++++ tests/models/reformer/test_modeling_reformer.py | 12 ++++++++++++ .../xlm_roberta_xl/test_modeling_xlm_roberta_xl.py | 6 ++++++ 6 files changed, 40 insertions(+) diff --git a/tests/models/bert_generation/test_modeling_bert_generation.py b/tests/models/bert_generation/test_modeling_bert_generation.py index ecd7a459e0e..4e0e3dc8e1c 100644 --- a/tests/models/bert_generation/test_modeling_bert_generation.py +++ b/tests/models/bert_generation/test_modeling_bert_generation.py @@ -305,6 +305,12 @@ def test_model_from_pretrained(self): model = BertGenerationEncoder.from_pretrained("google/bert_for_seq_generation_L-24_bbc_encoder") self.assertIsNotNone(model) + @unittest.skip( + "Not currently compatible. Fails with - NotImplementedError: Cannot copy out of meta tensor; no data!" + ) + def test_save_load_low_cpu_mem_usage(self): + pass + @require_torch class BertGenerationEncoderIntegrationTest(unittest.TestCase): diff --git a/tests/models/fsmt/test_modeling_fsmt.py b/tests/models/fsmt/test_modeling_fsmt.py index da73b8d41d9..18ee40e471a 100644 --- a/tests/models/fsmt/test_modeling_fsmt.py +++ b/tests/models/fsmt/test_modeling_fsmt.py @@ -329,6 +329,12 @@ def test_tie_model_weights(self): def test_resize_embeddings_untied(self): pass + @unittest.skip( + "Not currently compatible. Fails with - NotImplementedError: Cannot copy out of meta tensor; no data!" + ) + def test_save_load_low_cpu_mem_usage(self): + pass + @require_torch class FSMTHeadTests(unittest.TestCase): diff --git a/tests/models/marian/test_modeling_marian.py b/tests/models/marian/test_modeling_marian.py index 53a67c20459..e393c7d1032 100644 --- a/tests/models/marian/test_modeling_marian.py +++ b/tests/models/marian/test_modeling_marian.py @@ -372,6 +372,12 @@ def test_training_gradient_checkpointing_use_reentrant(self): def test_training_gradient_checkpointing_use_reentrant_false(self): pass + @unittest.skip( + "Not currently compatible. Fails with - NotImplementedError: Cannot copy out of meta tensor; no data!" + ) + def test_save_load_low_cpu_mem_usage(self): + pass + def assert_tensors_close(a, b, atol=1e-12, prefix=""): """If tensors have different shapes, different values or a and b are not both tensors, raise a nice Assertion error.""" diff --git a/tests/models/musicgen/test_modeling_musicgen.py b/tests/models/musicgen/test_modeling_musicgen.py index b7952d27a71..3a9d1af89db 100644 --- a/tests/models/musicgen/test_modeling_musicgen.py +++ b/tests/models/musicgen/test_modeling_musicgen.py @@ -1400,6 +1400,10 @@ def test_generate_text_audio_prompt(self): ) # input values take shape 32000 and we generate from there self.assertTrue(torch.allclose(output_values[0, 0, -16:].cpu(), EXPECTED_VALUES, atol=1e-4)) + @unittest.skip("Fails with - TypeError: _weight_norm_interface() missing 1 required positional argument: 'dim'") + def test_save_load_low_cpu_mem_usage(self): + pass + @require_torch class MusicgenStereoIntegrationTests(unittest.TestCase): diff --git a/tests/models/reformer/test_modeling_reformer.py b/tests/models/reformer/test_modeling_reformer.py index 11cd7e1a33b..b1796a6c534 100644 --- a/tests/models/reformer/test_modeling_reformer.py +++ b/tests/models/reformer/test_modeling_reformer.py @@ -687,6 +687,12 @@ def _check_hidden_states_for_generate( def test_left_padding_compatibility(self): pass + @unittest.skip( + "Not currently compatible. Fails with - NotImplementedError: Cannot copy out of meta tensor; no data!" + ) + def test_save_load_low_cpu_mem_usage(self): + pass + @require_torch class ReformerLSHAttnModelTest( @@ -848,6 +854,12 @@ def test_past_key_values_format(self): def test_left_padding_compatibility(self): pass + @unittest.skip( + "Not currently compatible. Fails with - NotImplementedError: Cannot copy out of meta tensor; no data!" + ) + def test_save_load_low_cpu_mem_usage(self): + pass + @require_torch @require_sentencepiece diff --git a/tests/models/xlm_roberta_xl/test_modeling_xlm_roberta_xl.py b/tests/models/xlm_roberta_xl/test_modeling_xlm_roberta_xl.py index 828d6a02a6a..c6513ef7962 100644 --- a/tests/models/xlm_roberta_xl/test_modeling_xlm_roberta_xl.py +++ b/tests/models/xlm_roberta_xl/test_modeling_xlm_roberta_xl.py @@ -515,6 +515,12 @@ def test_create_position_ids_from_inputs_embeds(self): self.assertEqual(position_ids.shape, expected_positions.shape) self.assertTrue(torch.all(torch.eq(position_ids, expected_positions))) + @unittest.skip( + "Not currently compatible. Fails with - NotImplementedError: Cannot copy out of meta tensor; no data!" + ) + def test_save_load_low_cpu_mem_usage(self): + pass + @require_torch class XLMRobertaModelXLIntegrationTest(unittest.TestCase): From 20d549ff347130fd67c64e48224681d5dcfd41c9 Mon Sep 17 00:00:00 2001 From: Amy Roberts <22614925+amyeroberts@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:02:37 +0000 Subject: [PATCH 2/2] Whoops - wrong place --- tests/models/musicgen/test_modeling_musicgen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/models/musicgen/test_modeling_musicgen.py b/tests/models/musicgen/test_modeling_musicgen.py index 3a9d1af89db..284450a00af 100644 --- a/tests/models/musicgen/test_modeling_musicgen.py +++ b/tests/models/musicgen/test_modeling_musicgen.py @@ -1144,6 +1144,10 @@ def test_greedy_generate_stereo_outputs(self): self.assertNotIn(config.pad_token_id, output_generate) + @unittest.skip("Fails with - TypeError: _weight_norm_interface() missing 1 required positional argument: 'dim'") + def test_save_load_low_cpu_mem_usage(self): + pass + def get_bip_bip(bip_duration=0.125, duration=0.5, sample_rate=32000): """Produces a series of 'bip bip' sounds at a given frequency.""" @@ -1400,10 +1404,6 @@ def test_generate_text_audio_prompt(self): ) # input values take shape 32000 and we generate from there self.assertTrue(torch.allclose(output_values[0, 0, -16:].cpu(), EXPECTED_VALUES, atol=1e-4)) - @unittest.skip("Fails with - TypeError: _weight_norm_interface() missing 1 required positional argument: 'dim'") - def test_save_load_low_cpu_mem_usage(self): - pass - @require_torch class MusicgenStereoIntegrationTests(unittest.TestCase):