@@ -198,6 +205,32 @@ if "--deprecated_fused_adam" in sys.argv:
'nvcc':['-O3',
'--use_fast_math']+version_dependent_macros}))
if"--deprecated_fused_lamb"insys.argv:
fromtorch.utils.cpp_extensionimportCUDAExtension
sys.argv.remove("--deprecated_fused_lamb")
fromtorch.utils.cpp_extensionimportBuildExtension
cmdclass['build_ext']=BuildExtension
iftorch.utils.cpp_extension.CUDA_HOMEisNone:
raiseRuntimeError("--deprecated_fused_lamb was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.")
# Check, if ATen/CUDAGenerator.h is found, otherwise use the new ATen/CUDAGeneratorImpl.h, due to breaking change in https://github.com/pytorch/pytorch/pull/36026