Skip to content

Commit 9baf477

Browse files
committed
Merge branch 'codex/canonical-complete-20260715'
2 parents 254dc6d + e70c220 commit 9baf477

312 files changed

Lines changed: 71459 additions & 5189 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ jobs:
2626
shell: bash
2727
run: |
2828
set -euo pipefail
29-
python_bin=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
29+
python_bin=/Volumes/external/sources/.venvs/cppmega.mlx/bin/python
3030
test -x "${python_bin}"
31+
env -u PYTHONPATH -u PYTHONHOME -u VIRTUAL_ENV \
32+
"${python_bin}" scripts/check_mlx_abi.py --json
33+
uv pip check --python "${python_bin}"
3134
"${python_bin}" scripts/run_self_hosted_ci.py lane \
3235
--lane macos-mlx \
3336
--python "${python_bin}" \

.github/workflows/cuda-lane.yml

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,60 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1616

17-
- name: Set up Python
18-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
19-
with:
20-
python-version: "3.13"
21-
22-
- name: Install dependencies
17+
- name: Verify runner-provided CUDA environment
2318
run: |
24-
python -m pip install --upgrade pip
25-
pip install -e ".[dev]"
19+
set -euo pipefail
20+
: "${CPPMEGA_CUDA_PYTHON:?self-hosted CUDA runner must export CPPMEGA_CUDA_PYTHON}"
21+
test -x "$CPPMEGA_CUDA_PYTHON"
22+
cuda_info="$(env -u PYTHONPATH -u PYTHONHOME -u VIRTUAL_ENV \
23+
"$CPPMEGA_CUDA_PYTHON" -c \
24+
'import os,sys; print(os.path.realpath(sys.prefix)); print(os.path.realpath(sys.base_prefix))')"
25+
cuda_prefix="${cuda_info%%$'\n'*}"
26+
cuda_base_prefix="${cuda_info#*$'\n'}"
27+
test -n "$cuda_prefix"
28+
test -n "$cuda_base_prefix"
29+
test "$cuda_prefix" != "$cuda_base_prefix"
30+
test -f "$cuda_prefix/pyvenv.cfg"
31+
python_abs="$(python3 -c 'import os,sys; print(os.path.abspath(sys.argv[1]))' "$CPPMEGA_CUDA_PYTHON")"
32+
case "$python_abs" in
33+
"$cuda_prefix/bin/"*) ;;
34+
*) echo "selected CUDA Python is outside its venv prefix" >&2; exit 2 ;;
35+
esac
36+
workspace_real="$(cd "$GITHUB_WORKSPACE" && pwd -P)"
37+
case "$cuda_prefix" in
38+
"$workspace_real"|"$workspace_real"/*)
39+
echo "refusing CUDA environment inside GITHUB_WORKSPACE" >&2
40+
exit 2
41+
;;
42+
esac
43+
if git -C "$cuda_prefix" rev-parse --show-toplevel >/dev/null 2>&1; then
44+
echo "refusing CUDA environment inside a Git checkout" >&2
45+
exit 2
46+
fi
47+
uv lock --check --no-sources --project .
48+
UV_PROJECT_ENVIRONMENT="$cuda_prefix" uv sync --project . --locked \
49+
--no-sources --python "$CPPMEGA_CUDA_PYTHON" --group dev \
50+
--extra path-c
51+
"$CPPMEGA_CUDA_PYTHON" scripts/check_cuda_environment.py --json \
52+
| tee "$RUNNER_TEMP/cppmega-cuda-environment.json"
53+
uv pip check --python "$CPPMEGA_CUDA_PYTHON"
54+
55+
- name: Upload CUDA environment receipt
56+
if: always()
57+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
58+
with:
59+
name: cppmega-mlx-cuda-environment-${{ github.run_id }}-${{ github.run_attempt }}
60+
path: ${{ runner.temp }}/cppmega-cuda-environment.json
61+
if-no-files-found: warn
62+
retention-days: 14
2663

2764
- name: Run CUDA tests
2865
run: |
29-
python -m pytest -m "cuda_hardware or cuda_required" -v --tb=short
66+
set -euo pipefail
67+
: "${CPPMEGA_CUDA_PYTHON:?self-hosted CUDA runner must export CPPMEGA_CUDA_PYTHON}"
68+
selected="$RUNNER_TEMP/cppmega-cuda-selected.txt"
69+
CPPMEGA_RUN_CUDA_TESTS=1 "$CPPMEGA_CUDA_PYTHON" -m pytest \
70+
--collect-only -q -m "cuda_hardware or cuda_required" > "$selected"
71+
grep -q '::' "$selected"
72+
CPPMEGA_RUN_CUDA_TESTS=1 "$CPPMEGA_CUDA_PYTHON" -m pytest \
73+
-m "cuda_hardware or cuda_required" -v --tb=short

.github/workflows/e2e-matrix.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ on:
1616
branches: [main]
1717
paths:
1818
- "cppmega_v4/**"
19+
- "cppmega_mlx/**"
1920
- "vbgui/**"
2021
- "tests/fixtures/build_e2e_matrix.py"
22+
- "tests/fixtures/parquet/**"
23+
- "tests/fixtures/tokenizers/**"
2124
- "scripts/install_self_hosted_e2e_python.sh"
2225
- ".github/workflows/e2e-matrix.yml"
2326
schedule:
@@ -54,7 +57,7 @@ jobs:
5457
node-version: "22"
5558
- name: Create isolated MLX Python
5659
run: |
57-
base_python=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
60+
base_python=/Volumes/external/sources/.venvs/cppmega.mlx/bin/python
5861
test -x "$base_python"
5962
job_venv="$(mktemp -d "$RUNNER_TEMP/cppmega-mlx-e2e-${GITHUB_RUN_ID}-${GITHUB_JOB}.XXXXXX")"
6063
"$base_python" -m venv "$job_venv"
@@ -120,7 +123,7 @@ jobs:
120123
with: { node-version: "22" }
121124
- name: Create isolated MLX Python
122125
run: |
123-
base_python=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
126+
base_python=/Volumes/external/sources/.venvs/cppmega.mlx/bin/python
124127
test -x "$base_python"
125128
job_venv="$(mktemp -d "$RUNNER_TEMP/cppmega-mlx-e2e-${GITHUB_RUN_ID}-${GITHUB_JOB}.XXXXXX")"
126129
"$base_python" -m venv "$job_venv"
@@ -178,7 +181,7 @@ jobs:
178181
with: { node-version: "22" }
179182
- name: Create isolated MLX Python
180183
run: |
181-
base_python=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
184+
base_python=/Volumes/external/sources/.venvs/cppmega.mlx/bin/python
182185
test -x "$base_python"
183186
job_venv="$(mktemp -d "$RUNNER_TEMP/cppmega-mlx-e2e-${GITHUB_RUN_ID}-${GITHUB_JOB}.XXXXXX")"
184187
"$base_python" -m venv "$job_venv"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ docs/upstream/tilelang_metal_mamba3/captures/
3434
.claude/
3535

3636
# Large real-data samples copied from GB10 for local-only smoke tests.
37-
data/parquet_samples/
37+
data/parquet_samples
3838

3939
# Beads / Dolt files (added by bd init)
4040
.beads/

MANIFEST.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
include README.md
2+
include pyproject.toml
3+
include setup.py
4+
include cppmega_mlx/tokenizer/tokenizer_contract_v1.json
5+
include cppmega_mlx/tokenizer/tokenizer.json
6+
include cppmega_mlx/data/domain_schema_v1.json
7+
include cppmega_v4/nn/_external/VENDORED_MANIFEST.json
8+
global-exclude *.so *.dylib *.metallib
9+
recursive-include cppmega_mlx/training/native_optim \
10+
CMakeLists.txt \
11+
bindings.cpp \
12+
fused_8bit.cpp \
13+
fused_8bit.h \
14+
fused_8bit.metal
15+
recursive-include cppmega_v4/widget/static *.css *.mjs
16+
global-exclude *.so *.dylib *.metallib

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ matrix at
222222
2. dsa_splitk budget gate — tiled Q-cache for `AH≥8` production shapes
223223
3. ATEN_DISPATCH `_scaled_dot_product_flash_attention_for_cpu` wiring (FA TileLang kernel exists at `_kernels/flash_attention.py`)
224224
4. reduce_prod `vectorize_loop.cc` / `storage_rewrite.cc` mul-kind handling
225-
5. `scripts/check_mlx_abi.sh` to catch venv-vs-brew dylib mismatch (host venv `mlx.core.so` was built against older `libmlx.dylib` — silent test skips)
225+
5. `scripts/check_mlx_abi.sh` to catch `mlx`/`mlx-metal` drift before kernel
226+
tests (run it against the isolated env; the checkout `.venv` is shared)
226227

227228
NVFP4 on MLX research is committed at
228229
[`tilelang/docs/research/nvfp4_mlx_metal.md`](https://github.com/DatasunriseOU/tilelang/blob/main/docs/research/nvfp4_mlx_metal.md):

0 commit comments

Comments
 (0)