Skip to content

Commit 6e60f4e

Browse files
committed
Apply code-format changes
1 parent 651b999 commit 6e60f4e

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

python/test/tle/unit/test_tle.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from triton.experimental.tle.language.gpu.semantic import TLESemanticError, TLESemantic
2525
import triton._C.libtriton as libtriton
2626

27+
2728
@triton.jit
2829
def _encoding_frontend_kernel(layout: tl.constexpr):
2930
x = tl.arange(0, 128)
@@ -42,8 +43,10 @@ def _dot_encoding_frontend_kernel(
4243
acc = tle.gpu.set_layout(tl.zeros((32, 8), tl.float32), mma_layout)
4344
result = tl.dot(lhs, rhs, acc=acc, out_dtype=tl.float32) # noqa: F841
4445

46+
4547
_HAS_TLE_EXPLICIT_LAYOUT = hasattr(libtriton.ir.builder, "ensure_ttg_layout_attrs")
4648

49+
4750
def _cuda_backend_available():
4851
from triton.compiler.compiler import get_backend
4952
try:
@@ -52,6 +55,7 @@ def _cuda_backend_available():
5255
except Exception:
5356
return False
5457

58+
5559
class TestLayoutEncoding:
5660
"""Test layout encoding"""
5761

@@ -70,7 +74,7 @@ def test_swizzled_shared_layout_permute(self):
7074
# Original order for 3D rank is [2, 1, 0]
7175
# Permuting with [1, 0, 2] gives: order[1], order[0], order[2] = [1, 2, 0]
7276
assert permuted.order == (1, 2, 0)
73-
77+
7478
@pytest.mark.skipif(not _HAS_TLE_EXPLICIT_LAYOUT, reason="requires __TLE__ build")
7579
@pytest.mark.skipif(not _cuda_backend_available(), reason="requires cuda backend")
7680
def test_explicit_distributed_encoding_frontend(self):
@@ -87,7 +91,7 @@ def test_explicit_distributed_encoding_frontend(self):
8791
assert "tle.gpu.set_layout" in ir
8892
assert "ttg.convert_layout" not in ir
8993
assert "#ttg.slice<{dim = 0, parent = #blocked}>" in ir
90-
94+
9195
@pytest.mark.skipif(not _HAS_TLE_EXPLICIT_LAYOUT, reason="requires __TLE__ build")
9296
@pytest.mark.skipif(not _cuda_backend_available(), reason="requires cuda backend")
9397
def test_explicit_dot_operand_encoding_frontend(self):

python/triton/experimental/tle/language/gpu/core.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ def set_layout(value, layout, _semantic=None):
6464
if not value.type.is_block():
6565
raise ValueError("tle.gpu.set_layout only supports block tensors")
6666
if not hasattr(_semantic.builder, "ensure_ttg_layout_attrs"):
67-
raise RuntimeError(
68-
"tle.gpu.set_layout requires a Triton build with __TLE__ explicit "
69-
"layout support (ir.builder.ensure_ttg_layout_attrs is missing). "
70-
"This backend likely uses its own TLE variant "
71-
"(e.g. __ILUVATAR_TLE__/__MCTLE__) that does not implement this op."
72-
)
67+
raise RuntimeError("tle.gpu.set_layout requires a Triton build with __TLE__ explicit "
68+
"layout support (ir.builder.ensure_ttg_layout_attrs is missing). "
69+
"This backend likely uses its own TLE variant "
70+
"(e.g. __ILUVATAR_TLE__/__MCTLE__) that does not implement this op.")
7371
options = _semantic.builder.options
7472
_semantic.builder.ensure_ttg_layout_attrs(
7573
int(getattr(options, "num_warps")),

0 commit comments

Comments
 (0)