Add Blacksmith mactop diagnostics #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| pull_request: | |
| push: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| swift: | |
| runs-on: blacksmith-12vcpu-macos-26 | |
| timeout-minutes: 45 | |
| env: | |
| CLANG_MODULE_CACHE_PATH: ${{ github.workspace }}/.build/clang-module-cache | |
| MLXFAST_RUN_MLX_RUNTIME_TESTS: "0" | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Show toolchain | |
| run: | | |
| swift --version | |
| xcodebuild -version | |
| - name: Enforce contestant modifiable surface | |
| if: startsWith(github.head_ref, 'submissions/') || startsWith(github.ref_name, 'submissions/') | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| HEAD_SHA: ${{ github.sha }} | |
| run: | | |
| if [[ "${EVENT_NAME}" == "pull_request" ]]; then | |
| export BASE_SHA="${PR_BASE_SHA}" | |
| export HEAD_SHA="${PR_HEAD_SHA}" | |
| else | |
| export BASE_SHA="$(git merge-base origin/main "${HEAD_SHA}")" | |
| fi | |
| .github/scripts/enforce-modifiable-surface.sh | |
| - name: Shell syntax | |
| run: | | |
| bash -n setup.sh | |
| bash -n benchmark.sh | |
| bash -n tools/build-mlx-metallib.sh | |
| bash -n .github/scripts/enforce-trusted-benchmark-workflow.sh | |
| bash -n .github/scripts/enforce-modifiable-surface.sh | |
| bash -n .github/scripts/overlay-editable-paths.sh | |
| bash -n .github/scripts/verify-correctness-golden.sh | |
| bash -n .github/scripts/validate-benchmark-artifacts.sh | |
| bash -n .github/scripts/deny-private-artifacts.sh | |
| bash -n .github/scripts/download-r2-object.sh | |
| bash -n .github/scripts/download-reference-cache-scope.sh | |
| - name: Build release CLI | |
| run: | | |
| mkdir -p .build/clang-module-cache | |
| swift build -c release | |
| - name: Unit tests without Metal runtime | |
| run: | | |
| swift test --filter 'Transform|Submission|BenchmarkSupport|Golden|Score|CheckpointIndex|Safetensors|DenseTensorStore|ExpertSlotBank|DeepSeekConfig|DeepSeekCorrectness|CorrectnessReport|TensorData|MLXTensorBridgeMaps' | |
| - name: Submission packaging smoke test | |
| run: | | |
| BIN="${PWD}/.build/release/mlxfast-swift" | |
| WORKSPACE="${RUNNER_TEMP}/mlxfast-submit-smoke" | |
| rm -rf "${WORKSPACE}" | |
| mkdir -p "${WORKSPACE}/Sources/MLXFastModel" "${WORKSPACE}/Sources/MLXFastTransform" | |
| cat > "${WORKSPACE}/benchmark.json" <<'JSON' | |
| { | |
| "schemaVersion": 1, | |
| "name": "mlxfast-submit-smoke", | |
| "editablePaths": [ | |
| "Sources/MLXFastModel", | |
| "Sources/MLXFastTransform" | |
| ] | |
| } | |
| JSON | |
| printf 'public enum SmokeModel {}\n' > "${WORKSPACE}/Sources/MLXFastModel/SmokeModel.swift" | |
| printf 'public enum SmokeTransform {}\n' > "${WORKSPACE}/Sources/MLXFastTransform/SmokeTransform.swift" | |
| git -C "${WORKSPACE}" init | |
| git -C "${WORKSPACE}" add benchmark.json Sources | |
| git -C "${WORKSPACE}" -c user.name="CI" -c user.email="ci@example.test" commit -m "base" | |
| "${BIN}" submit --contract "${WORKSPACE}/benchmark.json" --base-ref HEAD --output /tmp/mlxfast-submission.zip | |
| test -s /tmp/mlxfast-submission.zip | |
| - name: Login smoke test | |
| run: | | |
| export XDG_CONFIG_HOME="${RUNNER_TEMP}/mlxfast-config" | |
| .build/release/mlxfast-swift login test-api-key --api https://yukon.example.test --no-verify | |
| test -f "${XDG_CONFIG_HOME}/mlxfast/credentials" | |
| python3 - <<'PY' | |
| import json | |
| import os | |
| import stat | |
| from pathlib import Path | |
| path = Path(os.environ["XDG_CONFIG_HOME"]) / "mlxfast" / "credentials" | |
| data = json.loads(path.read_text()) | |
| assert data["api_key"] == "test-api-key" | |
| assert data["api_base_url"] == "https://yukon.example.test" | |
| assert stat.S_IMODE(path.stat().st_mode) == 0o600 | |
| PY |