Skip to content

[Tensorexpr] Fix and improve handling multiple gpu devices#38365

Closed
protonu wants to merge 3 commits intopytorch:masterfrom
protonu:fixmultigpu
Closed

[Tensorexpr] Fix and improve handling multiple gpu devices#38365
protonu wants to merge 3 commits intopytorch:masterfrom
protonu:fixmultigpu

Conversation

@protonu
Copy link
Copy Markdown

@protonu protonu commented May 12, 2020

These commits fixes a bug which was exposed when we took away the fallback path. The fix is to set the appropriate device before setting CUDA stream.
The improvement is when compiling, setting the device to new device only if it's different from prior device, and removing redundant call to cudaFree

@protonu protonu requested review from ZolotukhinM and zheng-xq May 12, 2020 23:00
@protonu protonu requested a review from apaszke as a code owner May 12, 2020 23:00
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label May 12, 2020
@protonu protonu requested a review from Krovatkin May 12, 2020 23:01
@protonu protonu changed the title Fix and improve handling multiple gpu devices [Tensorexpr] Fix and improve handling multiple gpu devices May 12, 2020
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@protonu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

ptr_to_args[buffer_args.size() + 1] = &rand_offset;
}

const auto prior_device = at::cuda::current_device();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch!

Since you are now using this->device(), it might be a good idea to check that device() can only be kCuda somewhere in "initialize()".

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 13, 2020

💊 CI failures summary and remediations

As of commit c47e560 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker.

See how this bot performed.

This comment has been revised 1 time.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@protonu merged this pull request in d1eeb3b.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…8365)

Summary:
These commits fixes a bug which was exposed when we took away the fallback path. The fix is to set the appropriate device before setting CUDA stream.
The improvement is when compiling, setting the device to new device only if it's different from prior device, and removing redundant call to cudaFree
Pull Request resolved: pytorch#38365

Reviewed By: zheng-xq

Differential Revision: D21537469

Pulled By: protonu

fbshipit-source-id: b9662dd623b5c7cfd23eb6894e992a43665641e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants