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

remvoe _create_and_check_torch_fx_tracing in specific test files #18667

Merged

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Aug 17, 2022

What does this PR do?

Remvoe _create_and_check_torch_fx_tracing in specific model test files, as the common one can handle them correctly.
The only exception is Hubert model, but we can also remove it, and set fx_compatible to False (just as for Wav2Vec2).

It might be better to add torch_script_compatible to handle Hubert and related models.

Motivation: Make the change in #18547 available to all tests.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 17, 2022

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

@ydshieh ydshieh changed the title remvoe _create_and_check_torch_fx_tracing remvoe _create_and_check_torch_fx_tracing in specific test files Aug 17, 2022
@ydshieh ydshieh changed the title remvoe _create_and_check_torch_fx_tracing in specific test files remvoe _create_and_check_torch_fx_tracing in specific test files Aug 17, 2022
@ydshieh ydshieh marked this pull request as ready for review August 17, 2022 15:08
@michaelbenayoun
Copy link
Member

The common case test for TorchScript, and if I recall correctly there was an issue for those models on that aspect?

You suggest to add a flag called torch_script_compatible? If so, that is what I suggested back then, pinging @sgugger here.

Also, I think that some of those models can actually be torchscripted with torch 1.12, but the issue was that we are (were?) testing in torch 1.11.

@ydshieh
Copy link
Collaborator Author

ydshieh commented Aug 22, 2022

The common case test for TorchScript, and if I recall correctly there was an issue for those models on that aspect?

There might be before. But as far as I can tell, the issue probably came from the input and label names preparation. As the tests pass after I remove their re-definitions from the specific model test files, I think it's fine and better to clean them up. (The only failure is from Hubert).

You suggest to add a flag called torch_script_compatible?

This is to allow torch trace test still run while skip the torch script test, as currently Hubert test will fail on torchscript.
But I would prefer to add this flag (if the idea is approved) in a separate PR (and where we can enable the test for Wav2Vec2 too, for example)

Also, I think that some of those models can actually be torchscripted with torch 1.12, but the issue was that we are (were?) testing in torch 1.11.

We can re-evaluate this, but again, let's not to do changes regarding this part in this PR.

This PR is merely to avoid overwriting _create_and_check_torch_fx_tracing unnecessary :-)

@ydshieh ydshieh force-pushed the clean_up_create_and_check_torch_fx_tracing branch from f9852e1 to 72a0d60 Compare August 22, 2022 14:19
@ydshieh ydshieh force-pushed the clean_up_create_and_check_torch_fx_tracing branch from 72a0d60 to 32437fd Compare August 31, 2022 12:58
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning this up. Re-new flag, I am still opposed for the same reasons as in the comment linked above. Everything should be controlled by one fx_compatible flag, we don't want multiple ones :-)

@ydshieh
Copy link
Collaborator Author

ydshieh commented Sep 1, 2022

@michaelbenayoun If this PR is OK on your side, I am going to merge. Regarding the flag, let's see what we can do in a separate PR.

@ydshieh ydshieh force-pushed the clean_up_create_and_check_torch_fx_tracing branch from 32437fd to e1186a8 Compare September 7, 2022 12:27
@ydshieh ydshieh merged commit 10c774c into huggingface:main Sep 7, 2022
@ydshieh ydshieh deleted the clean_up_create_and_check_torch_fx_tracing branch September 7, 2022 14:22
oneraghavan pushed a commit to oneraghavan/transformers that referenced this pull request Sep 26, 2022
…uggingface#18667)

* remvoe _create_and_check_torch_fx_tracing defined in specific model test files

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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