Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .gi/templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,113 @@
"HF_HOME": "/mnt/model-store/huggingface",
"HF_HUB_CACHE": "/mnt/model-store/huggingface/hub"
}
},
{
"name": "Native M3 Ultra Metal inference qualification",
"group": "Inference",
"target": {
"executor": "lab",
"selector": {
"os": {
"family": "macos"
},
"arch": {
"in": [
"aarch64"
]
},
"accelerator": {
"backend": "metal",
"model": {
"in": [
"Apple M3 Ultra"
]
}
},
"memory": {
"system_gib": {
"min": 120
}
},
"network": {
"in": [
"james-lab",
"dan-lab"
]
}
}
},
"build": "cd ${repo_dir} && just inference-build metal",
"inputs": [
{
"key": "profile",
"label": "Profile",
"kind": "choice",
"choices": [
{
"value": "pr",
"label": "pr"
},
{
"value": "nightly",
"label": "nightly"
},
{
"value": "release",
"label": "release"
}
],
"default": "pr"
},
{
"key": "model_key",
"label": "Model",
"kind": "choice",
"choices": [
{
"value": "qwen35-08b",
"label": "Qwen/Qwen3.5-0.8B"
},
{
"value": "qwen35-2b",
"label": "Qwen/Qwen3.5-2B"
},
{
"value": "qwen35-4b",
"label": "Qwen/Qwen3.5-4B"
},
{
"value": "qwen35-9b",
"label": "Qwen/Qwen3.5-9B"
},
{
"value": "qwen38-27b",
"label": "Qwen/Qwen3.8-27B"
},
{
"value": "qwen3-coder-30b-a3b",
"label": "Qwen/Qwen3-Coder-30B-A3B-Instruct"
},
{
"value": "qwen36-35b-a3b",
"label": "Qwen/Qwen3.6-35B-A3B"
},
{
"value": "qwen38-flash-next",
"label": "Qwen/Qwen3.8-Flash-Next"
}
],
"default": "qwen35-4b"
}
],
"budget": {
"max_usd": 0,
"max_duration_s": 18000,
"grace_s": 60
},
"retain": "never",
"key": "inference-metal-standalone",
"command": "cd \"$JIANYANG_REPO_DIR\" && just inference-execute ${profile} ${model_key} standalone metal"
}
]
}
2 changes: 1 addition & 1 deletion .github/scripts/inference-publication.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function status(eventName, publication, overrides = {}) {
const statuses = [];
const failures = [];
const process = { env: {
SOURCE_SHA: 'a'.repeat(40), PLAN: 'success', RESULT: 'success',
SOURCE_SHA: 'a'.repeat(40), PLAN: 'success', RESULT: 'success', METAL: 'success',
PUBLICATION_REQUIRED: 'true', PUBLICATION: publication,
RUN_URL: 'https://example.invalid/run', PROFILE: 'nightly', COMPARISON: 'skipped', ...overrides,
} };
Expand Down
78 changes: 49 additions & 29 deletions .github/workflows/inference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ jobs:
profile: ${{ steps.admission.outputs.profile || 'pr' }}
publication: ${{ steps.admission.outputs.publication }}
matrix: ${{ steps.matrix.outputs.matrix }}
metal_matrix: ${{ steps.metal_matrix.outputs.matrix }}
controller: ${{ steps.controller.outputs.sha }}
steps:
# Credentialed controller source always comes from protected main.
Expand All @@ -118,41 +119,46 @@ jobs:
RELEASE_CANDIDATE: ${{ inputs.release_candidate }}
run: just inference-admit
- id: matrix
env:
env: &matrix-env
SOURCE_SHA: ${{ steps.admission.outputs.source }}
PROFILE: ${{ steps.admission.outputs.profile }}
NIGHTLY_PUBLICATION: ${{ steps.admission.outputs.publication }}
run: |
flags=()
if [[ "$NIGHTLY_PUBLICATION" == true ]]; then flags+=(--include-smoke); fi
just inference-matrix "$PROFILE" "$SOURCE_SHA" "${flags[@]}"
- id: metal_matrix
env: *matrix-env
run: |
flags=(--backend metal)
if [[ "$NIGHTLY_PUBLICATION" == true ]]; then flags+=(--include-smoke); fi
just inference-matrix "$PROFILE" "$SOURCE_SHA" "${flags[@]}"
qualification:
name: qualification (${{ matrix.id }})
name: ${{ matrix.name }}
needs: plan
strategy:
fail-fast: false
max-parallel: 3
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
runs-on: ${{ vars.SKIPPY_DEPOT_RUNNERS_ENABLED == 'true' && 'depot-ubuntu-24.04-4' || 'ubuntu-24.04' }}
timeout-minutes: ${{ matrix.profile == 'pr' && 100 || 360 }}
env:
env: &qualification-env
EVIDENCE: target/ci-evidence/inference-${{ matrix.id }}
steps:
steps: &qualification-steps
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
with:
ref: ${{ needs.plan.outputs.controller }}
persist-credentials: false
- uses: ./.github/actions/setup
- name: Dispatch and await native Spark qualification
- name: Dispatch and await native qualification
env:
SOURCE_SHA: ${{ needs.plan.outputs.source }}
PROFILE: ${{ matrix.profile }}
BACKEND: ${{ matrix.backend }}
CONFIGURATION: ${{ matrix.configuration }}
JIANYANG_INFERENCE_SSH_KEY: ${{ secrets.JIANYANG_INFERENCE_SSH_KEY }}
run: |
flags=()
if [[ "$PROFILE" == pr || "$PROFILE" == nightly ]]; then flags+=(--collect-metrics); fi
just inference-dispatch "$PROFILE" "$SOURCE_SHA" "$EVIDENCE" "$CONFIGURATION" "${flags[@]}"
just inference-dispatch "$PROFILE" "$SOURCE_SHA" "$EVIDENCE" "$CONFIGURATION" --backend "$BACKEND" --collect-metrics
- name: Cancel outstanding JY jobs and formations
if: cancelled() || failure()
env:
Expand All @@ -168,9 +174,22 @@ jobs:
path: ${{ env.EVIDENCE }}
if-no-files-found: error
retention-days: 30
qualification_metal:
name: ${{ matrix.name }}
needs: plan
strategy:
fail-fast: false
# The M3 Ultra is reserved exclusively. Serial dispatch keeps jobs off
# the Actions timeout clock until the preceding model finishes.
max-parallel: 1
matrix: ${{ fromJSON(needs.plan.outputs.metal_matrix) }}
runs-on: ${{ vars.SKIPPY_DEPOT_RUNNERS_ENABLED == 'true' && 'depot-ubuntu-24.04-4' || 'ubuntu-24.04' }}
timeout-minutes: ${{ matrix.profile == 'pr' && 100 || 360 }}
env: *qualification-env
steps: *qualification-steps
nightly_publish:
name: Publish nightly qualification
needs: [plan, qualification]
needs: [plan, qualification, qualification_metal]
if: >-
always() && !cancelled() && needs.plan.outputs.publication == 'true' &&
needs.plan.result == 'success'
Expand Down Expand Up @@ -205,7 +224,7 @@ jobs:
env:
SOURCE_SHA: ${{ needs.plan.outputs.source }}
QUALIFICATION_PROFILE: ${{ needs.plan.outputs.profile }}
MATRIX_RESULT: ${{ needs.qualification.result }}
MATRIX_RESULT: ${{ needs.qualification.result == 'success' && needs.qualification_metal.result == 'success' && 'success' || 'failure' }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_HUB_DISABLE_PROGRESS_BARS: '1'
run: |
Expand All @@ -221,13 +240,13 @@ jobs:
retention-days: 30

compare:
name: Compare with published inference baseline
needs: [plan, qualification]
name: Report inference qualification
needs: [plan, qualification, qualification_metal]
if: >-
always() && !cancelled() && needs.plan.result == 'success' &&
needs.plan.outputs.publication != 'true' &&
(github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch') &&
(needs.plan.outputs.profile == 'pr' || needs.plan.outputs.profile == 'nightly')
(github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' || inputs.release_candidate) &&
(needs.plan.outputs.profile == 'pr' || needs.plan.outputs.profile == 'nightly' || needs.plan.outputs.profile == 'release')
runs-on: ${{ vars.SKIPPY_DEPOT_RUNNERS_ENABLED == 'true' && 'depot-ubuntu-24.04-4' || 'ubuntu-24.04' }}
timeout-minutes: 10
permissions:
Expand All @@ -250,15 +269,15 @@ jobs:
GH_TOKEN: ${{ github.token }}
PROFILE: ${{ needs.plan.outputs.profile }}
SOURCE_SHA: ${{ needs.plan.outputs.source }}
MATRIX_RESULT: ${{ needs.qualification.result }}
MATRIX_RESULT: ${{ needs.qualification.result == 'success' && needs.qualification_metal.result == 'success' && 'success' || 'failure' }}
run: |
RUN_STARTED_AT=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT" \
--jq '.run_started_at')
export RUN_STARTED_AT
just inference-compare target/ci-evidence/inference-comparison

summary:
needs: [plan, qualification, nightly_publish, compare]
needs: [plan, qualification, qualification_metal, nightly_publish, compare]
if: always()
runs-on: ${{ vars.SKIPPY_DEPOT_RUNNERS_ENABLED == 'true' && 'depot-ubuntu-24.04-4' || 'ubuntu-24.04' }}
timeout-minutes: 5
Expand All @@ -270,6 +289,7 @@ jobs:
SOURCE_SHA: ${{ needs.plan.outputs.source || github.event.pull_request.head.sha || github.sha }}
PLAN: ${{ needs.plan.result }}
RESULT: ${{ needs.qualification.result }}
METAL: ${{ needs.qualification_metal.result }}
PUBLICATION: ${{ needs.nightly_publish.result }}
COMPARISON: ${{ needs.compare.result }}
PROFILE: ${{ needs.plan.outputs.profile }}
Expand All @@ -278,7 +298,7 @@ jobs:
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
script: |
const { SOURCE_SHA: sha, PLAN: plan, RESULT: result, PUBLICATION: publication,
const { SOURCE_SHA: sha, PLAN: plan, RESULT: cuda, METAL: metal, PUBLICATION: publication,
COMPARISON: comparison, PROFILE: profile, RELEASE_CANDIDATE: candidate, RUN_URL: url } = process.env;
if (!/^[a-f0-9]{40}$/i.test(sha)) throw new Error('Invalid qualification source SHA');
// A skipped plan is an intentional opt-out: the PR carries no
Expand All @@ -288,25 +308,23 @@ jobs:
const skipped = plan === 'skipped' && pullRequest &&
!(context.payload.pull_request.labels ?? []).some(label => label.name === 'qualify');
const nightly = process.env.PUBLICATION_REQUIRED === 'true';
const compare = !nightly && (pullRequest || context.eventName === 'workflow_dispatch') &&
(profile === 'pr' || profile === 'nightly');
const passed = plan === 'success' && result === 'success' &&
const compare = !nightly && (pullRequest || context.eventName === 'workflow_dispatch' || Boolean(candidate));
const qualified = cuda === 'success' && metal === 'success';
const passed = plan === 'success' && qualified &&
(!nightly || publication === 'success') && (!compare || comparison === 'success');
const description = passed
? 'Native Spark lab qualification'
? 'Native CUDA and Metal lab qualification'
: skipped
? 'Intentionally skipped (no qualify label)'
: nightly
? 'Nightly qualification or publication incomplete or failed'
: compare && result === 'success'
: compare && qualified && profile !== 'release'
? 'Published baseline comparison failed or incomplete'
: 'Inference admission or qualification incomplete or failed';
if (skipped || plan !== 'success' || profile === 'release') {
if (skipped || plan !== 'success') {
const detail = skipped
? 'Spark qualification was intentionally skipped because the PR does not carry the `qualify` label.'
: plan !== 'success'
? 'Qualification did not reach the lab. See the admission job for details.'
: 'The release profile runs longer AgentX trials and has no matching published baseline.';
? 'Qualification was intentionally skipped because the PR does not carry the `qualify` label.'
: 'Qualification did not reach the lab. See the admission job for details.';
const outcome = skipped ? 'Skipped' : passed ? 'Passed' : 'Failed';
await core.summary.addHeading('Inference qualification')
.addRaw(`**${outcome}** · \`${sha.slice(0, 12)}\`\n\n${detail}\n`, true).write();
Expand All @@ -318,7 +336,7 @@ jobs:
if (!passed && !skipped) core.setFailed(description);

report:
needs: [plan, qualification, summary]
needs: [plan, qualification, qualification_metal, summary]
if: always() && github.event_name == 'pull_request_target' && needs.plan.result == 'success'
runs-on: ${{ vars.SKIPPY_DEPOT_RUNNERS_ENABLED == 'true' && 'depot-ubuntu-24.04-4' || 'ubuntu-24.04' }}
timeout-minutes: 10
Expand All @@ -344,5 +362,7 @@ jobs:
SOURCE_SHA: ${{ needs.plan.outputs.source || github.event.pull_request.head.sha }}
PLAN: ${{ needs.plan.result }}
REQUIRED: 'true'
RESULT: ${{ needs.qualification.result }}
RESULT: ${{ needs.qualification.result == 'success' && needs.qualification_metal.result == 'success' && 'success' || 'failure' }}
CUDA_MATRIX: ${{ needs.plan.outputs.matrix }}
METAL_MATRIX: ${{ needs.plan.outputs.metal_matrix }}
run: bash scripts/inference-report.sh target/inference-comment
25 changes: 18 additions & 7 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -201,20 +201,31 @@ inference-dispatch profile source output="target/ci-evidence/inference" *configu
@"{{ automation_python }}" scripts/inference-dispatch.py dispatch "$@"

[positional-arguments]
inference-execute profile model mode:
inference-execute profile model mode backend="cuda":
@"{{ automation_python }}" scripts/inference-execute.py "$@"

[positional-arguments]
inference-cancel ledger="target/ci-evidence/inference/jobs.json":
@"{{ automation_python }}" scripts/inference-dispatch.py cancel "$@"

inference-build:
@"{{ automation_python }}" scripts/inference-build.py
[positional-arguments]
inference-build backend="cuda":
@"{{ automation_python }}" scripts/inference-build.py "$@"

inference-build-uncached:
@command -v hf uv nvidia-smi
@SCCACHE_BASEDIRS="$PWD" LLAMA_STAGE_BACKEND=cuda LLAMA_STAGE_CUDA_ARCHITECTURES=121 LLAMA_STAGE_LINK_MODE=static just llama-build
@LLAMA_STAGE_BACKEND=cuda LLAMA_STAGE_CUDA_ARCHITECTURES=121 LLAMA_STAGE_LINK_MODE=static cargo build --locked -p skippy-cli -p skippy-correctness
[positional-arguments]
inference-build-uncached backend="cuda":
#!/usr/bin/env bash
set -euo pipefail
command -v hf
command -v uv
case "$1" in
cuda) command -v nvidia-smi; export LLAMA_STAGE_CUDA_ARCHITECTURES=121 ;;
metal) xcrun --find swift ;;
*) exit 2 ;;
esac
export LLAMA_STAGE_BACKEND="$1" LLAMA_STAGE_LINK_MODE=static SCCACHE_BASEDIRS="$PWD"
just llama-build
cargo build --locked -p skippy-cli -p skippy-correctness

# Linux diagnostic: retain all MiMo2 graph assertions and report peak memory.
native-contract-build: llama-prepare
Expand Down
Loading
Loading