Skip to content

Commit 2fe0c70

Browse files
committed
[MLIR][test] Fixup for checking for ml_dtypes
In order to optionally run some checks that depend on the `ml_dtypes` python module we have to remove the `CHECK` lines for those tests or they will be required and missed in the test output. I've changed to use asserts as recommended in [1]. [1]: #123061 (comment)
1 parent 12ba74e commit 2fe0c70

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

mlir/test/python/execution_engine.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ def testComplexUnrankedMemrefAdd():
536536

537537

538538
# Test bf16 memrefs
539-
# CHECK-LABEL: TEST: testBF16Memref
540539
def testBF16Memref():
541540
with Context():
542541
module = Module.parse(
@@ -566,17 +565,16 @@ def testBF16Memref():
566565
execution_engine.invoke("main", arg1_memref_ptr, arg2_memref_ptr)
567566

568567
# test to-numpy utility
569-
# CHECK: [0.5]
570-
npout = ranked_memref_to_numpy(arg2_memref_ptr[0])
571-
log(npout)
568+
x = ranked_memref_to_numpy(arg2_memref_ptr[0])
569+
assert len(x) == 1
570+
assert x[0] == 0.5
572571

573572

574573
if HAS_ML_DTYPES:
575574
run(testBF16Memref)
576575

577576

578577
# Test f8E5M2 memrefs
579-
# CHECK-LABEL: TEST: testF8E5M2Memref
580578
def testF8E5M2Memref():
581579
with Context():
582580
module = Module.parse(
@@ -606,9 +604,9 @@ def testF8E5M2Memref():
606604
execution_engine.invoke("main", arg1_memref_ptr, arg2_memref_ptr)
607605

608606
# test to-numpy utility
609-
# CHECK: [0.5]
610-
npout = ranked_memref_to_numpy(arg2_memref_ptr[0])
611-
log(npout)
607+
x = ranked_memref_to_numpy(arg2_memref_ptr[0])
608+
assert len(x) == 1
609+
assert x[0] == 0.5
612610

613611

614612
if HAS_ML_DTYPES:

0 commit comments

Comments
 (0)