[pt2] Turn off lazy reinit when cuda graph is on (#101848)

Summary: cuda graph doesn't work with cuda 11's cupti lazy reinit. So we'll turn it off if any modules turn on cudagraph

Test Plan: test with cuda graph on

Reviewed By: aaronenyeshi

Differential Revision: D45967197

Pull Request resolved: https://github.com/pytorch/pytorch/pull/101848
Approved by: https://github.com/aaronenyeshi
This commit is contained in:
Xiaodong Wang 2023-05-19 21:50:33 +00:00 committed by PyTorch MergeBot
parent fa7ad77ac9
commit c8fd1cfad1

View File

@ -1496,6 +1496,10 @@ class _TorchCompileInductorWrapper:
options or () options or ()
), "triton.cudagraphs does not support dynamic shapes. Please set dynamic=False or triton.cudagraphs=False" ), "triton.cudagraphs does not support dynamic shapes. Please set dynamic=False or triton.cudagraphs=False"
# FIXME: CUPTI Lazy Re-init and CUDA Graph crashes with CUDA 11.
if self.config.get("triton.cudagraphs", False):
os.environ["DISABLE_CUPTI_LAZY_REINIT"] = "1"
def __eq__(self, other): def __eq__(self, other):
return (isinstance(other, _TorchCompileInductorWrapper) and return (isinstance(other, _TorchCompileInductorWrapper) and
self.config == other.config and self.config == other.config and