Skip to content

Commit 97a8a89

Browse files
authored
Add hasPrimaryContext() commits (#894)
* Cherrypicked the changes from pytorch#71146
1 parent 6003aca commit 97a8a89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/csrc/autograd/engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ void GraphTask::stash_current_streams() {
12631263
caller_current_streams_.resize(num_gpus);
12641264
if (num_gpus > 0) {
12651265
for (c10::DeviceIndex idx = 0; idx < num_gpus; idx++) {
1266-
#if defined(USE_ROCM)
1266+
#if defined(USE_ROCM) && (ROCM_VERSION < 50000)
12671267
// If the build targets ROCM, stash streams for all visible devices unconditionally, to work around
12681268
// https://github.com/pytorch/pytorch/issues/59750.
12691269
// TODO: Remove ROCM-specific behavior when https://github.com/pytorch/pytorch/issues/59750 is fixed.

0 commit comments

Comments
 (0)