Skip to content

Commit 27eeda7

Browse files
committed
Enable triton kernels matmul tests
Signed-off-by: Witold Dziurdz <witold.dziurdz@intel.com>
1 parent e57e5ed commit 27eeda7

File tree

9 files changed

+558
-110
lines changed

9 files changed

+558
-110
lines changed

output.txt

Lines changed: 503 additions & 0 deletions
Large diffs are not rendered by default.

python/triton_kernels/tests/test_matmul.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,12 @@ def _pad_and_block(x: torch.Tensor) -> torch.Tensor:
577577
assert tri_y.stride() == y_tri_in.stride()
578578
# If split_k > 1, then the intermediate tensor is fp32.
579579
sep_gather = mode == "ragged" and do_gather and n_expts_act > 1 and split_k == 1
580-
sep_scatter = mode == "ragged" and do_scatter and n_expts_act > 1 and split_k == 1
581-
y_scale = flex.out_data.expected_scale if act_is_float8 else 1
580+
sep_scatter = mode == "ragged" and do_scatter and n_expts_act > 1 and split_k == 1 \
581+
or (do_scatter and not fused_scatter and n_expts_tot > 1 and split_k == 1 and act_dtype_str == "float8_e4m3fn")
582+
y_scale = flex.out_data.expected_scale if act_is_float8 else 1.0
582583

583584
def round_x(x, idx):
584585
return x.to(act_dtype).to(torch.float32) if sep_gather else x
585-
586586
round_y = lambda y: (y / y_scale).to(act_dtype).to(torch.float32) * y_scale if sep_scatter else y
587587
ref_y = matmul_ogs_torch(x_ref, w_ref, bias_ref, #
588588
rdata, gindx, sindx, round_x=round_x, round_y=round_y, gammas=gs1_ref,

python/triton_kernels/triton_kernels/matmul_ogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def matmul_ogs(x, w, bias,
598598
out_matmul_scale = out_matmul_scale.data.view(torch.uint8)
599599
if has_scratchpad and "mx_out_scale" in memory["scratchpad"]:
600600
out_matmul_scale = memory["scratchpad"]["mx_out_scale"]
601-
out_matmul_has_mx = out_matmul_scale is not None and out_matmul.element_size() == 1
601+
out_matmul_has_mx = out_matmul_scale is not None and bitwidth(out_dtype) == 8
602602
# matrix multiplication
603603
flex = precision_config.flex_ctx
604604
bias_stride = None if bias is None else bias.stride(0)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
tests/test_matmul.py::test_op
21
tests/test_matmul.py::test_fused_act
32
tests/test_matmul.py::test_zero_reduction_dim
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
tests/test_matmul.py::test_op
21
tests/test_matmul.py::test_fused_act
32
tests/test_matmul.py::test_zero_reduction_dim
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
tests/test_matmul.py::test_op
21
tests/test_matmul.py::test_fused_act
32
tests/test_matmul.py::test_zero_reduction_dim
Lines changed: 17 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,17 @@
1-
# https://github.com/intel/intel-xpu-backend-for-triton/issues/5074
2-
tests/test_matmul.py::test_op[False-False-False-False-False-None-128-1000-700-700-ragged-float16-float16-8-2-1-False-None-False-False-False-True]
3-
tests/test_matmul.py::test_op[False-False-False-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
4-
tests/test_matmul.py::test_op[False-False-False-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
5-
tests/test_matmul.py::test_op[False-False-False-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
6-
tests/test_matmul.py::test_op[False-False-False-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
7-
tests/test_matmul.py::test_op[False-False-False-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
8-
tests/test_matmul.py::test_op[False-False-False-True-False-None-128-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
9-
tests/test_matmul.py::test_op[False-False-False-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
10-
tests/test_matmul.py::test_op[False-False-False-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
11-
tests/test_matmul.py::test_op[False-False-False-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
12-
tests/test_matmul.py::test_op[False-False-False-True-False-None-16-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
13-
tests/test_matmul.py::test_op[False-False-False-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
14-
tests/test_matmul.py::test_op[False-False-False-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
15-
tests/test_matmul.py::test_op[False-False-True-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
16-
tests/test_matmul.py::test_op[False-False-True-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
17-
tests/test_matmul.py::test_op[False-False-True-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
18-
tests/test_matmul.py::test_op[False-False-True-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
19-
tests/test_matmul.py::test_op[False-False-True-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
20-
tests/test_matmul.py::test_op[False-False-True-True-False-None-128-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
21-
tests/test_matmul.py::test_op[False-False-True-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
22-
tests/test_matmul.py::test_op[False-False-True-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
23-
tests/test_matmul.py::test_op[False-False-True-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
24-
tests/test_matmul.py::test_op[False-False-True-True-False-None-16-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
25-
tests/test_matmul.py::test_op[False-False-True-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
26-
tests/test_matmul.py::test_op[False-False-True-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
27-
tests/test_matmul.py::test_op[False-True-False-False-False-None-128-1000-700-700-ragged-float16-float16-8-2-9-False-None-False-False-False-True]
28-
tests/test_matmul.py::test_op[False-True-False-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
29-
tests/test_matmul.py::test_op[False-True-False-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
30-
tests/test_matmul.py::test_op[False-True-False-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
31-
tests/test_matmul.py::test_op[False-True-False-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
32-
tests/test_matmul.py::test_op[False-True-False-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
33-
tests/test_matmul.py::test_op[False-True-False-True-False-None-128-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
34-
tests/test_matmul.py::test_op[False-True-False-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
35-
tests/test_matmul.py::test_op[False-True-False-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
36-
tests/test_matmul.py::test_op[False-True-False-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
37-
tests/test_matmul.py::test_op[False-True-False-True-False-None-16-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
38-
tests/test_matmul.py::test_op[False-True-False-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
39-
tests/test_matmul.py::test_op[False-True-False-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
40-
tests/test_matmul.py::test_op[False-True-True-False-False-None-128-1000-700-700-ragged-float16-float16-8-2-9-False-None-False-False-False-True]
41-
tests/test_matmul.py::test_op[False-True-True-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
42-
tests/test_matmul.py::test_op[False-True-True-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
43-
tests/test_matmul.py::test_op[False-True-True-False-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
44-
tests/test_matmul.py::test_op[False-True-True-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
45-
tests/test_matmul.py::test_op[False-True-True-False-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
46-
tests/test_matmul.py::test_op[False-True-True-True-False-None-128-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
47-
tests/test_matmul.py::test_op[False-True-True-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-False]
48-
tests/test_matmul.py::test_op[False-True-True-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
49-
tests/test_matmul.py::test_op[False-True-True-True-False-None-128-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
50-
tests/test_matmul.py::test_op[False-True-True-True-False-None-16-1000-400-400-ragged-float8_e4m3fn-float8_e4m3fn-3-1-1-False-None-False-False-False-True]
51-
tests/test_matmul.py::test_op[False-True-True-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-False-None-False-False-False-True]
52-
tests/test_matmul.py::test_op[False-True-True-True-False-None-16-1000-704-800-ragged-mxfloat8_e4m3fn-mxfloat4_e2m1-8-2-9-True-None-False-False-False-True]
1+
#hang
2+
tests/test_matmul.py::test_op[False-False-False-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
3+
tests/test_matmul.py::test_op[False-False-False-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
4+
tests/test_matmul.py::test_op[False-False-False-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
5+
tests/test_matmul.py::test_op[False-False-False-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
6+
tests/test_matmul.py::test_op[False-False-True-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
7+
tests/test_matmul.py::test_op[False-False-True-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
8+
tests/test_matmul.py::test_op[False-False-True-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
9+
tests/test_matmul.py::test_op[False-False-True-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
10+
tests/test_matmul.py::test_op[False-True-False-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
11+
tests/test_matmul.py::test_op[False-True-False-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
12+
tests/test_matmul.py::test_op[False-True-False-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
13+
tests/test_matmul.py::test_op[False-True-False-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
14+
tests/test_matmul.py::test_op[False-True-True-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
15+
tests/test_matmul.py::test_op[False-True-True-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
16+
tests/test_matmul.py::test_op[False-True-True-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
17+
tests/test_matmul.py::test_op[False-True-True-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
# https://github.com/intel/intel-xpu-backend-for-triton/issues/5074
2-
tests/test_matmul.py::test_op
1+
#hang
2+
tests/test_matmul.py::test_op[False-False-False-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
3+
tests/test_matmul.py::test_op[False-False-False-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
4+
tests/test_matmul.py::test_op[False-False-False-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
5+
tests/test_matmul.py::test_op[False-False-False-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
6+
tests/test_matmul.py::test_op[False-False-True-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
7+
tests/test_matmul.py::test_op[False-False-True-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
8+
tests/test_matmul.py::test_op[False-False-True-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
9+
tests/test_matmul.py::test_op[False-False-True-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
10+
tests/test_matmul.py::test_op[False-True-False-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
11+
tests/test_matmul.py::test_op[False-True-False-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
12+
tests/test_matmul.py::test_op[False-True-False-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
13+
tests/test_matmul.py::test_op[False-True-False-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
14+
tests/test_matmul.py::test_op[False-True-True-False-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
15+
tests/test_matmul.py::test_op[False-True-True-False-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
16+
tests/test_matmul.py::test_op[False-True-True-True-False-None-128-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]
17+
tests/test_matmul.py::test_op[False-True-True-True-False-None-16-16-16-1000-batched-float16-float16-5-1-None-False-None-False-False-False]

0 commit comments

Comments
 (0)