Deprecate torch._utils.is_compiling() and torch._dynamo.external_utils.is_compiling() (#127690)

This PR is split from PR #126898.

- #126898

------

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127690
Approved by: https://github.com/Skylion007, https://github.com/malfet
This commit is contained in:
Xuehai Pan
2024-11-05 15:29:47 +08:00
committed by PyTorch MergeBot
parent ffb7a08921
commit e84d1121ad
31 changed files with 84 additions and 80 deletions

View File

@ -75,7 +75,7 @@ def _compress_hook(
decompressed_tensor.copy_(value)
return decompressed_tensor
if torch._utils.is_compiling():
if torch.compiler.is_compiling():
grad = dist._functional_collectives.all_reduce(
compressed_tensor, "sum", group_to_use
)