Skip to content

epic: dataset preparation #1338

Open
2 of 12 issues completed
Open

Description

@cwing-nvidia

Summary

Getting external data into NeMo Gym is harder than it should be. A new user trying to use their own data or a public dataset hits friction at multiple points. The scale of the problem is visible in the codebase: 80+ benchmarks each have their own one-off prepare.py script, and ~103 lm-eval-harness benchmarks could run against existing Gym verifiers today if there were a standard path to convert their datasets — the data preparation friction is the only thing blocking that coverage.

Issues (descending priority)

1. Users start from many different source formats (most critical issue)

  • HuggingFace datasets (Parquet/Arrow) — common starting point. User calls load_dataset() and gets rows as dicts, often with a messages column (Chat Completions format), or prompt/instruction/question columns.
  • JSONL files — from OpenAI API exports, other tools, or hand-authored.
  • CSV/TSV — from spreadsheets, annotation tools, academic datasets.
  • Python dicts — programmatically generated in a notebook or script.
  • container -- e.g., SWE - there isn't a consistent spec when users need containerized tasks

Gym only accepts JSONL with responses_create_params. There is no unified path from any of these starting points to Gym format. Users end up writing one-off prepare_*.py scripts (40+ exist in benchmarks/ today). See: #1340.

2. The conversation column itself comes in different API formats

Even once the user has rows as dicts, the conversation/prompt column may be in:

  • OpenAI Chat Completions format (messages with role/content, possibly tool_calls) — see #1393
  • Anthropic format (top-level system + messages with different tool-call structure) - see Support Anthropic message format as data input #1341
  • Raw text (prompt, instruction, question — just a string)
  • Already in Gym format (responses_create_params.input)

Conversion logic exists in isolated places in the codebase but has not been promoted into shared infrastructure. See: #1339, #1341, #1567.

3. The data preparation experience is confusing

  • gym dataset collate — the name suggests structure, but new users have no idea what "collate" means here. What it actually does is validate that data is already in Gym format, reject rows that aren't, compute metrics, add agent_ref, and write *_prepare.jsonl files. It's a validator/collator, not a preparer.
  • gym dataset render — a new user has no idea what "render" means in this context. What it actually does is take a YAML template + raw-fields JSONL, fill in {placeholder} variables, and produce JSONL with responses_create_params.input populated. It requires a YAML template file — which users with already-assembled messages don't have and don't need.

There is also no comparison between the two commands anywhere in the docs. See: #1344

4. gym dataset collate gives no actionable feedback when rows fail**

When a row fails validation, compute_sample_metrics catches the ValidationError, throws away the error message, and just marks the row index as "offending." The user sees offending_example_idxs: [0, 1, 2, ...] but gets zero information about why it failed or what to do. If the error said "row 0 has 'messages' but Gym expects 'responses_create_params' — see docs/data for format details" that would be dramatically more helpful. See: #1340

5. verifier_metadata vs top-level fields inconsistency

Some resources servers expect verifier_metadata (e.g. xstest, evalplus, labbench2_vlm). Others expect top-level fields like expected_answer, question (e.g. math_with_judge). There's no standard and no way for a user to know what their target server expects without reading its source code. See: #1342.

6. agent_ref couples data to serving infrastructure

If data is supposed to be composable, why does prepared data contain a reference to a specific agent server name? Renaming an agent in your YAML config breaks your prepared data. The raw data is composable (gym dataset collate adds agent_ref from config), but once prepared, it's coupled. This leaks a training infrastructure concern into the data format. See: #1343.

7. No automatic dataset download at evaluation time

When a user runs an evaluation (e.g. gym run --env vals), the dataset should be downloaded automatically if it's not already present locally. Today, users must run gym dataset collate as a separate step before they can evaluate. For evaluation workflows, this should be transparent — the run command checks for the dataset, downloads it from the configured registry if missing, and proceeds. See: #1353.

8. Documentation gaps

Topic Status Issue
Dedicated "Prepare data for Gym" onboarding guide Missing #1344
How to convert from Chat Completions or HF datasets Not in data docs #1339, #1341
verifier_metadata vs top-level fields, what to use when Not documented #1342
gym dataset render when to use vs gym dataset collate No comparison anywhere #1344
Complete data format reference (responses_create_params, verifier_metadata, agent_ref, top-level fields) Partial examples scattered across pages #1344
End-to-end "HuggingFace dataset → Gym-ready JSONL" walkthrough Download docs exist but no format conversion guide #1344
gym dataset upload/download --storage gitlab documentation No page for GitLab dataset registry; old ng_* command names need updating #1346
agent_ref docs say it "maps to a resources server", it actually routes to an agent server Incorrect #1343

Resolved

Dataset upload/download commands are split by backend — Fixed. gym dataset upload and gym dataset download now use --storage {hf,gitlab} to select the backend. The four separate ng_upload/download_* commands are gone.

Related

Sub-issues

Sub-issues

2 of 12 Issues completed
Loading 12 sub-issues

Activity

  1. 31 remaining items

  2. anwithk commented on Oct 8, 2026

    @anwithk
    Contributor

    Reorganizing the parent / sub issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions