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

Let model precision for XPU device align with CUDA #2587

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jianyizh
Copy link

@jianyizh jianyizh commented Feb 6, 2025

torchbench by default load some models in fp16 if uses gpu. We align such behavior on xpu devices. Also aligned with cuda in nanogpt to use fused adam optimizer

@facebook-github-bot
Copy link
Contributor

Hi @jianyizh!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link
Contributor

@chuanqi129 chuanqi129 left a comment

Choose a reason for hiding this comment

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

Please add some sentences in the description about why we need this change and sign the CLA also

@@ -37,19 +37,19 @@ def check_precision(
if precision == "bypass":
return True
if precision == "fp16":
return model.device == "cuda" and hasattr(model, "enable_fp16")
return model.device == "cuda" or model.device == "xpu" and hasattr(model, "enable_fp16")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return model.device == "cuda" or model.device == "xpu" and hasattr(model, "enable_fp16")
return model.device in ["cuda", "xpu"] and hasattr(model, "enable_fp16")

Copy link
Author

Choose a reason for hiding this comment

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

updated

@chuanqi129
Copy link
Contributor

Hi @xuzhao9, could you please help to review this PR?

@xuzhao9
Copy link
Contributor

xuzhao9 commented Feb 18, 2025

Hi @chuanqi129 , my focus is now moved to Triton and operator level benchmarking at https://github.com/pytorch-labs/tritonbench/tree/main. I can review this PR, but we need to sort out how to proceed other PR reviews with the new Torchbench owner cc @atalman

@jianyizh
Copy link
Author

I don't think the failures in cpu ci are related to this pr.

@chuanqi129
Copy link
Contributor

Hi @chuanqi129 , my focus is now moved to Triton and operator level benchmarking at https://github.com/pytorch-labs/tritonbench/tree/main. I can review this PR, but we need to sort out how to proceed other PR reviews with the new Torchbench owner cc @atalman

Thanks @xuzhao9 for the information and help to review this PR! Hi @atalman could you please help to check the PR check failure and whether we can land this PR?

@jianyizh
Copy link
Author

@atalman Could you please help review this pr

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

Successfully merging this pull request may close these issues.

4 participants