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

make tests of pytorch_example device agnostic #27081

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

ji-huazhong
Copy link
Contributor

@ji-huazhong ji-huazhong commented Oct 26, 2023

What does this PR do?

Part of #25654

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

cc @ydshieh @fxmarty @zhangsibo1129 @arsalanu

@ji-huazhong ji-huazhong marked this pull request as draft October 26, 2023 11:03
@ji-huazhong ji-huazhong marked this pull request as ready for review October 26, 2023 11:04
@ji-huazhong ji-huazhong force-pushed the device-agnostic-test branch 2 times, most recently from ec11770 to 089e3d5 Compare October 27, 2023 00:48
@ydshieh ydshieh self-requested a review October 27, 2023 07:31
Comment on lines -96 to 97
if is_cuda_and_apex_available():
if is_torch_fp16_available_on_device(torch_device):
testargs.append("--fp16")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know the reason why we test with fp16 only if apex is available. The change here will means we will test it as long as CI is running on GPU. Not sure if this is what we expect.

@muellerzr Do you happen to know the story here (about the apex part)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it was a bad copy/paste, because I wouldn't have had that in there on purpose.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK thank you for the feedback ❤️

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 @statelesshz for this work!

@HuggingFaceDocBuilderDev

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

@ydshieh
Copy link
Collaborator

ydshieh commented Oct 27, 2023

@amyeroberts This is a continuation of (the merged) #25870. There might be more such PRs in the future.

@ydshieh ydshieh requested a review from ArthurZucker October 27, 2023 14:28
Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for adding this and improving our test suite!

@amyeroberts amyeroberts merged commit cd19b19 into huggingface:main Oct 30, 2023
@ji-huazhong ji-huazhong deleted the device-agnostic-test branch October 31, 2023 01:39
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
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.

6 participants