Skip to content

Commit

Permalink
WaveCache.module_op already returns the MLIR module str
Browse files Browse the repository at this point in the history
---------

Signed-off-by: tyb0807 <[email protected]>
  • Loading branch information
tyb0807 committed Feb 13, 2025
1 parent 4ef04d7 commit 97c3f6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/kernel/wave/attention/evoformer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def testEvoformerAttentionForward(
if dump_generated_mlir:
filename = f"wave_evoformer_{'x'.join(map(str, shape))}.mlir"
with open(filename, "w") as f:
f.write(mb.module_op.get_asm())
f.write(mb.module_op)

eps = 1e-2 if output.dtype == torch.float16 else 5e-2
assert (
Expand Down
12 changes: 6 additions & 6 deletions tests/kernel/wave/wave_gemm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def repeat(acc: tkl.Register[M, N, tkl.f32]) -> tkl.Register[M, N, tkl.f32]:
if test_dump_generated_mlir:
filename = f"wave_gemm_{'x'.join(map(str, shape))}.mlir"
with open(filename, "w") as f:
f.write(mb.module_op.get_asm())
f.write(mb.module_op)

if run_bench:
if dump_perf is not None:
Expand Down Expand Up @@ -352,7 +352,7 @@ def repeat(acc: tkl.Register[M, N, tkl.f32]) -> tkl.Register[M, N, tkl.f32]:
if test_dump_generated_mlir:
filename = f"wave_gemm_{'x'.join(map(str, shape))}.mlir"
with open(filename, "w") as f:
f.write(mb.module_op.get_asm())
f.write(mb.module_op)

if run_bench:
if dump_perf is not None:
Expand Down Expand Up @@ -501,7 +501,7 @@ def repeat(acc: tkl.Register[M, N, tkl.i32]) -> tkl.Register[M, N, tkl.i32]:
if test_dump_generated_mlir:
filename = f"wave_gemm_{'x'.join(map(str, shape))}.mlir"
with open(filename, "w") as f:
f.write(mb.module_op.get_asm())
f.write(mb.module_op)

if run_bench:
if dump_perf is not None:
Expand Down Expand Up @@ -618,7 +618,7 @@ def repeat(acc: tkl.Register[M, N, tkl.i32]) -> tkl.Register[M, N, tkl.i32]:
if test_dump_generated_mlir:
filename = f"wave_gemm_{'x'.join(map(str, shape))}_f8.mlir"
with open(filename, "w") as f:
f.write(mb.module_op.get_asm())
f.write(mb.module_op)

if run_bench:
if dump_perf is not None:
Expand Down Expand Up @@ -733,7 +733,7 @@ def repeat(acc: tkl.Register[M, N, tkl.f32]) -> tkl.Register[M, N, tkl.f32]:
if test_dump_generated_mlir:
filename = f"wave_gemm_{'x'.join(map(str, shape))}_f8.mlir"
with open(filename, "w") as f:
f.write(mb.module_op.get_asm())
f.write(mb.module_op)

if run_bench:
if dump_perf is not None:
Expand Down Expand Up @@ -841,7 +841,7 @@ def repeat(
if test_dump_generated_mlir:
filename = f"wave_batched_gemm_{'x'.join(map(str, shape))}.mlir"
with open(filename, "w") as f:
f.write(mb.module_op.get_asm())
f.write(mb.module_op)

if run_bench:
if dump_perf is not None:
Expand Down

0 comments on commit 97c3f6b

Please sign in to comment.