We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8eeb26 commit 961a1e1Copy full SHA for 961a1e1
1 file changed
transformer_engine/pytorch/jit.py
@@ -8,23 +8,14 @@
8
from typing import Callable, Optional, Tuple
9
import torch
10
11
+from transformer_engine import te_device_type
12
from . import torch_version
13
from .export import is_in_onnx_export_mode
14
from .utils import gpu_autocast_ctx
15
16
# pylint: disable=unnecessary-lambda-assignment
17
18
-def te_device_type(default="cuda"):
19
- try:
20
- import transformer_engine as te
21
-
22
- device_type = getattr(te, "TE_DEVICE_TYPE", "cuda")
23
- return device_type
24
- except Exception:
25
- return default
26
27
28
def lazy_compile(func):
29
"""Lazy compile a function with torch.compile
30
0 commit comments