Repository navigation
997 lines (940 loc) · 49 KB
/
Copy pathrun-sweep.yml
File metadata and controls
997 lines (940 loc) · 49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
name: "Run Sweep"
run-name: Run Sweep - ${{ github.event.pull_request.title }}
concurrency:
group: >-
sweep-${{ github.event.pull_request.number }}-${{
(github.event.action == 'labeled' || github.event.action == 'unlabeled') &&
github.event.label.name != 'full-sweep-enabled' &&
github.event.label.name != 'non-canary-full-sweep-enabled' &&
github.event.label.name != 'full-sweep-fail-fast' &&
github.event.label.name != 'all-evals' &&
github.event.label.name != 'evals-only' &&
github.event.label.name != 'agentx-fast' &&
github.run_id ||
'active'
}}
cancel-in-progress: true
on:
pull_request:
branches:
- main
types:
- synchronize
- labeled
- unlabeled
paths:
- "inferencex-e2e/perf-changelog.yaml"
permissions:
contents: read
env:
PYTHONPATH: ${{ github.workspace }}/inferencex-e2e
jobs:
check-changelog:
name: check-changelog
runs-on: ubuntu-latest
permissions:
contents: read
# Labels opt into sweeps regardless of draft status; readiness only starts reviews.
if: >-
github.event.pull_request.head.repo.full_name == github.repository &&
(
(github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
github.event.label.name == 'full-sweep-enabled' ||
github.event.label.name == 'non-canary-full-sweep-enabled' ||
github.event.label.name == 'full-sweep-fail-fast' ||
github.event.label.name == 'all-evals' ||
github.event.label.name == 'evals-only' ||
github.event.label.name == 'agentx-fast'
)
outputs:
skip-pr-sweep: ${{ steps.sweep_policy.outputs.skip-pr-sweep }}
steps:
- name: Reject conflicting sweep labels
env:
SWEEP_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
count=$(jq '
[
.[] |
select(
. == "full-sweep-enabled" or
. == "non-canary-full-sweep-enabled" or
. == "full-sweep-fail-fast"
)
] |
length
' <<<"$SWEEP_LABELS")
if [ "$count" -gt 1 ]; then
echo "::error::PR has multiple conflicting sweep labels. Pick exactly one."
exit 1
fi
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Read PR sweep policy
id: sweep_policy
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
if git log -1 --format=%B "$HEAD_SHA" | grep -Fq '[skip-sweep]'; then
echo "skip-pr-sweep=true" >> "$GITHUB_OUTPUT"
else
echo "skip-pr-sweep=false" >> "$GITHUB_OUTPUT"
fi
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Validate perf-changelog matrix
env:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
ALL_EVALS: ${{ contains(github.event.pull_request.labels.*.name, 'all-evals') }}
EVALS_ONLY: ${{ contains(github.event.pull_request.labels.*.name, 'evals-only') }}
run: |
cd "$GITHUB_WORKSPACE/inferencex-e2e"
CMD=(
uv run --no-project --exclude-newer PT12H --python 3.12
--with "pydantic>=2" --with pyyaml python -m infx.workflows.validate_perf_changelog
--changelog-file perf-changelog.yaml
--base-ref "origin/${GITHUB_BASE_REF}"
--head-ref "${PR_HEAD_SHA}"
)
if [ "$ALL_EVALS" = "true" ]; then
CMD+=(--all-evals)
fi
if [ "$EVALS_ONLY" = "true" ]; then
CMD+=(--evals-only)
fi
"${CMD[@]}"
reuse-sweep-gate:
name: reuse-sweep-gate
needs: check-changelog
runs-on: ubuntu-latest
permissions:
actions: read # Read workflow runs and artifacts.
contents: read
issues: read # Read issue comments.
pull-requests: read # Read PR metadata.
if: >-
always() &&
needs.check-changelog.result == 'success' &&
github.event.action == 'synchronize' &&
!contains(github.event.pull_request.labels.*.name, 'evals-only') &&
!contains(github.event.pull_request.labels.*.name, 'agentx-fast')
outputs:
skip-pr-sweep: ${{ steps.gate.outputs.skip-pr-sweep }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check for reusable sweep authorization
id: gate
env:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ github.token }}
EVENT_ACTION: ${{ github.event.action }}
run: |
python3 -m infx.workflows.reuse \
--repo "${GITHUB_REPOSITORY}" \
--commit-sha "${PR_HEAD_SHA}" \
--event-name "${GITHUB_EVENT_NAME}" \
--event-action "${EVENT_ACTION}" \
--pr-number "${PR_NUMBER}" \
--ref "${GITHUB_REF}" \
--workflow-id "run-sweep.yml"
setup:
name: setup
needs: [check-changelog, reuse-sweep-gate]
runs-on: ubuntu-latest
permissions:
actions: read # Read workflow runs and artifacts.
contents: read
issues: read # Read issue comments.
pull-requests: read # Read PR metadata.
if: >-
always() &&
needs.check-changelog.result == 'success' &&
(
needs.reuse-sweep-gate.result == 'skipped' ||
(
needs.reuse-sweep-gate.result == 'success' &&
needs.reuse-sweep-gate.outputs.skip-pr-sweep != 'true'
)
) &&
github.event.pull_request.head.repo.full_name == github.repository &&
needs.check-changelog.outputs.skip-pr-sweep != 'true' &&
(
contains(github.event.pull_request.labels.*.name, 'full-sweep-enabled') ||
contains(github.event.pull_request.labels.*.name, 'non-canary-full-sweep-enabled') ||
contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast')
) &&
(
(github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
github.event.label.name == 'full-sweep-enabled' ||
github.event.label.name == 'non-canary-full-sweep-enabled' ||
github.event.label.name == 'full-sweep-fail-fast' ||
github.event.label.name == 'all-evals' ||
github.event.label.name == 'evals-only' ||
github.event.label.name == 'agentx-fast'
)
outputs:
tooling-ref: ${{ steps.tooling.outputs.result }}
search-space-config: ${{ steps.setup.outputs.search-space-config }}
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Resolve workflow tooling
id: tooling
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
CHECKOUT_SHA: ${{ steps.checkout.outputs.commit }}
with:
result-encoding: string
script: |
const { data } = await github.rest.repos.getCommit({
...context.repo, ref: context.payload.repository.default_branch,
});
await core.summary.addHeading('Revisions', 2).addTable([
['Setup checkout', process.env.CHECKOUT_SHA],
['infx tooling', data.sha],
]).write();
return data.sha;
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Install Claude Code 2.1.282
id: claude_cli
if: vars.PRIORITY_SCHEDULER_ENABLED == 'true'
run: | # zizmor: ignore[adhoc-packages] Claude CLI and its native packages are pinned to 2.1.282
npm install --prefix "$RUNNER_TEMP/claude-code" --no-audit --no-fund @anthropic-ai/claude-code@2.1.282
claude_cli="$RUNNER_TEMP/claude-code/node_modules/.bin/claude"
test "$("$claude_cli" --version)" = "2.1.282 (Claude Code)"
echo "path=$claude_cli" >> "$GITHUB_OUTPUT"
- name: Classify priority criteria
id: classify
if: vars.PRIORITY_SCHEDULER_ENABLED == 'true'
continue-on-error: true
uses: anthropics/claude-code-action@9171db3e57d6a3140a37ddc2ba92788584e0ead6 # v1.0.234
with:
path_to_claude_code_executable: ${{ steps.claude_cli.outputs.path }}
github_token: ${{ github.token }}
# Repository integration credential for the scoped sweep/ingest job.
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} # zizmor: ignore[secrets-outside-env]
track_progress: false
settings: |
{"fastMode": true}
claude_args: |
--model 'claude-opus-5-5'
--effort low
--max-turns 8
--allowedTools "Read,Glob,Grep,Bash(git diff:*)"
--json-schema '{"type":"object","properties":{"criteria":{"type":"array","items":{"type":"string","enum":["multi-node","agentic","eval-only","fp4","mtp","eagle","eagle3","sglang","vllm","dynamo-sglang","dynamo-vllm","kimik3","dsv4","minimaxm3","qwen3.5","dsr1","checklist-complete","patchwork"]},"uniqueItems":true},"reason":{"type":"string"}},"required":["criteria","reason"]}'
prompt: |
Inspect this pull request's diff against its base branch.
Return every matching priority criterion:
- multi-node: separate prefill and decode workers
- agentic: agentic-coding or AgentX workload
- eval-only: evaluation without throughput measurement
- fp4: FP4 precision
- mtp, eagle, eagle3: speculative decoding method
- sglang, vllm, dynamo-vllm: runtime framework
- model criterion: matching configured model family
- checklist-complete: PR checklist is satisfied
- patchwork: modified upstream engine or runtime source
Patchwork includes patch files, git apply, source mutation,
monkey-patching, local engine builds, forks, or images
containing unmerged engine changes.
Return a concise reason grounded in the diff.
- name: Normalize priority classification
id: priority-criteria
if: vars.PRIORITY_SCHEDULER_ENABLED == 'true' && always()
env:
OUTPUT: ${{ steps.classify.outputs.structured_output || '{}' }}
run: |
if jq -e 'type == "object" and (.criteria | type == "array")' \
>/dev/null <<<"$OUTPUT"; then
criteria=$(jq -c '.criteria' <<<"$OUTPUT")
else
criteria='["patchwork"]'
fi
echo "criteria=$criteria" >> "$GITHUB_OUTPUT"
echo "Priority criteria: $criteria"
- id: setup
env:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PRIORITY_CRITERIA: ${{ steps.priority-criteria.outputs.criteria || '' }}
ALL_EVALS: ${{ contains(github.event.pull_request.labels.*.name, 'all-evals') }}
EVALS_ONLY: ${{ contains(github.event.pull_request.labels.*.name, 'evals-only') }}
run: |
cd "$GITHUB_WORKSPACE/inferencex-e2e"
CMD=(
uv run --no-project --exclude-newer PT12H --python 3.12 --with pydantic --with pyyaml \
python -m infx.matrix.plan
--changelog-file "${GITHUB_WORKSPACE}/inferencex-e2e/perf-changelog.yaml"
--base-ref "origin/${GITHUB_BASE_REF}"
--head-ref "${PR_HEAD_SHA}"
)
if [ "$ALL_EVALS" = "true" ]; then
CMD+=(--all-evals)
fi
if [ "$EVALS_ONLY" = "true" ]; then
CMD+=(--evals-only)
fi
CONFIG_JSON=$("${CMD[@]}")
CONFIG_JSON=$(printf '%s' "$CONFIG_JSON" | uv run --no-project --exclude-newer PT12H --python 3.12 --with pydantic --with pyyaml \
python -m infx.workflows.benchmark_schema --plan)
CONFIG_JSON=$(printf '%s' "$CONFIG_JSON" | uv run --no-project --exclude-newer PT12H --python 3.12 --with pyyaml \
python -m infx.workflows.ci_priority \
--event-name "${GITHUB_EVENT_NAME}" \
--queue-namespace "${GITHUB_RUN_ID}:${GITHUB_RUN_ATTEMPT}" \
--criteria-json "$PRIORITY_CRITERIA")
echo "search-space-config=$CONFIG_JSON" >> "$GITHUB_OUTPUT"
canary-select:
name: canary-select
needs: setup
if: >-
(
contains(github.event.pull_request.labels.*.name, 'full-sweep-enabled') ||
contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast')
)
runs-on: ubuntu-latest
outputs:
canary-config: ${{ steps.pick.outputs.canary-config }}
multi-node-canary-config: ${{ steps.pick.outputs.multi-node-canary-config }}
remaining-search-space-config: ${{ steps.pick.outputs.remaining-search-space-config }}
steps:
- id: pick
env:
SEARCH_SPACE: ${{ needs.setup.outputs.search-space-config }}
run: |
selection=$(jq -c '
def remove_one($needle):
if $needle == null then .
else
(index($needle)) as $idx
| if $idx == null then . else del(.[$idx]) end
end;
# Canary is a benchmark-only smoke test — exclude entries
# whose primary purpose is eval (run-eval == true) so the
# picked canary never runs an eval pass.
(((.single_node["1k1k"] // []) + (.single_node["8k1k"] // []) + (.single_node.agentic // []))
| map(select(.["run-eval"] != true))) as $single_candidates
| ((.multi_node.agentic // []) | map(select(.["run-eval"] != true))) as $multi_candidates
| (if ($single_candidates | length) == 0 then null else ($single_candidates | min_by(.conc)) end) as $canary
| (if $canary != null or ($multi_candidates | length) == 0 then null
else ($multi_candidates | min_by(.conc[0])) end) as $multi_canary
| {
canary: (if $canary == null then [] else [$canary] end),
multi_node_canary: (if $multi_canary == null then [] else [$multi_canary] end),
remaining: (
.
| .single_node = (.single_node // {})
| .single_node["1k1k"] = ((.single_node["1k1k"] // []) | remove_one($canary))
| .single_node["8k1k"] = ((.single_node["8k1k"] // []) | remove_one($canary))
| .single_node.agentic = ((.single_node.agentic // []) | remove_one($canary))
| .multi_node = (.multi_node // {})
| .multi_node.agentic = ((.multi_node.agentic // []) | remove_one($multi_canary))
)
}
' <<<"$SEARCH_SPACE")
{
echo "canary-config=$(jq -c '.canary' <<<"$selection")"
echo "multi-node-canary-config=$(jq -c '.multi_node_canary' <<<"$selection")"
echo "remaining-search-space-config=$(jq -c '.remaining' <<<"$selection")"
} >> "$GITHUB_OUTPUT"
canary-sweep:
needs: canary-select
if: ${{ needs.canary-select.outputs.canary-config != '' && needs.canary-select.outputs.canary-config != '[]' }}
uses: $/.github/workflows/benchmark-tmpl.yml
name: canary /
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.canary-select.outputs.canary-config) }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
# Only same-repository PRs owned by Klaud receive background priority.
klaud-run: &klaud-run ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login == 'Klaud-Cold' && (startsWith(github.head_ref, 'klaud/auto-') || startsWith(github.head_ref, 'klaude/auto-')) }}
runner: ${{ matrix.config.runner }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
dp-attn: ${{ matrix.config.dp-attn }}
run-eval: false
scenario-type: ${{ matrix.config['scenario-type'] || 'fixed-seq-len' }}
duration: ${{ matrix.config.duration || '3600' }}
agentx-fast: ${{ contains(github.event.pull_request.labels.*.name, 'agentx-fast') }}
canary-multi-node-sweep:
needs: canary-select
if: ${{ needs.canary-select.outputs.multi-node-canary-config != '' && needs.canary-select.outputs.multi-node-canary-config != '[]' }}
uses: $/.github/workflows/benchmark-multinode-tmpl.yml
name: multi-node canary /
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.canary-select.outputs.multi-node-canary-config) }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
node-count: ${{ matrix.config.node-count }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
conc-list: ${{ toJson(matrix.config.conc) }}
conc: ${{ matrix.config.conc[0] }}
total-cpu-dram-gb: ${{ matrix.config['total-cpu-dram-gb'] }}
duration: ${{ matrix.config.duration }}
run-eval: false
scenario-type: agentic-coding
agentx-fast: ${{ contains(github.event.pull_request.labels.*.name, 'agentx-fast') }}
sweep-multi-node-1k1k:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson(needs.setup.outputs.search-space-config).multi_node['1k1k']) != 'null'
}}
uses: $/.github/workflows/benchmark-multinode-tmpl.yml
name: multi-node 1k1k /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson(needs.setup.outputs.search-space-config).multi_node['1k1k'] }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with: &multi-node-inputs
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
node-count: ${{ matrix.config.node-count }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
require-power: ${{ matrix.config['require-power'] == true && matrix.config['eval-only'] != true }}
conc-list: ${{ toJson(matrix.config.conc) }}
run-eval: false
sweep-multi-node-8k1k:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson(needs.setup.outputs.search-space-config).multi_node['8k1k']) != 'null'
}}
uses: $/.github/workflows/benchmark-multinode-tmpl.yml
name: multi-node 8k1k /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson(needs.setup.outputs.search-space-config).multi_node['8k1k'] }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with: *multi-node-inputs
sweep-single-node-1k1k:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['1k1k']) != 'null' &&
toJson(fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['1k1k']) != '[]'
}}
uses: $/.github/workflows/benchmark-tmpl.yml
name: single-node 1k1k /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['1k1k'] }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with: &single-node-inputs
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
dp-attn: ${{ matrix.config.dp-attn }}
run-eval: ${{ matrix.config.run-eval }}
sweep-single-node-8k1k:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['8k1k']) != 'null' &&
toJson(fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['8k1k']) != '[]'
}}
uses: $/.github/workflows/benchmark-tmpl.yml
name: single-node 8k1k /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['8k1k'] }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with: *single-node-inputs
sweep-agentic:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['agentic']) != 'null' &&
toJson(fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['agentic']) != '[]'
}}
uses: $/.github/workflows/benchmark-tmpl.yml
name: agentic /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson((needs.canary-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).single_node['agentic'] }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
dp-attn: ${{ matrix.config.dp-attn }}
duration: ${{ matrix.config.duration }}
run-eval: false
scenario-type: agentic-coding
agentx-fast: ${{ contains(github.event.pull_request.labels.*.name, 'agentx-fast') }}
sweep-multi-node-agentic:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson((needs.canary-multi-node-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).multi_node['agentic']) != 'null' &&
toJson(fromJson((needs.canary-multi-node-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).multi_node['agentic']) != '[]'
}}
uses: $/.github/workflows/benchmark-multinode-tmpl.yml
name: multi-node agentic /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson((needs.canary-multi-node-sweep.result == 'success' && needs.canary-select.outputs.remaining-search-space-config) || needs.setup.outputs.search-space-config).multi_node['agentic'] }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
node-count: ${{ matrix.config.node-count }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
conc-list: ${{ toJson(matrix.config.conc) }}
conc: ${{ matrix.config.conc[0] }}
total-cpu-dram-gb: ${{ matrix.config['total-cpu-dram-gb'] }}
duration: ${{ matrix.config.duration }}
run-eval: false
scenario-type: agentic-coding
agentx-fast: ${{ contains(github.event.pull_request.labels.*.name, 'agentx-fast') }}
sweep-evals:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson(needs.setup.outputs.search-space-config).evals) != '[]' &&
toJson(fromJson(needs.setup.outputs.search-space-config).evals) != 'null'
}}
uses: $/.github/workflows/benchmark-tmpl.yml
name: eval /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson(needs.setup.outputs.search-space-config).evals }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
dp-attn: ${{ matrix.config.dp-attn }}
eval-framework: ${{ matrix.config['eval-framework'] || 'lm-eval' }}
eval-suite: ${{ matrix.config['eval-suite'] || '' }}
run-eval: true
eval-only: true
# Agentic GSM8K eval rows carry the agentic input shape, so they are
# dispatched with sweep-agentic's inputs rather than sweep-evals' fixed-seq-len
# inputs (isl/osl/max-model-len, which agentic rows don't have).
sweep-agentic-evals:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson(needs.setup.outputs.search-space-config).agentic_evals) != '[]' &&
toJson(fromJson(needs.setup.outputs.search-space-config).agentic_evals) != 'null'
}}
uses: $/.github/workflows/benchmark-tmpl.yml
name: agentic eval /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson(needs.setup.outputs.search-space-config).agentic_evals }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
dp-attn: ${{ matrix.config.dp-attn }}
duration: ${{ matrix.config.duration }}
eval-framework: ${{ matrix.config['eval-framework'] || 'lm-eval' }}
eval-suite: ${{ matrix.config['eval-suite'] || '' }}
run-eval: true
eval-only: true
scenario-type: agentic-coding
sweep-multi-node-evals:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson(needs.setup.outputs.search-space-config).multinode_evals) != '[]' &&
toJson(fromJson(needs.setup.outputs.search-space-config).multinode_evals) != 'null'
}}
uses: $/.github/workflows/benchmark-multinode-tmpl.yml
name: multi-node eval /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson(needs.setup.outputs.search-space-config).multinode_evals }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
node-count: ${{ matrix.config.node-count }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
conc-list: ${{ toJson(matrix.config.conc) }}
eval-framework: ${{ matrix.config['eval-framework'] || 'lm-eval' }}
eval-suite: ${{ matrix.config['eval-suite'] || '' }}
run-eval: true
eval-only: true
eval-conc: ${{ (matrix.config['eval-framework'] || 'lm-eval') == 'lm-eval' && matrix.config['eval-all-concs'] && join(matrix.config.conc, ' ') || matrix.config['eval-conc'] }}
# Multi-node agentic GSM8K eval rows carry the agentic input shape, so
# they are dispatched with sweep-multi-node-agentic's inputs rather than
# sweep-multi-node-evals' fixed-seq-len inputs (isl/osl/max-model-len,
# which agentic rows don't have). Agentic selection uses one highest
# eval-conc per topology; fixed-sequence --all-evals rows may instead pass
# a joined concurrency list to lm-eval.
sweep-multi-node-agentic-evals:
needs: [setup, canary-select, canary-sweep, canary-multi-node-sweep]
if: >-
${{
!cancelled() &&
needs.setup.result == 'success' &&
(needs.canary-sweep.result == 'success' || needs.canary-sweep.result == 'skipped') &&
(needs.canary-multi-node-sweep.result == 'success' || needs.canary-multi-node-sweep.result == 'skipped') &&
toJson(fromJson(needs.setup.outputs.search-space-config).multinode_agentic_evals) != '[]' &&
toJson(fromJson(needs.setup.outputs.search-space-config).multinode_agentic_evals) != 'null'
}}
uses: $/.github/workflows/benchmark-multinode-tmpl.yml
name: multi-node agentic eval /
strategy:
fail-fast: ${{ contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast') }}
matrix:
config: ${{ fromJson(needs.setup.outputs.search-space-config).multinode_agentic_evals }}
secrets:
INFERENCEX_OFFICIAL_RO_HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
with:
config: ${{ toJSON(matrix.config) }}
klaud-run: *klaud-run
runner: ${{ matrix.config.runner }}
node-count: ${{ matrix.config.node-count }}
priority: ${{ matrix.config.priority }}
queue-token: ${{ matrix.config['queue-token'] }}
conc-list: ${{ format('[{0}]', matrix.config['eval-conc']) }}
conc: ${{ matrix.config['eval-conc'] }}
total-cpu-dram-gb: ${{ matrix.config['total-cpu-dram-gb'] }}
duration: ${{ matrix.config.duration }}
eval-framework: ${{ matrix.config['eval-framework'] || 'lm-eval' }}
eval-suite: ${{ matrix.config['eval-suite'] || '' }}
run-eval: true
eval-only: true
eval-conc: ${{ matrix.config['eval-conc'] }}
scenario-type: agentic-coding
collect-results:
name: collect-results
needs:
[
canary-sweep,
canary-multi-node-sweep,
sweep-single-node-1k1k,
sweep-single-node-8k1k,
sweep-agentic,
sweep-multi-node-1k1k,
sweep-multi-node-8k1k,
sweep-multi-node-agentic,
setup,
]
if: >-
${{
always() &&
needs.setup.result == 'success' &&
(
needs.canary-sweep.result == 'success' ||
needs.canary-multi-node-sweep.result == 'success' ||
needs.sweep-single-node-1k1k.result != 'skipped' ||
needs.sweep-single-node-8k1k.result != 'skipped' ||
needs.sweep-multi-node-1k1k.result != 'skipped' ||
needs.sweep-multi-node-8k1k.result != 'skipped'
)
}}
uses: $/.github/workflows/collect-results.yml
with:
result-prefix: "bmk"
tooling-ref: ${{ needs.setup.outputs.tooling-ref }}
collect-evals:
name: collect-evals
needs: [sweep-evals, sweep-agentic-evals, sweep-multi-node-evals, sweep-multi-node-agentic-evals, setup]
if: ${{ always() && needs.setup.result != 'skipped' && (needs.sweep-evals.result != 'skipped' || needs.sweep-agentic-evals.result != 'skipped' || needs.sweep-multi-node-evals.result != 'skipped' || needs.sweep-multi-node-agentic-evals.result != 'skipped') }}
uses: $/.github/workflows/collect-evals.yml
with:
tooling-ref: ${{ needs.setup.outputs.tooling-ref }}
upload-changelog-metadata:
name: upload-changelog-metadata
needs: [setup, collect-results]
if: ${{ always() && needs.setup.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Extract and save changelog metadata
env:
SWEEP_MATRIX: ${{ needs.setup.outputs.search-space-config }}
SWEEP_HEAD: ${{ github.event.pull_request.head.sha }}
SWEEP_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
python3 - <<'PY'
import json, os
from pathlib import Path
matrix = json.loads(os.environ['SWEEP_MATRIX'])
labels = set(json.loads(os.environ['SWEEP_LABELS']) or [])
sweep_labels = labels & {
'full-sweep-enabled', 'non-canary-full-sweep-enabled',
'full-sweep-fail-fast',
'all-evals', 'evals-only', 'agentx-fast',
}
Path('changelog_metadata.json').write_text(json.dumps(matrix['changelog_metadata']))
Path('sweep_manifest.json').write_text(json.dumps({
'head': os.environ['SWEEP_HEAD'], 'run-id': int(os.environ['GITHUB_RUN_ID']),
'run-attempt': int(os.environ['GITHUB_RUN_ATTEMPT']),
'full-sweep': sweep_labels in (
{'full-sweep-fail-fast'}, {'full-sweep-enabled'},
),
'matrix': matrix,
}))
PY
- name: Upload changelog artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: changelog-metadata
path: changelog_metadata.json
- name: Upload Klaud validation manifest
if: *klaud-run
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: klaud-sweep-manifest
path: sweep_manifest.json
if-no-files-found: error
calc-success-rate:
name: calc-success-rate
needs: [setup, collect-results]
if: ${{ always() && needs.collect-results.result != 'skipped'}}
runs-on: ubuntu-latest
permissions:
actions: read # Read job timings for run statistics.
contents: read
env:
RESULTS_DIR: "results/"
STATS_FILENAME: "run_stats"
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.setup.outputs.tooling-ref }}
fetch-depth: 1
persist-credentials: false
- name: Download results artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ${{ env.RESULTS_DIR }}
pattern: results_*
- name: Select Python project
run: |
python_project="$GITHUB_WORKSPACE"
if [[ -f "$python_project/inferencex-e2e/pyproject.toml" ]]; then
python_project="$python_project/inferencex-e2e"
fi
test -f "$python_project/pyproject.toml"
echo "INFERENCEX_PYTHON_PROJECT=$python_project" >> "$GITHUB_ENV"
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
cache-dependency-glob: |
pyproject.toml
uv.lock
inferencex-e2e/pyproject.toml
inferencex-e2e/uv.lock
- name: Calculate success rate
run: >-
uv run --project "$INFERENCEX_PYTHON_PROJECT" --locked --extra workflows
python -m infx.workflows.calc_success_rate "$STATS_FILENAME"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "run-stats"
path: ${{ env.STATS_FILENAME }}.json
compare-results:
name: compare-results
needs:
[
collect-results,
setup,
]
if: >-
always() &&
needs.collect-results.result == 'success'
runs-on: ubuntu-latest
env:
# Repository integration credential for the scoped sweep/ingest job.
DATABASE_URL: ${{ secrets.DB_RO_URL }} # zizmor: ignore[secrets-outside-env]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.setup.outputs.tooling-ref }}
persist-credentials: false
- name: Download results artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: results/
pattern: results_bmk
- name: Select Python project
run: |
python_project="$GITHUB_WORKSPACE"
if [[ -f "$python_project/inferencex-e2e/pyproject.toml" ]]; then
python_project="$python_project/inferencex-e2e"
fi
test -f "$python_project/pyproject.toml"
echo "INFERENCEX_PYTHON_PROJECT=$python_project" >> "$GITHUB_ENV"
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
cache-dependency-glob: |
pyproject.toml
uv.lock
inferencex-e2e/pyproject.toml
inferencex-e2e/uv.lock
- name: Compare results against main
run: >-
uv run --project "$INFERENCEX_PYTHON_PROJECT" --locked --extra results
python -m infx.results.compare_results results/ >> "$GITHUB_STEP_SUMMARY"
comment-unofficial-run-visualizer:
name: comment-unofficial-run-visualizer
needs:
[
collect-results,
collect-evals,
calc-success-rate,
upload-changelog-metadata,
setup,
]
if: >-
always() &&
needs.setup.result == 'success' &&
(
contains(github.event.pull_request.labels.*.name, 'full-sweep-enabled') ||
contains(github.event.pull_request.labels.*.name, 'non-canary-full-sweep-enabled') ||
contains(github.event.pull_request.labels.*.name, 'full-sweep-fail-fast')
) &&
(
(github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
github.event.label.name == 'full-sweep-enabled' ||
github.event.label.name == 'non-canary-full-sweep-enabled' ||
github.event.label.name == 'full-sweep-fail-fast' ||
github.event.label.name == 'all-evals' ||
github.event.label.name == 'evals-only' ||
github.event.label.name == 'agentx-fast'
)
runs-on: ubuntu-latest
concurrency:
group: unofficial-run-visualizer-${{ github.event.pull_request.number }}
cancel-in-progress: false
permissions:
pull-requests: write # Publish PR feedback.
steps:
- name: Update unofficial run visualizer links on PR
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ github.token }}
script: |
const marker = '<!-- inferencex-unofficial-run-visualizer -->';
const inferenceUrl = `https://inferencex.semianalysis.com/inference?unofficialRun=${context.runId}`;
const evaluationUrl = `https://inferencex.semianalysis.com/evaluation?unofficialRun=${context.runId}`;
const body = [
marker,
`View unofficial run (performance): ${inferenceUrl}`,
`View unofficial run (accuracy): ${evaluationUrl}`,
].join('\n\n');
const comments = await github.paginate(github.rest.issues.listComments, {
...context.repo,
issue_number: context.issue.number,
per_page: 100,
});
const botComments = comments.filter(comment => comment.user?.login === 'github-actions[bot]');
const existing = botComments.find(comment => comment.body?.includes(marker))
?? botComments.reverse().find(comment => comment.body?.startsWith(
'see unofficial run visualizer at https://inferencex.semianalysis.com/inference?unofficialRun='
));
if (existing) {
const previousRunId = existing.body.match(/unofficialRun=(\d+)/)?.[1];
if (previousRunId && Number(previousRunId) > context.runId) {
core.info('Keeping visualizer links for the newer run.');
return;
}
await github.rest.issues.updateComment({
...context.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
...context.repo,
issue_number: context.issue.number,
body,
});
}