-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
FlaxGPTJ #14396
FlaxGPTJ #14396
Conversation
66b2707
to
740110d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. At some point it will be nice to check the GPU JAX tests, I believe they're timing out right now.
# overwrite from common since `attention_mask` in combination | ||
# with `causal_mask` behaves slighly differently | ||
@is_pt_flax_cross_test | ||
def test_equivalence_pt_to_flax(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this test - could you also add it in test_modeling_gptj.py
so that the test fetcher always correctly checks PT<->Flax (e.g. at the moment if PT GPTJ is changed the test fetcher will not run this test, thus we need an identical test in the PyTorch test suite)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already added in test_modeling_common.py
, so they run for all pt models now
transformers/tests/test_modeling_common.py
Line 1630 in faacd74
def test_equivalence_flax_to_pt(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! So for the Flax files the PT<=>Flax tests need to be overwritten whereas for the PT files the test doesn't have to be overwritten? If this is the case - the PR is good to be merged for me :-)
Looks great - just one small test for PT<>Flax compatibility should be added in |
What does this PR do?
This PR adds the GPTJ model in flax.