Skip to content

fix(data): honor subset on GSM8KDataset and correct the val-split docs - #3389

Merged
yuki-97 merged 7 commits into
NVIDIA-NeMo:mainfrom
tianyi-zhang-02:fix/gsm8k-subset-and-val-split-docs
Aug 3, 2026
Merged

yuki-97 merged 7 commits into
NVIDIA-NeMo:mainfrom
tianyi-zhang-02:fix/gsm8k-subset-and-val-split-docs

Conversation

@tianyi-zhang-02

Copy link
Copy Markdown
Contributor

What does this PR do ?

Two small follow-ups to the config-key guard merged in #3271.

1. GSM8KDataset now honors subset. It hardcoded the "main" Hugging Face config, so a configured subset was silently ignored — openai/gsm8k also ships a "socratic" config (same questions, answers interleaved with Socratic sub-questions). subset is now threaded to load_dataset, defaulting to "main" so existing behavior is unchanged. This is exactly the example the #3271 guard warns about, so that warning now resolves into working behavior for gsm8k.

2. The split_validation_size docs were stale. Both guides enumerated the supporting datasets, and the lists had drifted:

datasets listed
docs/guides/sft.md 4
docs/guides/grpo.md 5
actually call split_train_validation 12 — arrow_text, audiomcq, avqa, daily_omni, general_conversations, mmpr_tiny, nemotron_cascade2_sft, oasst, openmathinstruct2, openr1_math, response_dataset, tulu3

A reader would wrongly conclude the 7 unlisted datasets can't carve a validation split. Rather than re-listing 12 names that will drift again, the docs now state the rule that determines support (the dataset class calls split_train_validation), keep the common datasets as examples, and note that an unsupported key now warns rather than being silently dropped (#3271).

Issues

Follow-up to #3270 / #3271. No new issue filed — these are small corrections in the same area.

Usage

data:
  train:
    dataset_name: gsm8k
    subset: socratic   # before: silently loaded "main"; after: loads the socratic config

Before your PR is "Ready for review"

  • New tests: test_gsm8k_subset_selects_hf_config (asserts subset reaches load_dataset and answer extraction still works) and test_gsm8k_subset_defaults_to_main (backward compatibility), following the mocked pattern used by the AIME test in the same file.
  • Validation: both cases verified locally against the real loader; ruff check / format --check clean; pyrefly==0.24.2 reports 0 errors on gsm8k.py (it is in project-includes); all doc links resolve.
  • Docs: updated (that's half this PR).

cc @yuki-97 @RayenTian

GSM8KDataset hardcoded the "main" Hugging Face config, so a configured
`subset` was silently ignored — `openai/gsm8k` also ships a "socratic"
config. Thread `subset` through to `load_dataset` (default "main", so
existing behavior is unchanged). This is the example the dispatcher guard
added in NVIDIA-NeMo#3271 warns about, which now resolves for gsm8k.

Also correct the split_validation_size docs. Both guides enumerated the
supporting datasets, but the lists had drifted: sft.md listed 4 and
grpo.md 5, while 12 built-in datasets call split_train_validation today
(arrow_text, audiomcq, avqa, daily_omni, general_conversations,
mmpr_tiny, nemotron_cascade2_sft, oasst, openmathinstruct2, openr1_math,
response_dataset, tulu3). Replace the enumeration with the rule that
determines support — the class calls split_train_validation — keeping the
common datasets as examples, so the docs cannot drift again, and note
that unsupported keys now warn rather than being silently dropped.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Tianyi Zhang <[email protected]>
@tianyi-zhang-02
tianyi-zhang-02 requested review from a team as code owners July 28, 2026 22:19
@copy-pr-bot

copy-pr-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added community-request Documentation Improvements or additions to documentation labels Jul 28, 2026

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tianyi-zhang-02 , only small nits.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-customer Waiting on the original author to respond label Jul 30, 2026
- Drop the now-stale `subset` on GSM8KDataset example from the guard's
  inline comment and helper docstring: this PR fixes that hardcode, so the
  example no longer holds. The split_validation_size example stays, since
  it remains accurate.
- Remove the unused `system_prompt_file` parameter from GSM8KDataset;
  it is read from the data config by set_task_spec, and it is not a
  behavioral key, so the dispatcher guard stays silent on it.

Addresses @yuki-97's review comments.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Tianyi Zhang <[email protected]>
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-customer Waiting on the original author to respond label Jul 30, 2026
yuki-97
yuki-97 previously approved these changes Jul 31, 2026

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tianyi-zhang-02

@yuki-97 yuki-97 added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Jul 31, 2026
@yuki-97

yuki-97 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

/ok to test 7dcb8b6

@yuki-97
yuki-97 enabled auto-merge (squash) July 31, 2026 11:10
tianyi-zhang-02 and others added 3 commits July 31, 2026 11:30
pyrefly caught a real defect: ResponseDatasetConfig types subset as
`str | None`, and the config examples in both guides literally show
`subset: null`, but the loaders annotated it `str` and passed it
straight to load_dataset. Neither openai/gsm8k nor open-r1/OpenR1-Math-220k
has an implicit default config, so a config with `subset: null` would
have failed at load time.

Widen both annotations to `str | None` (matching ResponseDataset and
ArrowTextDataset) and fall back to the dataset's default config when None.
openr1_math.py has the same defect on main, introduced in NVIDIA-NeMo#3131, so it is
fixed here too. Adds a regression test for the None case.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Tianyi Zhang <[email protected]>
auto-merge was automatically disabled July 31, 2026 18:31

Head branch was pushed to by a user without write access

@tianyi-zhang-02

tianyi-zhang-02 commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Updated

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Aug 2, 2026
@tianyi-zhang-02

tianyi-zhang-02 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Current with main. Ready whenever you get a chance, @yuki-97. Thanks!

@yuki-97

yuki-97 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

/ok to test afaf32c

@yuki-97
yuki-97 enabled auto-merge (squash) August 3, 2026 05:09
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Aug 3, 2026
@yuki-97

yuki-97 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

/ok to test 984dbfb

@yuki-97
yuki-97 merged commit 00d3fc2 into NVIDIA-NeMo:main Aug 3, 2026
127 of 141 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) community-request Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants