Skip to content

Commit efeec37

Browse files
oelayan7traincheck-team
authored andcommitted
import triton files when triton is supported and installed (#6989)
Those files have code that gets run when importing them, so in systems that doesn't support triton but have triton installed this causes issues. In general, I think it is better to import triton when it is installed and supported. Signed-off-by: Omar Elayan <[email protected]>
1 parent 397b654 commit efeec37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deepspeed/model_implementations/transformers/ds_transformer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from deepspeed.ops.transformer.inference.op_binding.workspace import WorkspaceOp
1515
from deepspeed.accelerator import get_accelerator
1616
import deepspeed
17-
if deepspeed.HAS_TRITON:
17+
if deepspeed.HAS_TRITON and get_accelerator().is_triton_supported():
1818
from deepspeed.ops.transformer.inference.triton.mlp import TritonMLP
1919
from deepspeed.ops.transformer.inference.triton.attention import TritonSelfAttention
2020

0 commit comments

Comments
 (0)