Skip to content

Commit 7be95ab

Browse files
committed
ci: isolate MLX checks on self-hosted runners
1 parent 96cc3f3 commit 7be95ab

5 files changed

Lines changed: 34 additions & 8 deletions

File tree

.github/workflows/ci-self-hosted.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
git diff --check
4040
4141
linux-portable:
42-
name: Linux portable conveyor contracts
42+
name: Linux portable syntax and conveyor contracts
4343
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
4444
timeout-minutes: 20
4545
steps:
@@ -53,10 +53,13 @@ jobs:
5353
shell: bash
5454
run: |
5555
set -euo pipefail
56-
python -m pytest -q \
56+
# cppmega.mlx imports Apple's MLX runtime at package import time. The
57+
# Linux runner exercises only portable scripts and deliberately skips
58+
# the macOS-only root conftest/package initialization.
59+
python -m pytest -q --noconftest \
5760
tests/test_audit_sidecar_parquet.py \
58-
tests/test_pack_enriched_rows.py \
5961
tests/test_streaming_conveyor_progress.py \
6062
tests/test_process_commits_fail_loud.py \
6163
tests/test_repair_packed_document_boundaries.py
64+
python -m compileall -q scripts tools/clang_indexer
6265
git diff --check

.github/workflows/cuda-lane.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: CUDA Lane
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
4+
# CUDA capacity is provisioned explicitly (for example on Nebius H200).
5+
# Do not leave ordinary PRs queued forever when no self-hosted CUDA runner
6+
# is attached to this repository.
87
workflow_dispatch:
98

109
jobs:

cppmega_mlx/nn/mamba3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ def _dispatch_mamba3_scan(
523523
lowered TileLang DSL fwd+bwd kernel and fails closed if unavailable.
524524
"""
525525

526-
from cppmega_mlx.nn._tilelang.mamba3 import mamba3_mimo_metal_status
527526
from cppmega_mlx.runtime.kernel_policy import (
528527
KernelPath,
529528
record_dispatch,
@@ -576,6 +575,8 @@ def _dispatch_mamba3_scan(
576575
)
577576

578577
# AUTO + PATH_B share the Metal-availability check.
578+
from cppmega_mlx.nn._tilelang.mamba3 import mamba3_mimo_metal_status
579+
579580
status = mamba3_mimo_metal_status(x)
580581
if path is KernelPath.PATH_B and not status.available:
581582
# Device-aware Path B: on a CUDA host (Metal unavailable, default

tests/test_mamba3_dispatch.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from __future__ import annotations
1111

12+
import sys
13+
1214
import numpy as np
1315
import pytest
1416

@@ -85,6 +87,20 @@ def test_reference_policy_forces_pure_mlx(monkeypatch: pytest.MonkeyPatch) -> No
8587
assert matches[-1]["kernel_used"] == "reference_pure_mlx"
8688

8789

90+
def test_reference_policy_does_not_import_tilelang_dispatch(
91+
monkeypatch: pytest.MonkeyPatch,
92+
) -> None:
93+
monkeypatch.setenv("CPPMEGA_KERNEL_PATH", "ref")
94+
monkeypatch.setitem(sys.modules, "cppmega_mlx.nn._tilelang.mamba3", None)
95+
96+
block, hidden = _make_block()
97+
out, _ = block(hidden)
98+
mx.eval(out)
99+
100+
matches = [e for e in get_dispatch_log() if e["op_name"] == "mamba3_mimo"]
101+
assert matches[-1]["kernel_used"] == "reference_pure_mlx"
102+
103+
88104
def test_path_b_policy_forces_metal(monkeypatch: pytest.MonkeyPatch) -> None:
89105
if not _METAL_AVAILABLE:
90106
pytest.skip("Metal not available")

tests/test_megatron_indexed.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import json
4+
import os
45
import subprocess
56
import sys
67
import struct
@@ -255,9 +256,15 @@ def _write_structured_multishard_fixture(
255256

256257

257258
def _run_train_hybrid_tiny(*args: str) -> subprocess.CompletedProcess[str]:
259+
env = os.environ.copy()
260+
# This suite validates indexed-dataset ingress, not optional kernel discovery.
261+
# An explicit reference route keeps the subprocess independent of any shared
262+
# TileLang/TVM development checkout configured by the parent pytest process.
263+
env["CPPMEGA_KERNEL_PATH"] = "ref"
258264
return subprocess.run(
259265
[sys.executable, str(TRAIN_HYBRID_TINY), *args],
260266
cwd=ROOT,
267+
env=env,
261268
text=True,
262269
capture_output=True,
263270
timeout=45,

0 commit comments

Comments
 (0)