Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate: smaller TF serving test #18840

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

gante
Copy link
Member

@gante gante commented Aug 31, 2022

What does this PR do?

tests/test_modeling_tf_common.py::UtilsFunctionsTest::test_generate_tf_function_export is often failing because it times out (>60s).

The previous version took ~35s in my machine. This PR's takes ~19s, which may avoid the time out issue.

If it still fails, a custom config must be added :)

@gante gante requested review from ydshieh and LysandreJik August 31, 2022 20:17
@@ -2180,8 +2180,8 @@ def test_checkpoint_sharding_local(self):
self.assertTrue(np.allclose(p1.numpy(), p2.numpy()))

def test_generate_tf_function_export(self):
test_model = TFAutoModelForSeq2SeqLM.from_pretrained("hf-internal-testing/tiny-random-t5")
max_length = 8
test_model = TFAutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-gpt2")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smaller model (saves ~10s in my machine)

test_model = TFAutoModelForSeq2SeqLM.from_pretrained("hf-internal-testing/tiny-random-t5")
max_length = 8
test_model = TFAutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-gpt2")
max_length = 2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smaller sequences (saves ~6s in my machine)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 31, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @gante!

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @gante for saving the tests :-)

@gante gante merged commit 6e01663 into huggingface:main Sep 1, 2022
@gante gante deleted the tf_generate_serving_test branch September 1, 2022 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants