Skip to content

Commit a19a23b

Browse files
authored
Don't use PyTorch for getting active backend in make_tensor_descriptor (#4839)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 9aefe92 commit a19a23b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python/triton/language/semantic.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from .._C.libtriton import ir
1010
from . import core as tl
1111

12-
import triton
13-
1412
T = TypeVar('T')
1513
TensorTy = TypeVar('TensorTy')
1614

@@ -1921,8 +1919,8 @@ def make_tensor_descriptor(
19211919
)
19221920

19231921
last_stride = tl._unwrap_if_constexpr(strides[-1])
1924-
backend = triton.runtime.driver.active.get_current_target().backend
1925-
if backend != "xpu" and last_stride != 1:
1922+
backend = self.builder.options.backend_name
1923+
if backend != "intel" and last_stride != 1:
19261924
raise ValueError(f"Tensor descriptor last dim must be 1 but got {last_stride}")
19271925

19281926
shape = [self.make_scalar(x, tl.int32) for x in shape]

0 commit comments

Comments
 (0)