Skip to content

Add default model_kwargs to Generation Tester#482

Merged
regisss merged 1 commit into
huggingface:mainfrom
ankurneog:anneog_fix_beamsearch_tests
Oct 24, 2023
Merged

Add default model_kwargs to Generation Tester#482
regisss merged 1 commit into
huggingface:mainfrom
ankurneog:anneog_fix_beamsearch_tests

Conversation

@ankurneog
Copy link
Copy Markdown
Contributor

@ankurneog ankurneog commented Oct 23, 2023

These are fixes for issues caught while executing the transformers tests. The issues are captured in #445 and
#446

Addressed based on suggestion give here : #470 (comment)

@regisss : please help with the review

TCs impacted ( listed for t5 but these are common TCs impacting all language models)

==============================================================
FAILED test_modeling_t5.py::T5ModelTest::test_beam_search_generate - KeyError: 'limit_hpu_graphs'
FAILED test_modeling_t5.py::T5ModelTest::test_beam_search_generate_dict_output - KeyError: 'limit_hpu_graphs'
FAILED test_modeling_t5.py::T5ModelTest::test_beam_search_generate_dict_outputs_use_cache - KeyError: 'limit_hpu_graphs'
FAILED test_modeling_t5.py::T5ModelTest::test_constrained_beam_search_generate - KeyError: 'limit_hpu_graphs'
FAILED test_modeling_t5.py::T5ModelTest::test_constrained_beam_search_generate_dict_output - KeyError: 'limit_hpu_graphs'
FAILED test_modeling_t5.py::T5ModelTest::test_greedy_generate - KeyError: 'bucket_size'
FAILED test_modeling_t5.py::T5ModelTest::test_greedy_generate_dict_outputs - KeyError: 'bucket_size'
FAILED test_modeling_t5.py::T5ModelTest::test_greedy_generate_dict_outputs_use_cache - KeyError: 'bucket_size'

FAILED test_modeling_t5.py::T5ModelTest::test_sample_generate - KeyError: 'limit_hpu_graphs'
FAILED test_modeling_t5.py::T5ModelTest::test_sample_generate_dict_output - KeyError: 'limit_hpu_graphs'

@regisss
Copy link
Copy Markdown
Collaborator

regisss commented Oct 23, 2023

@ankurneog LGTM but you need to apply the code formater too:

pip install --upgrade black ruff
make style

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@ankurneog
Copy link
Copy Markdown
Contributor Author

@regisss : Thanks,

I had already run the formatter before upload.

(conda_qnpu1) (conda_qnpu1) (anneog_fix_beamsearch_tests) anneog@anneog-vm-u20:optimum-habana $ make style
find . -name "habana_log.livealloc.log_*" -type f -delete
find . -name .lock -type f -delete
find . -name .graph_dumps -type d -delete
find . -name save-hpu.pdb -type f -delete
find . -name checkpoints.json -type f -delete
rm -rf regression/
rm -rf tmp_trainer/
rm -rf test/
rm -rf build/
rm -rf dist/
rm -rf optimum_habana.egg-info/
rm -rf hpu_profile/
black . setup.py
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running pip install "black[jupyter]"
All done! ✨ 🍰 ✨
181 files left unchanged.
ruff . setup.py --fix

@regisss
Copy link
Copy Markdown
Collaborator

regisss commented Oct 24, 2023

@ankurneog Weird. Can you let me know the versions of black and ruff you are running?

@ankurneog
Copy link
Copy Markdown
Contributor Author

@regisss

(conda_qnpu1) (conda_qnpu1) (anneog_fix_beamsearch_tests) anneog@anneog-vm-u20:optimum-habana $ pip list |grep black
black 23.10.0
(conda_qnpu1) (conda_qnpu1) (anneog_fix_beamsearch_tests) anneog@anneog-vm-u20:optimum-habana $ pip list |grep ruff
ruff 0.1.1

Copy link
Copy Markdown
Collaborator

@regisss regisss left a comment

Choose a reason for hiding this comment

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

Those are the same versions as the ones used in the test, very strange... In my environment, I do get a change that I added as a comment below. Let's modify this and then I'll merge!

Comment thread tests/transformers/tests/generation/test_utils.py Outdated
@ankurneog ankurneog force-pushed the anneog_fix_beamsearch_tests branch from 6c6fe6a to 9e2bdf9 Compare October 24, 2023 11:03
@regisss regisss added the run-test Run CI for PRs from external contributors label Oct 24, 2023
Copy link
Copy Markdown
Collaborator

@regisss regisss left a comment

Choose a reason for hiding this comment

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

LGTM

@regisss regisss merged commit 5af1232 into huggingface:main Oct 24, 2023
@regisss
Copy link
Copy Markdown
Collaborator

regisss commented Oct 24, 2023

@ankurneog Can we close #470, #448 and #446?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-test Run CI for PRs from external contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants