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

initial commit #1953

Merged
merged 6 commits into from
Dec 3, 2024
Merged

initial commit #1953

merged 6 commits into from
Dec 3, 2024

Conversation

songhappy
Copy link
Contributor

@songhappy songhappy commented Nov 5, 2024

Context

What is the purpose of this PR? Is it to

  • fix a bug

Please link to any issues this PR addresses.
https://jira.devtools.intel.com/browse/IPB-2799

Changelog

What are the changes made in this PR?
*
Add xpu_support in verify_bf16_support, the only change needed is to verify if both torch.xpu.is_available() and torch.xpu.is_bf16_supported() are true.

Test plan

Please make sure to do each of the following if applicable to your PR. If you're unsure about any one of these just ask and we will happily help. We also have a contributing page for some guidance on contributing.

  • manually run any new or modified recipes with sufficient proof of correctness

UX

If your function changed a public API, please add a dummy example of what the user experience will look like when calling it.
Here is a docstring example
and a tutorial example

  • I did not change any public API

Copy link

pytorch-bot bot commented Nov 5, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1953

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit c6fafc7 with merge base b5d2e63 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link

Hi @songhappy!

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 [email protected]. Thanks!

@songhappy songhappy marked this pull request as draft November 6, 2024 01:25
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 6, 2024
@songhappy songhappy marked this pull request as ready for review November 6, 2024 01:31
@songhappy songhappy marked this pull request as draft November 6, 2024 01:31
@ebsmothers
Copy link
Contributor

Hi @songhappy thanks for the PR. Is the purpose here to enable training on XPU in torchtune? If so, can you share more context in the summary (e.g. is the bf16 support check the only change that needs to be made)?

@songhappy songhappy marked this pull request as ready for review November 27, 2024 03:50
@songhappy
Copy link
Contributor Author

@ebsmothers thank you very much for reviewing, I just rebased with new main branch, addressed in the summary that the only change needed is to verify bf16 support, it is very minor change.

@SalmanMohammadi
Copy link
Collaborator

Hey @songhappy. Thanks for this PR. Could you please try run a recipe with xpu and bf16 and attach some outputs to this PR to make sure everything works okay?

@songhappy
Copy link
Contributor Author

Hey @songhappy. Thanks for this PR. Could you please try run a recipe with xpu and bf16 and attach some outputs to this PR to make sure everything works okay?

Here is the command:
tune run full_finetune_single_device --config recipes/configs/llama3_2/3B_full_single_device_my.yaml
output looks like:

  0%|                                                                           | 0/13000 [00:00<?, ?it/s]
1|1|Loss: 2.958725690841675:   0%|                                    | 1/13000 [00:02<8:27:35,  2.34s/it]
1|2|Loss: 1.4943794012069702:   0%|                                   | 2/13000 [00:03<6:36:57,  1.83s/it]

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 64.26%. Comparing base (5bc03a9) to head (4eb7fe5).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
torchtune/utils/_device.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1953      +/-   ##
==========================================
- Coverage   68.22%   64.26%   -3.97%     
==========================================
  Files         323      326       +3     
  Lines       17962    18470     +508     
==========================================
- Hits        12255    11870     -385     
- Misses       5707     6600     +893     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SalmanMohammadi
Copy link
Collaborator

@songhappy could you please run our pre-commit hooks to lint your code? There's instructions here https://github.com/pytorch/torchtune/blob/main/CONTRIBUTING.md#coding-style

@songhappy
Copy link
Contributor Author

@songhappy could you please run our pre-commit hooks to lint your code? There's instructions here https://github.com/pytorch/torchtune/blob/main/CONTRIBUTING.md#coding-style

many thanks, I have addressed all the comments, all ready to merger, please approve :)

Copy link
Collaborator

@SalmanMohammadi SalmanMohammadi left a comment

Choose a reason for hiding this comment

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

One last thing and we're good to go. Stamping to unblock - thanks so much for adding this!

@SalmanMohammadi SalmanMohammadi merged commit efa91bf into pytorch:main Dec 3, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants