Skip to content

Commit e13a498

Browse files
author
Gopalakrishnan Nallasamy
committed
Add ad hoc MLX EP conformance validation
1 parent 2ffa0f7 commit e13a498

1 file changed

Lines changed: 102 additions & 0 deletions

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Ad hoc MLX EP conformance for PR 28968
2+
3+
on:
4+
push:
5+
branches:
6+
- ad-hoc-mlx-conformance-28968-20260717
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
mlx-ep-conformance:
13+
name: MLX plugin EP shared invariants (macOS arm64)
14+
runs-on: macos-14
15+
timeout-minutes: 180
16+
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install build and MLX plugin dependencies
25+
run: |
26+
set -euo pipefail
27+
brew install ninja
28+
python -m pip install --upgrade pip
29+
python -m pip install --no-deps "onnxruntime-ep-mlx==0.3.0"
30+
python - <<'PY'
31+
import onnxruntime_ep_mlx as mlx
32+
print("MLX EP version:", mlx.version())
33+
print("MLX EP name:", mlx.ep_name())
34+
print("MLX EP library:", mlx.library_path())
35+
PY
36+
37+
- name: Build onnxruntime_provider_test from PR 28968
38+
run: |
39+
set -euo pipefail
40+
python tools/ci_build/build.py \
41+
--build_dir build/mlx-conformance \
42+
--config Release \
43+
--update \
44+
--build \
45+
--parallel \
46+
--target onnxruntime_provider_test \
47+
--cmake_generator Ninja
48+
49+
- name: Run shared conformance invariants against MLX
50+
run: |
51+
set -euo pipefail
52+
MLX_LIB="$(python -c 'import onnxruntime_ep_mlx as mlx; print(mlx.library_path())')"
53+
MLX_DIR="$(dirname "$MLX_LIB")"
54+
TEST_BIN="$(find build/mlx-conformance -type f -name onnxruntime_provider_test -perm -111 | head -n 1)"
55+
56+
test -n "$TEST_BIN"
57+
test -x "$TEST_BIN"
58+
test -f "$MLX_LIB"
59+
60+
echo "Test binary: $TEST_BIN"
61+
echo "MLX plugin: $MLX_LIB"
62+
otool -L "$MLX_LIB"
63+
64+
export DYLD_LIBRARY_PATH="$MLX_DIR:${DYLD_LIBRARY_PATH:-}"
65+
export ORT_UNIT_TEST_MAIN_DYNAMIC_PLUGIN_EP_CONFIG_JSON="$(python - "$MLX_LIB" <<'PY'
66+
import json
67+
import sys
68+
69+
print(json.dumps({
70+
"ep_library_registration_name": "MLXExecutionProvider",
71+
"ep_library_path": sys.argv[1],
72+
"selected_ep_name": "MLXExecutionProvider",
73+
}))
74+
PY
75+
)"
76+
77+
"$TEST_BIN" \
78+
--gtest_filter='EpPluginConformanceTest.*' \
79+
--gtest_color=no \
80+
2>&1 | tee mlx_ep_conformance.log
81+
82+
- name: Publish test summary
83+
if: always()
84+
run: |
85+
{
86+
echo "### MLX plugin EP conformance"
87+
echo '```text'
88+
if test -f mlx_ep_conformance.log; then
89+
tail -n 80 mlx_ep_conformance.log
90+
else
91+
echo "Conformance test did not produce a log."
92+
fi
93+
echo '```'
94+
} >> "$GITHUB_STEP_SUMMARY"
95+
96+
- name: Upload conformance log
97+
if: always()
98+
uses: actions/upload-artifact@v6
99+
with:
100+
name: mlx-ep-conformance-log
101+
path: mlx_ep_conformance.log
102+
if-no-files-found: warn

0 commit comments

Comments
 (0)