Followup fix for Custom AR V2 in non NVL scenarios (#24742)
Co-authored-by: b8zhong <b8zhong@users.noreply.github.com>
This commit is contained in:
@@ -93,12 +93,14 @@ class CustomAllReduceV2:
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def capture(self):
|
def capture(self):
|
||||||
|
if self.disabled:
|
||||||
|
yield
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
self.obj.set_cuda_graph_capture(True)
|
self.obj.set_cuda_graph_capture(True)
|
||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
self.obj.set_cuda_graph_capture(False)
|
self.obj.set_cuda_graph_capture(False)
|
||||||
if not self.disabled:
|
|
||||||
# cannot call when graph is capturing
|
# cannot call when graph is capturing
|
||||||
assert (
|
assert (
|
||||||
torch.cuda.is_current_stream_capturing() == False
|
torch.cuda.is_current_stream_capturing() == False
|
||||||
|
|||||||
Reference in New Issue
Block a user