File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 5
5
from mlir .passmanager import *
6
6
from mlir .execution_engine import *
7
7
from mlir .runtime import *
8
- from ml_dtypes import bfloat16 , float8_e5m2
8
+
9
+ try :
10
+ from ml_dtypes import bfloat16 , float8_e5m2
11
+
12
+ HAS_ML_DTYPES = True
13
+ except ModuleNotFoundError :
14
+ HAS_ML_DTYPES = False
15
+
9
16
10
17
MLIR_RUNNER_UTILS = os .getenv (
11
18
"MLIR_RUNNER_UTILS" , "../../../../lib/libmlir_runner_utils.so"
@@ -564,7 +571,8 @@ def testBF16Memref():
564
571
log (npout )
565
572
566
573
567
- run (testBF16Memref )
574
+ if HAS_ML_DTYPES :
575
+ run (testBF16Memref )
568
576
569
577
570
578
# Test f8E5M2 memrefs
@@ -603,7 +611,8 @@ def testF8E5M2Memref():
603
611
log (npout )
604
612
605
613
606
- run (testF8E5M2Memref )
614
+ if HAS_ML_DTYPES :
615
+ run (testF8E5M2Memref )
607
616
608
617
609
618
# Test addition of two 2d_memref
You can’t perform that action at this time.
0 commit comments