Skip to content

Commit 9bb266d

Browse files
authored
Fix flaky PocketTTSAudioTokenizerModelTest::test_batching_equivalence on CPU (#50402)
On CPU (fp32), a few `audio_values` elements differ by up to ~2.3e-5 between batched and single-row runs, just above the default `atol=1e-5`. Override the test with `atol=rtol=1e-4`, following the same pattern as #35971. Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
1 parent 2aab563 commit 9bb266d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎tests/models/pocket_tts_audio_tokenizer/test_modeling_pocket_tts_audio_tokenizer.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ def test_model_forward(self):
139139
config_and_inputs = self.model_tester.prepare_config_and_inputs()
140140
self.model_tester.create_and_check_model_forward(*config_and_inputs)
141141

142+
# On CPU (fp32), a few `audio_values` elements differ by up to ~2.3e-5 between batched and single-row runs, which
143+
# makes the default `atol=1e-5` flaky.
144+
def test_batching_equivalence(self, atol=1e-4, rtol=1e-4):
145+
super().test_batching_equivalence(atol=atol, rtol=rtol)
146+
142147
@unittest.skip(reason="The audio tokenizer has no token embeddings.")
143148
def test_model_get_set_embeddings(self):
144149
pass

0 commit comments

Comments
 (0)