Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MLIR][test] Check for ml_dtypes before running tests #123061

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions mlir/test/python/execution_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
from mlir.passmanager import *
from mlir.execution_engine import *
from mlir.runtime import *
from ml_dtypes import bfloat16, float8_e5m2

try:
from ml_dtypes import bfloat16, float8_e5m2

HAS_ML_DTYPES = True
except ModuleNotFoundError:
HAS_ML_DTYPES = False


MLIR_RUNNER_UTILS = os.getenv(
"MLIR_RUNNER_UTILS", "../../../../lib/libmlir_runner_utils.so"
Expand Down Expand Up @@ -564,7 +571,8 @@ def testBF16Memref():
log(npout)


run(testBF16Memref)
if HAS_ML_DTYPES:
run(testBF16Memref)


# Test f8E5M2 memrefs
Expand Down Expand Up @@ -603,7 +611,8 @@ def testF8E5M2Memref():
log(npout)


run(testF8E5M2Memref)
if HAS_ML_DTYPES:
run(testF8E5M2Memref)


# Test addition of two 2d_memref
Expand Down
Loading