Skip to content

Commit ccc8ff8

Browse files
etiottoanmyachevwhitneywhtsang
authored
Remove MLIR_ENABLE_REMARK (#3990)
Fixes issue #3987 --------- Signed-off-by: Tiotto, Ettore <[email protected]> Co-authored-by: Anatoly Myachev <[email protected]> Co-authored-by: Whitney Tsang <[email protected]>
1 parent bd88137 commit ccc8ff8

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

python/test/unit/test_perf_warning.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import torch
66
import triton
77
import triton.language as tl
8-
from triton._internal_testing import is_cuda
8+
from triton._internal_testing import is_cuda, is_xpu
99

1010

1111
@contextmanager
@@ -18,6 +18,8 @@ def enable_diagnostics_context(value):
1818

1919

2020
def test_mma_remark(capfd, fresh_triton_cache):
21+
if is_xpu():
22+
pytest.xfail("Not designed for XPU")
2123
if is_cuda():
2224
capability = torch.cuda.get_device_capability()
2325
if capability[0] != 9:
@@ -104,6 +106,8 @@ def matmul_kernel(
104106

105107

106108
def test_remark_vectorization(capfd, fresh_triton_cache):
109+
if is_xpu():
110+
pytest.xfail("Not designed for XPU")
107111

108112
@triton.jit
109113
def ldst_vec(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0, XBLOCK: tl.constexpr):
@@ -164,7 +168,7 @@ def ldst_vec(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0, XBLOCK: tl.constexpr)
164168
assert "note: diagnostic emitted with trace:" in err
165169

166170

167-
def test_remark_swp_op_before_operands(capfd, fresh_triton_cache):
171+
def test_remark_swp_op_before_operands(capfd, fresh_triton_cache, device):
168172

169173
@triton.jit
170174
def kernel_pipe_error(in_ptr, out_ptr):
@@ -180,6 +184,6 @@ def kernel_pipe_error(in_ptr, out_ptr):
180184
if tl.max(val) > 0:
181185
k += 1
182186

183-
i = torch.empty(64 * 64, dtype=torch.float32).cuda()
184-
o = torch.empty(64 * 64, dtype=torch.float32).cuda()
187+
i = torch.empty(64 * 64, dtype=torch.float32, device=device)
188+
o = torch.empty(64 * 64, dtype=torch.float32, device=device)
185189
kernel_pipe_error[(1, )](i, o)

scripts/test-triton.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ run_core_tests() {
214214
run_pytest_command -k "not test_within_2gb" --verbose --device xpu runtime/ --ignore=runtime/test_cublas.py
215215

216216
TRITON_TEST_SUITE=debug \
217-
run_pytest_command --verbose -n ${PYTEST_MAX_PROCESSES:-8} test_debug.py --forked --device xpu
217+
run_pytest_command --verbose -n ${PYTEST_MAX_PROCESSES:-8} test_debug.py test_debug_dump.py --forked --device xpu
218+
219+
TRITON_TEST_SUITE=warnings \
220+
run_pytest_command --verbose -n ${PYTEST_MAX_PROCESSES:-8} test_perf_warning.py --device xpu
218221

219222
# run test_line_info.py separately with TRITON_DISABLE_LINE_INFO=0
220223
TRITON_DISABLE_LINE_INFO=0 TRITON_TEST_SUITE=line_info \

third_party/intel/backend/compiler.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,6 @@ def make_ttgir(mod, metadata, opt, properties):
253253
cluster_info.clusterDimX = opt.cluster_dims[0]
254254
cluster_info.clusterDimY = opt.cluster_dims[1]
255255
cluster_info.clusterDimZ = opt.cluster_dims[2]
256-
# Set up Diagnostic
257-
if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1":
258-
srcMgr = llvm.source_mgr()
259-
ir.source_mgr_diag(srcMgr, mod.context)
260-
mod.context.printOpOnDiagnostic(True)
261256

262257
# Annotate module with information required by subsequent transformations.
263258
pm = ir.pass_manager(mod.context)
@@ -330,15 +325,12 @@ def make_llir(src, metadata, options):
330325
metadata["num_warps"] *= num_warp_groups
331326
threads_per_warp = intel.get_threads_per_warp(src)
332327
metadata["threads_per_warp"] = threads_per_warp
328+
333329
mod = src
334330
# TritonGPU -> LLVM-IR (MLIR)
335331
pm = ir.pass_manager(mod.context)
336332
pm.enable_debug()
337-
# Set up Diagnostic
338-
if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1":
339-
srcMgr = llvm.source_mgr()
340-
ir.source_mgr_diag(srcMgr, mod.context)
341-
mod.context.printOpOnDiagnostic(True)
333+
342334
passes.convert.add_scf_to_cf(pm)
343335
passes.convert.add_index_to_llvmir(pm)
344336
# FIXME: Advanced path uses custom type conversion and needs hacky

0 commit comments

Comments
 (0)