Skip to content

feat(benchmarks): Add arguments to preparation script; configurable RULER - #1711

Merged
prokotg merged 17 commits into
mainfrom
tgrzegorzek/ruler-prepare-args
Jul 2, 2026
Merged

prokotg merged 17 commits into
mainfrom
tgrzegorzek/ruler-prepare-args

Conversation

@prokotg

@prokotg prokotg commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Some benchmarks require custom preparation arguments. For example, RULER creates prompts based on the tokenizer to much their lengths to a given context length, which is a separate argument.

Currently, we need to create a separate script for each combination of tokenizer and model_length, example of which is benchmarks/ruler/prepare_nemotron_3_256k.py which although is pretty compact requires additional files

from benchmarks.ruler.prepare_utils import prepare_helper

def prepare():
    return prepare_helper(
        model="nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16",  # pragma: allowlist secret
        length=262144,
        output_name="ruler_nemotron_3_256k_benchmark.jsonl",
    )


if __name__ == "__main__":
    prepare()

Now we can provide provide via CLI to ng_prepare_benchmark:

ng_prepare_benchmark "+config_paths=[benchmarks/ruler/config.yaml]" \
"+prepare_script_args.model='nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16'" \
"+prepare_script_args.length=131072"

Not in the scope of this MR (requires more changes vertically across stack). We could consider args to be passed in BenchmarkDatasetConfig

datasets:
- name: ruler
  type: benchmark
  jsonl_fpath: benchmarks/ruler/data/ruler_my_model_128k_benchmark.jsonl
  prompt_config: null
  prepare_script: benchmarks/ruler/prepare_utils.py
  prepare_script_args:
    model: "my-org/my-model"
    length: 131072
  num_repeats: 1

with CLI taking precedence

At the same time, the old behaviour of a separate preparation script is operational

@prokotg
prokotg force-pushed the tgrzegorzek/ruler-prepare-args branch from c05086b to 1c6c20c Compare June 24, 2026 09:12
@copy-pr-bot

copy-pr-bot Bot commented Jun 25, 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.

Comment thread benchmarks/ruler/prepare_utils.py Resolved
Comment thread nemo_gym/cli/eval.py

module = importlib.import_module(prepare_module_path)
output_fpath = module.prepare()
output_fpath = module.prepare(**prepare_script_args)

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.

Please add test checking that it is backward compatible (ie it doesn't break data preparation for modules that don't accept any extra flags)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test added

@ritaneves ritaneves linked an issue Jun 25, 2026 that may be closed by this pull request
1 task
@ritaneves ritaneves removed a link to an issue Jun 25, 2026
1 task
agronskiy
agronskiy previously approved these changes Jul 2, 2026
Signed-off-by: Tomasz Grzegorzek <[email protected]>
@prokotg
prokotg enabled auto-merge (squash) July 2, 2026 15:40
@prokotg
prokotg merged commit bdf99a8 into main Jul 2, 2026
16 checks passed
@prokotg
prokotg deleted the tgrzegorzek/ruler-prepare-args branch July 2, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants