Skip to content

Commit f437b05

Browse files
songCNMSintern_nem_dev_2
andauthored
[task160][intern_nem_dev_2] Pin Omni3 Valor32k QA ZIP revision (#268)
* [task160] Pin Valor32k QA ZIP revision * [task160] Add PR bookkeeping --------- Co-authored-by: intern_nem_dev_2 <intern_nem_dev_2@intern.local>
1 parent 193126b commit f437b05

6 files changed

Lines changed: 157 additions & 5 deletions

File tree

src/nemotron/recipes/omni3/stage0_sft/data_prep.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@
107107
# All knowledge of Valor32k's source layout (URL, tar structure, filename
108108
# convention, QA shape) lives in this file. The shared SFT-Omni recipe
109109
# (nemotron.data_prep.recipes.sft_omni) is generic over these.
110-
VALOR32K_QA_ZIP_URL = "https://github.com/inesriahi/valor32k-avqa-2/raw/refs/heads/main/data.zip"
110+
VALOR32K_QA_ZIP_REVISION = "a1eeb58e16fbe84f43a3886fd72fe61fd208b7b2"
111+
VALOR32K_QA_ZIP_URL = (
112+
"https://github.com/inesriahi/valor32k-avqa-2/raw/"
113+
f"{VALOR32K_QA_ZIP_REVISION}/data.zip"
114+
)
111115
# Valor32k filenames have the form {youtube_id}_{start.sss}_{end.sss}.mp4.
112116
# QA records key by the bare youtube_id, so we strip the timestamp suffix.
113117
_VALOR32K_TS_SUFFIX_RE = re.compile(r"^(.+)_\d+\.\d+_\d+\.\d+$")
@@ -604,6 +608,7 @@ def _run_valor32k_pipeline(
604608
"dataset_path": str(dataset_path),
605609
"raw_dir": str(raw_dir),
606610
"source_tar": str(cfg.source_tar) if cfg.source_tar else None,
611+
"qa_zip_url": cfg.qa_zip_url,
607612
"samples_per_shard": cfg.samples_per_shard,
608613
"sample": cfg.sample,
609614
"split_sample_counts": format_result.split_sample_counts,
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
from __future__ import annotations
2+
3+
import ast
4+
import re
5+
from pathlib import Path
6+
7+
from nemotron.recipes.omni3.stage0_sft.data_prep import (
8+
VALOR32K_QA_ZIP_URL,
9+
Omni3SFTDataPrepConfig,
10+
)
11+
12+
REPO_ROOT = Path(__file__).resolve().parents[3]
13+
DATA_PREP = REPO_ROOT / "src/nemotron/recipes/omni3/stage0_sft/data_prep.py"
14+
EXPECTED_REVISION = "a1eeb58e16fbe84f43a3886fd72fe61fd208b7b2"
15+
EXPECTED_URL = (
16+
"https://github.com/inesriahi/valor32k-avqa-2/raw/"
17+
f"{EXPECTED_REVISION}/data.zip"
18+
)
19+
FLOATING_REF_FRAGMENTS = (
20+
"refs/heads/main",
21+
"/main/",
22+
"refs/heads/master",
23+
"/master/",
24+
)
25+
26+
27+
def _module_tree() -> ast.Module:
28+
return ast.parse(DATA_PREP.read_text(encoding="utf-8"))
29+
30+
31+
def _module_string_constant(tree: ast.Module, name: str) -> str:
32+
for node in tree.body:
33+
if not isinstance(node, ast.Assign):
34+
continue
35+
if not any(isinstance(target, ast.Name) and target.id == name for target in node.targets):
36+
continue
37+
assert isinstance(node.value, ast.Constant)
38+
assert isinstance(node.value.value, str)
39+
return node.value.value
40+
raise AssertionError(f"missing module constant {name}")
41+
42+
43+
def _has_manifest_qa_zip_url_entry(tree: ast.Module) -> bool:
44+
for node in ast.walk(tree):
45+
if not isinstance(node, ast.Dict):
46+
continue
47+
for key, value in zip(node.keys, node.values, strict=True):
48+
if not (isinstance(key, ast.Constant) and key.value == "qa_zip_url"):
49+
continue
50+
if isinstance(value, ast.Attribute) and value.attr == "qa_zip_url":
51+
return True
52+
return False
53+
54+
55+
def test_valor32k_qa_zip_default_is_pinned_to_exact_revision() -> None:
56+
source = DATA_PREP.read_text(encoding="utf-8")
57+
tree = _module_tree()
58+
59+
revision = _module_string_constant(tree, "VALOR32K_QA_ZIP_REVISION")
60+
assert revision == EXPECTED_REVISION
61+
assert re.fullmatch(r"[0-9a-f]{40}", revision)
62+
assert VALOR32K_QA_ZIP_URL == EXPECTED_URL
63+
for fragment in FLOATING_REF_FRAGMENTS:
64+
assert fragment not in VALOR32K_QA_ZIP_URL
65+
assert "refs/heads/main/data.zip" not in source
66+
67+
68+
def test_valor32k_config_uses_pinned_qa_zip_default_without_download() -> None:
69+
assert Omni3SFTDataPrepConfig().qa_zip_url == EXPECTED_URL
70+
71+
72+
def test_valor32k_lineage_records_effective_qa_zip_url() -> None:
73+
source = DATA_PREP.read_text(encoding="utf-8")
74+
tree = _module_tree()
75+
76+
assert "source_uri_parts = [cfg.qa_zip_url]" in source
77+
assert _has_manifest_qa_zip_url_entry(tree)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# intern_nem_dev_2 - 状态
22

3-
<!-- METADATA:STATUS=Working,TASK=task158_nemotron_cc_fasttext_hf_revision_pin_s1,ROLE=independent -->
3+
<!-- METADATA:STATUS=Working,TASK=task160_omni3_valor32k_qa_zip_revision_pin_s1,ROLE=independent -->
44

55
| 字段 ||
66
|------|-----|
77
| Name | intern_nem_dev_2 |
88
| Status | Working |
9-
| Current Task | task158_nemotron_cc_fasttext_hf_revision_pin_s1 |
10-
| PR | https://github.com/songCNMS/Nemotron/pull/265 |
9+
| Current Task | task160_omni3_valor32k_qa_zip_revision_pin_s1 |
10+
| PR | https://github.com/songCNMS/Nemotron/pull/268 |
1111
| Session | 1 |
1212

13-
最近进展:Opened PR #265 for `task158_nemotron_cc_fasttext_hf_revision_pin_s1`: https://github.com/songCNMS/Nemotron/pull/265. Base `0b31358436c38e698c7c2bc3a89871df273df21c`; implementation head before PR bookkeeping `53ee587143f5c596eddd1d464b9e8eb8dfc1cc6e`. Pinned Nemotron-CC FastText `hf_hub_download` to revision `cd8b714a90f2dbcd3b02cf5fc972e5d7c7f4f107` with static/AST coverage only. Checks passed: focused pytest (`1 passed`), py_compile, Ruff, structured static/AST probe, diff checks, and added-line live-surface scan. No live HF download, Nemotron-CC curation run, Ray/Curator pipeline execution, train/eval, endpoint, W&B, cluster, deploy, artifact upload/download, main/master push, or self-merge.
13+
最近进展:Opened PR #268 for `task160_omni3_valor32k_qa_zip_revision_pin_s1`: https://github.com/songCNMS/Nemotron/pull/268. Base `9efec596f0401ab2fbe4909ac54e82be8872ec55`; implementation head before PR bookkeeping `bf8b9e61855fa37f9d08749e99d341d81f1c076d`. Pinned the Omni3 Valor32k QA ZIP default away from floating `refs/heads/main` to exact commit `a1eeb58e16fbe84f43a3886fd72fe61fd208b7b2`, preserved operator overrides, and added focused static/AST tests. Checks passed: focused Valor32k pytest (`13 passed`), py_compile, Ruff, structured static/AST probe, diff checks, and added-line live-surface scan. No live Valor32k QA ZIP download, HF/dataset download, SFT data prep, ffmpeg/audio extraction, train/eval, endpoint, W&B, cluster, deploy, artifact upload/download, main/master push, or self-merge.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# task160_omni3_valor32k_qa_zip_revision_pin_s1
2+
3+
<!-- METADATA:STATUS=ReadyForGate,ASSIGNEE=intern_nem_dev_2 -->
4+
5+
Status: Ready for PM gate
6+
Owner: intern_nem_dev_2
7+
Branch: `intern_nem_dev_2/task160_omni3_valor32k_qa_zip_revision_pin_s1`
8+
Base: `9efec596f0401ab2fbe4909ac54e82be8872ec55`
9+
PR: https://github.com/songCNMS/Nemotron/pull/268
10+
11+
## Summary
12+
13+
Pin the Omni3 Valor32k QA ZIP default URL to the PM-provided upstream commit
14+
instead of the floating `refs/heads/main` ref.
15+
16+
## Scope
17+
18+
- `src/nemotron/recipes/omni3/stage0_sft/data_prep.py`
19+
- Focused static/AST Valor32k tests under `tests/recipes/omni3/`
20+
- Task/status docs for `intern_nem_dev_2`
21+
22+
## Boundaries
23+
24+
- No live Valor32k QA ZIP download, HF/dataset download, SFT data prep,
25+
ffmpeg/audio extraction, train/eval, endpoint, W&B, cluster, deploy,
26+
artifact upload/download, direct `main`/`master` push, or self-merge.
27+
28+
## Acceptance Checks
29+
30+
- PASS: `PYTHONPATH=src /work-agents/.venv/bin/python -m pytest -q tests/recipes/omni3/test_stage0_sft_valor32k_revision_pin.py tests/recipes/omni3/test_stage0_sft_valor_tar_guard.py tests/recipes/omni3/test_stage0_sft_valor32k_config_portability.py` (13 passed)
31+
- PASS: `/work-agents/.venv/bin/python -m py_compile src/nemotron/recipes/omni3/stage0_sft/data_prep.py tests/recipes/omni3/test_stage0_sft_valor32k_revision_pin.py`
32+
- PASS: `/work-agents/.venv/bin/ruff check src/nemotron/recipes/omni3/stage0_sft/data_prep.py tests/recipes/omni3/test_stage0_sft_valor32k_revision_pin.py`
33+
- PASS: structured static/AST QA ZIP probe
34+
- PASS: `git diff --check`
35+
- PASS: `git diff --cached --check`
36+
- PASS: added-line live-surface scan showed static revision pin, manifest metadata, tests, and task/status docs only
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# task160_omni3_valor32k_qa_zip_revision_pin_s1 history
2+
3+
<!-- METADATA:SESSION=1 -->
4+
5+
## Session 1 - 2026-05-29
6+
7+
- Accepted PM assignment and created branch
8+
`intern_nem_dev_2/task160_omni3_valor32k_qa_zip_revision_pin_s1` from
9+
`origin/main` at `9efec596f0401ab2fbe4909ac54e82be8872ec55`.
10+
- Added `VALOR32K_QA_ZIP_REVISION` with PM-provided SHA
11+
`a1eeb58e16fbe84f43a3886fd72fe61fd208b7b2`.
12+
- Changed the default Valor32k QA ZIP URL away from floating
13+
`refs/heads/main` to the exact commit URL.
14+
- Preserved operator `qa_zip_url` overrides and recorded effective
15+
`cfg.qa_zip_url` in both artifact source lineage and staging manifest
16+
metadata.
17+
- Added focused static/AST tests that do not perform a live URL download.
18+
- Verified focused Valor32k pytest (`13 passed`), `py_compile`, Ruff,
19+
structured static/AST QA ZIP probe, `git diff --check`,
20+
`git diff --cached --check`, and added-line live-surface scan.
21+
- Opened PR #268 to `main`: https://github.com/songCNMS/Nemotron/pull/268.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# task160_omni3_valor32k_qa_zip_revision_pin_s1 knowledge
2+
3+
<!-- METADATA:SESSION=1 -->
4+
5+
## Working Notes
6+
7+
- Valor32k QA ZIP revision is
8+
`a1eeb58e16fbe84f43a3886fd72fe61fd208b7b2`.
9+
- Pinned default URL is
10+
`https://github.com/inesriahi/valor32k-avqa-2/raw/a1eeb58e16fbe84f43a3886fd72fe61fd208b7b2/data.zip`.
11+
- Tests must not call `urlopen` or perform live Valor32k/HF downloads.
12+
- Operator `qa_zip_url` overrides remain supported through
13+
`Omni3SFTDataPrepConfig.qa_zip_url`.

0 commit comments

Comments
 (0)