Skip to content

Commit 32a96ca

Browse files
committed
Simplify is_torchdynamo_compiling to direct import from torch.compiler
1 parent 16d59c3 commit 32a96ca

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops_training_common.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,7 @@
1212
import torch
1313
from torch import Tensor
1414

15-
try:
16-
try:
17-
from torch.compiler import is_compiling
18-
19-
def is_torchdynamo_compiling() -> bool: # type: ignore[misc]
20-
# at least one test fails if we import is_compiling as a different name
21-
return is_compiling()
22-
23-
except Exception:
24-
# torch.compiler.is_compiling is not available in torch 1.10
25-
from torch._dynamo import is_compiling as is_torchdynamo_compiling
26-
except Exception:
27-
28-
def is_torchdynamo_compiling() -> bool: # type: ignore[misc]
29-
return False
15+
from torch.compiler import is_compiling as is_torchdynamo_compiling
3016

3117

3218
# @manual=//deeplearning/fbgemm/fbgemm_gpu/codegen:split_embedding_codegen_lookup_invokers

0 commit comments

Comments
 (0)