fix: skip MTP integration test when Metal kernel unavailable on CI

The test_mtp_module_with_mock_model test forces GPU evaluation via
mx.isnan(), which triggers steel_gemm kernel compilation. This fails
on CI's aarch64-darwin runner due to Metal toolchain incompatibility.
Skip gracefully instead of failing.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Alex Cheema
2026-02-13 09:41:08 -08:00
co-authored by Claude Opus 4.6
parent 00175bb630
commit 229b21fa8c
@@ -249,5 +249,12 @@ class TestIntegration:
assert logits.shape == (1, 1, 100)
assert new_hidden.shape == (1, 1, config.hidden_size)
# Verify outputs are valid (not NaN)
assert not mx.any(mx.isnan(logits))
assert not mx.any(mx.isnan(new_hidden))
# mx.isnan forces GPU evaluation which may fail on CI runners
# with incompatible Metal toolchains (e.g. missing steel_gemm kernels)
try:
assert not mx.any(mx.isnan(logits))
assert not mx.any(mx.isnan(new_hidden))
except RuntimeError as e:
if "Unable to load kernel" in str(e):
pytest.skip(f"Metal kernel not available on this device: {e}")
raise