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

[XPU] call empty_cache for dynamo tests #126377

Closed
wants to merge 7 commits into from

Conversation

Stonepia
Copy link
Contributor

@Stonepia Stonepia commented May 16, 2024

When running a batch of models, lacking empty_cache() would result in OOM for subsequent models.

This PR unifies the empty_cache call for both CUDA and XPU.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang

Copy link

pytorch-bot bot commented May 16, 2024

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 56a7d2e with merge base d0dfcd2 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@Stonepia Stonepia changed the title [XPU] call empty_cache call for gpu dynamo tests [XPU] call empty_cache for gpu dynamo tests May 16, 2024
@Stonepia Stonepia changed the title [XPU] call empty_cache for gpu dynamo tests [XPU] call empty_cache for dynamo tests May 16, 2024
@Stonepia Stonepia marked this pull request as ready for review May 16, 2024 05:12
@EikanWang EikanWang requested a review from desertfire May 16, 2024 05:14
@Stonepia Stonepia requested a review from EikanWang May 16, 2024 05:26
), "The empty_gpu_cache needs to be called with a non empty device str"
if device == "cuda":
torch.cuda.empty_cache()
if device == "xpu":
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: elif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! Solved in 56a7d2e

@guangyey guangyey added ciflow/trunk Trigger trunk jobs on your pull request release notes: dynamo release notes: benchmark release notes category and removed release notes: dynamo labels May 17, 2024
@Stonepia
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@Stonepia Stonepia deleted the xpu/empty_cache branch May 17, 2024 06:06
facebook-github-bot pushed a commit to pytorch/benchmark that referenced this pull request May 18, 2024
Summary:
When running a batch of models, lacking `empty_cache()` would result in OOM for subsequent models.

This PR unifies the `empty_cache` call for both CUDA and XPU.

X-link: pytorch/pytorch#126377
Approved by: https://github.com/EikanWang, https://github.com/guangyey, https://github.com/desertfire

Reviewed By: huydhn

Differential Revision: D57518757

fbshipit-source-id: a42ae31e7fb81bb05217fd672a3427bd68478a50
ZelboK pushed a commit to ZelboK/pytorch that referenced this pull request May 19, 2024
When running a batch of models, lacking `empty_cache()` would result in OOM for subsequent models.

This PR unifies the `empty_cache` call for both CUDA and XPU.

Pull Request resolved: pytorch#126377
Approved by: https://github.com/EikanWang, https://github.com/guangyey, https://github.com/desertfire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged module: dynamo open source release notes: benchmark release notes category
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants