Skip to content

Commit 06afb6c

Browse files
[Fix] Thinker Input Length Check with Parameter Passing (#330)
Co-authored-by: zhaochenyang20 <zhaochen20@outlook.com>
1 parent d892e1a commit 06afb6c

13 files changed

Lines changed: 556 additions & 187 deletions

File tree

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Omni Post-Stage
2+
description: >
3+
Shared teardown for Omni CI stages. Prints matching result JSON files to
4+
the log (optionally summary-only), uploads them as workflow artifacts,
5+
and always reclaims the GPU by killing leftover processes.
6+
7+
inputs:
8+
stage-label:
9+
description: Human-readable label used in the log banner (e.g. "MMMU", "TTS").
10+
required: true
11+
artifact-search-root:
12+
description: >
13+
Directory that `find` descends into when resolving `artifact-path-globs`.
14+
Qwen3-Omni tests write to `/tmp` via pytest `tmp_path`; S2-Pro tests
15+
write under `stage-results/<name>/` inside `$GITHUB_WORKSPACE`. Set
16+
accordingly.
17+
required: false
18+
default: "/tmp"
19+
artifact-path-globs:
20+
description: >
21+
Newline-separated `find -path` globs (matched against the full path
22+
starting from `artifact-search-root`). Leave empty to skip artifact
23+
printing.
24+
required: false
25+
default: ""
26+
artifact-upload-name:
27+
description: >
28+
If set, uploads files matching `artifact-upload-path` as a workflow
29+
artifact under this name. Must be unique across the workflow run.
30+
required: false
31+
default: ""
32+
artifact-upload-path:
33+
description: >
34+
Path or glob that `actions/upload-artifact` uploads when
35+
`artifact-upload-name` is set. Required whenever `artifact-upload-name`
36+
is provided — there is deliberately no default, since the right scope
37+
(pytest `tmp_path` tree vs. workspace subdir) is stage-specific.
38+
required: false
39+
default: ""
40+
artifact-if-no-files-found:
41+
description: >
42+
Behavior when the upload path matches nothing. Use "error" for stages
43+
whose artifacts are required by downstream jobs; "ignore" otherwise.
44+
required: false
45+
default: "ignore"
46+
summary-only:
47+
description: >
48+
When "true", strips the `per_sample` field before printing large result
49+
files to the log. The uploaded artifact still contains the full data.
50+
required: false
51+
default: "false"
52+
53+
runs:
54+
using: composite
55+
steps:
56+
- name: Collect matching result files
57+
id: collect
58+
if: ${{ inputs.artifact-path-globs != '' }}
59+
shell: bash
60+
env:
61+
ARTIFACT_SEARCH_ROOT: ${{ inputs.artifact-search-root }}
62+
ARTIFACT_PATH_GLOBS: ${{ inputs.artifact-path-globs }}
63+
run: |
64+
matches_file="$(mktemp)"
65+
if [ ! -d "${ARTIFACT_SEARCH_ROOT}" ]; then
66+
echo "(search root ${ARTIFACT_SEARCH_ROOT} does not exist)"
67+
else
68+
while IFS= read -r pattern; do
69+
[ -z "$pattern" ] && continue
70+
find "${ARTIFACT_SEARCH_ROOT}" -path "$pattern" 2>/dev/null >> "$matches_file" || true
71+
done <<< "$ARTIFACT_PATH_GLOBS"
72+
sort -u "$matches_file" -o "$matches_file"
73+
fi
74+
echo "matches_file=${matches_file}" >> "$GITHUB_OUTPUT"
75+
echo "match_count=$(wc -l < "$matches_file")" >> "$GITHUB_OUTPUT"
76+
77+
- name: Print CI artifacts
78+
if: ${{ inputs.artifact-path-globs != '' }}
79+
shell: bash
80+
env:
81+
STAGE_LABEL: ${{ inputs.stage-label }}
82+
SUMMARY_ONLY: ${{ inputs.summary-only }}
83+
MATCHES_FILE: ${{ steps.collect.outputs.matches_file }}
84+
MATCH_COUNT: ${{ steps.collect.outputs.match_count }}
85+
run: |
86+
echo "=== ${STAGE_LABEL} CI results (${MATCH_COUNT} file(s)) ==="
87+
if [ "${MATCH_COUNT}" = "0" ]; then
88+
echo "(no matching result files found)"
89+
exit 0
90+
fi
91+
while IFS= read -r f; do
92+
echo "--- $f ---"
93+
if [ "$SUMMARY_ONLY" = "true" ]; then
94+
python -c "import json,sys; d=json.load(open(sys.argv[1])); d.pop('per_sample',None); print(json.dumps(d, indent=2, ensure_ascii=False))" "$f"
95+
else
96+
cat "$f"
97+
fi
98+
echo ""
99+
done < "${MATCHES_FILE}"
100+
101+
- name: Validate upload inputs
102+
if: ${{ inputs.artifact-upload-name != '' && inputs.artifact-upload-path == '' }}
103+
shell: bash
104+
run: |
105+
echo "::error::artifact-upload-name='${{ inputs.artifact-upload-name }}' requires artifact-upload-path to be set explicitly."
106+
exit 1
107+
108+
- name: Upload CI artifacts
109+
if: ${{ inputs.artifact-upload-name != '' && inputs.artifact-upload-path != '' }}
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: ${{ inputs.artifact-upload-name }}
113+
path: ${{ inputs.artifact-upload-path }}
114+
if-no-files-found: ${{ inputs.artifact-if-no-files-found }}
115+
retention-days: 7
116+
117+
- name: Kill GPU processes
118+
shell: bash
119+
run: |
120+
bash .github/scripts/delete_gpu_process.sh

.github/workflows/test-qwen3-omni-ci.yaml

Lines changed: 102 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ concurrency:
1212
permissions:
1313
contents: read
1414

15+
# DAG:
16+
# docs ──► stage-1-thinker ──► stage-2-tts
17+
# ├─► stage-3-mmmu
18+
# ├─► stage-4-mmmu-tts-consistency
19+
# ├─► stage-5-mmsu
20+
# └─► stage-6-mmsu-tts-consistency
21+
1522
jobs:
1623
docs:
1724
name: docs
@@ -38,11 +45,11 @@ jobs:
3845
env:
3946
HF_ENDPOINT: https://hf-mirror.com
4047

41-
- name: Kill GPU processes
48+
- name: Post-stage cleanup
4249
if: always()
43-
shell: bash
44-
run: |
45-
bash .github/scripts/delete_gpu_process.sh
50+
uses: ./.github/actions/omni-post-stage
51+
with:
52+
stage-label: docs
4653

4754
- name: Save cache
4855
if: always()
@@ -55,10 +62,41 @@ jobs:
5562
echo "::warning::Skipping cache save — venv appears corrupted (torch not importable)"
5663
fi
5764
58-
stage-1-tts:
59-
name: stage 1 - TTS speed + WER
65+
stage-1-thinker:
66+
name: stage 1 - thinker length integration
6067
needs: docs
6168
runs-on: [self-hosted]
69+
timeout-minutes: 20
70+
container:
71+
image: frankleeeee/sglang-omni:dev
72+
options: --gpus all --rm -v /dev/shm:/dev/shm
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
76+
77+
- uses: ./.github/actions/omni-setup
78+
with:
79+
venv-name: omni-qwen3
80+
81+
- name: Run thinker length integration test
82+
shell: bash
83+
run: |
84+
source omni-qwen3/bin/activate
85+
export PYTHONPATH=$PWD
86+
pytest tests/test_model/test_qwen3_omni_thinker_length.py -v -s -x
87+
env:
88+
HF_ENDPOINT: https://hf-mirror.com
89+
90+
- name: Post-stage cleanup
91+
if: always()
92+
uses: ./.github/actions/omni-post-stage
93+
with:
94+
stage-label: thinker-length
95+
96+
stage-2-tts:
97+
name: stage 2 - TTS speed + WER
98+
needs: [docs, stage-1-thinker]
99+
runs-on: [self-hosted]
62100
timeout-minutes: 15
63101
container:
64102
image: frankleeeee/sglang-omni:dev
@@ -81,26 +119,20 @@ jobs:
81119
HF_ENDPOINT: https://hf-mirror.com
82120
SGLANG_SEEDTTS_MINI_DIR: /github/home/seedtts-mini
83121

84-
- name: Print TTS CI artifacts (speed + WER)
122+
- name: Post-stage cleanup
85123
if: always()
86-
shell: bash
87-
run: |
88-
echo "=== Qwen3-Omni TTS CI results ==="
89-
for f in $(find /tmp -name "speed_results.json" -o -name "wer_results.json" 2>/dev/null); do
90-
echo "--- $f ---"
91-
cat "$f"
92-
echo ""
93-
done
94-
95-
- name: Kill GPU processes
96-
if: always()
97-
shell: bash
98-
run: |
99-
bash .github/scripts/delete_gpu_process.sh
100-
101-
stage-2-mmmu:
102-
name: stage 2 - MMMU accuracy + speed
103-
needs: stage-1-tts
124+
uses: ./.github/actions/omni-post-stage
125+
with:
126+
stage-label: TTS (speed + WER)
127+
artifact-path-globs: |
128+
*/speed_results.json
129+
*/wer_results.json
130+
artifact-upload-name: qwen3-omni-tts-results
131+
artifact-upload-path: /tmp/**/*_results.json
132+
133+
stage-3-mmmu:
134+
name: stage 3 - MMMU accuracy + speed
135+
needs: [docs, stage-1-thinker]
104136
runs-on: [self-hosted]
105137
timeout-minutes: 20
106138
container:
@@ -123,26 +155,19 @@ jobs:
123155
env:
124156
HF_ENDPOINT: https://hf-mirror.com
125157

126-
- name: Print MMMU CI artifacts (accuracy + speed)
127-
if: always()
128-
shell: bash
129-
run: |
130-
echo "=== Qwen3-Omni MMMU CI results ==="
131-
for f in $(find /tmp -path '*/mmmu/mmmu_results.json' 2>/dev/null); do
132-
echo "--- $f ---"
133-
cat "$f"
134-
echo ""
135-
done
136-
137-
- name: Kill GPU processes
158+
- name: Post-stage cleanup
138159
if: always()
139-
shell: bash
140-
run: |
141-
bash .github/scripts/delete_gpu_process.sh
142-
143-
stage-3-mmmu-tts-consistency:
144-
name: stage 3 - MMMU TTS consistency
145-
needs: stage-2-mmmu
160+
uses: ./.github/actions/omni-post-stage
161+
with:
162+
stage-label: MMMU (accuracy + speed)
163+
artifact-path-globs: |
164+
*/mmmu/mmmu_results.json
165+
artifact-upload-name: qwen3-omni-mmmu-results
166+
artifact-upload-path: /tmp/**/mmmu_results.json
167+
168+
stage-4-mmmu-tts-consistency:
169+
name: stage 4 - MMMU TTS consistency
170+
needs: [docs, stage-1-thinker]
146171
runs-on: [self-hosted]
147172
timeout-minutes: 15
148173
container:
@@ -165,26 +190,19 @@ jobs:
165190
env:
166191
HF_ENDPOINT: https://hf-mirror.com
167192

168-
- name: Print MMMU TTS Consistency CI artifacts (WER + speed)
169-
if: always()
170-
shell: bash
171-
run: |
172-
echo "=== Qwen3-Omni MMMU TTS Consistency CI results ==="
173-
for f in $(find /tmp -path '*/mmmu_audio/mmmu_results.json' 2>/dev/null); do
174-
echo "--- $f ---"
175-
cat "$f"
176-
echo ""
177-
done
178-
179-
- name: Kill GPU processes
193+
- name: Post-stage cleanup
180194
if: always()
181-
shell: bash
182-
run: |
183-
bash .github/scripts/delete_gpu_process.sh
184-
185-
stage-4-mmsu:
186-
name: stage 4 - MMSU accuracy + speed
187-
needs: stage-3-mmmu-tts-consistency
195+
uses: ./.github/actions/omni-post-stage
196+
with:
197+
stage-label: MMMU TTS Consistency (WER + speed)
198+
artifact-path-globs: |
199+
*/mmmu_audio/mmmu_results.json
200+
artifact-upload-name: qwen3-omni-mmmu-tts-consistency-results
201+
artifact-upload-path: /tmp/**/mmmu_audio/mmmu_results.json
202+
203+
stage-5-mmsu:
204+
name: stage 5 - MMSU accuracy + speed
205+
needs: [docs, stage-1-thinker]
188206
runs-on: [self-hosted]
189207
timeout-minutes: 20
190208
container:
@@ -207,27 +225,20 @@ jobs:
207225
env:
208226
HF_ENDPOINT: https://hf-mirror.com
209227

210-
- name: Print MMSU CI artifacts (accuracy + speed)
211-
if: always()
212-
shell: bash
213-
run: |
214-
source omni-qwen3/bin/activate
215-
echo "=== Qwen3-Omni MMSU CI results (summary only) ==="
216-
for f in $(find /tmp -path '*/mmsu/mmsu_results.json' 2>/dev/null); do
217-
echo "--- $f ---"
218-
python -c "import json,sys; d=json.load(open(sys.argv[1])); d.pop('per_sample',None); print(json.dumps(d, indent=2, ensure_ascii=False))" "$f"
219-
echo ""
220-
done
221-
222-
- name: Kill GPU processes
228+
- name: Post-stage cleanup
223229
if: always()
224-
shell: bash
225-
run: |
226-
bash .github/scripts/delete_gpu_process.sh
227-
228-
stage-5-mmsu-tts-consistency:
229-
name: stage 5 - MMSU TTS consistency
230-
needs: stage-4-mmsu
230+
uses: ./.github/actions/omni-post-stage
231+
with:
232+
stage-label: MMSU (accuracy + speed, summary only)
233+
artifact-path-globs: |
234+
*/mmsu/mmsu_results.json
235+
artifact-upload-name: qwen3-omni-mmsu-results
236+
artifact-upload-path: /tmp/**/mmsu/mmsu_results.json
237+
summary-only: "true"
238+
239+
stage-6-mmsu-tts-consistency:
240+
name: stage 6 - MMSU TTS consistency
241+
needs: [docs, stage-1-thinker]
231242
runs-on: [self-hosted]
232243
timeout-minutes: 15
233244
container:
@@ -250,19 +261,12 @@ jobs:
250261
env:
251262
HF_ENDPOINT: https://hf-mirror.com
252263

253-
- name: Print MMSU TTS Consistency CI artifacts (WER + speed)
254-
if: always()
255-
shell: bash
256-
run: |
257-
echo "=== Qwen3-Omni MMSU TTS Consistency CI results ==="
258-
for f in $(find /tmp -path '*/mmsu_audio/mmsu_results.json' 2>/dev/null); do
259-
echo "--- $f ---"
260-
cat "$f"
261-
echo ""
262-
done
263-
264-
- name: Kill GPU processes
264+
- name: Post-stage cleanup
265265
if: always()
266-
shell: bash
267-
run: |
268-
bash .github/scripts/delete_gpu_process.sh
266+
uses: ./.github/actions/omni-post-stage
267+
with:
268+
stage-label: MMSU TTS Consistency (WER + speed)
269+
artifact-path-globs: |
270+
*/mmsu_audio/mmsu_results.json
271+
artifact-upload-name: qwen3-omni-mmsu-tts-consistency-results
272+
artifact-upload-path: /tmp/**/mmsu_audio/mmsu_results.json

0 commit comments

Comments
 (0)