Skip to content

Parse null in -o overrides so max_tokens=null clears the cap - #517

Merged
armancohan merged 3 commits into
mainfrom
ac/max-tokens-null-override
Nov 4, 2026
Merged

armancohan merged 3 commits into
mainfrom
ac/max-tokens-null-override

Conversation

@armancohan

Copy link
Copy Markdown
Contributor

Problem

On main (94195ea), -o max_tokens=null does not clear the generation cap. _parse_override_value returns the string "null", so SamplingParams.max_tokens becomes "null". The vllm_server provider only omits max_tokens when it is None, so it sends the string. vLLM 0.19.1 rejects every request:

BadRequestError: Error code: 400 - {'error': {'message': "1 validation error:
  {'type': 'int_parsing', 'loc': ('body', 'max_tokens'),
   'msg': 'Input should be a valid integer, unable to parse string as an integer', 'input': 'null'} ..."}}

We hit this on a Beaker smoke run (olmo-eval run ... -t lab_bench_litqa2 -o max_tokens=null with a vllm_server harness). Every request failed and 0 of 20 items were scored.

Repro (CPU, no server)

from olmo_eval.cli.run.config import RunConfigBuilder
from olmo_eval.cli.utils import process_ordered_args, reconstruct_ordered_args
from olmo_eval.runners.asynq.preparation import configure_task

args = ["-m", "m", "-t", "lab_bench_litqa2", "-o", "max_tokens=null"]
task_overrides, _ = process_ordered_args(reconstruct_ordered_args(args))
config = RunConfigBuilder(model="m", task=("lab_bench_litqa2",), output_dir="/tmp/r",
                          cli_task_overrides=task_overrides).build()
task = configure_task("lab_bench_litqa2", None, config.task_overrides["lab_bench_litqa2"])
print(repr(task.config.sampling_params.max_tokens))  # main: 'null'; this branch: None

Change

_parse_override_value maps null (any case) to None. Nothing else changes. Both server providers already handle None:

  • vllm_server omits max_tokens from completion and chat requests (covered by test_generate_*_omits_max_tokens_when_none in tests/providers/test_vllm_server_logprobs.py). vLLM then generates up to max_model_len.
  • sglang passes max_new_tokens=None (covered by test_greedy_uncapped_and_empty). SGLang 3145136's scheduler treats None as uncapped and clamps it to max_req_len - input_len - 1.

none stays a string because some fields take it as a value (for example the suite registry's "none" and prompt_templates="none"). The same parser serves harness overrides, so provider.<field>=null now also yields None.

This ports the intent of c1d05ef on ac/fast-suite-context-budget, minus the none alias.

Tests

New tests fail on main and pass here:

  • tests/cli/test_dotlist_overrides.py::TestParseOverrideValue::test_null and test_none_stays_a_string
  • tests/cli/test_utils.py::TestEndToEndOrdering::test_max_tokens_null_override_reaches_sampling_params_as_none (CLI args through RunConfigBuilder and configure_task)

Ran locally (macOS, Python 3.13, uv run --frozen --no-group vllm):

uv run ruff check src/ tests/            # All checks passed
uv run ruff format --check src/ tests/   # 700 files already formatted
uv run ty check src/                     # All checks passed
uv run pytest tests/ --ignore=tests/integration   # 4474 passed, 36 skipped

Not run: a GPU end-to-end eval with max_tokens=null on this branch. No task hashes move (the pinned hash test passes).

🤖 Generated with Claude Code

_parse_override_value turned "null" into the string "null". A task override
of max_tokens=null then reached the vllm_server request body as "null" and
vLLM rejected every request with HTTP 400 (int_parsing). With this change
"null" parses to None. Both server providers already treat max_tokens=None
as "generate to the context limit". "none" stays a string because some
fields take it as a value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@abhishekraok abhishekraok left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Written by Claude Code session fix-pr-review

Reviewed at 0511820 (after update from main). Correct and minimal; no blockers.

  • null → None matches _coerce_value in cli/utils.py, which already does this for ordered args (that one is case-sensitive, this one case-insensitive: harmless nit). Keeping none a string is right.
  • Composes with typed-sampling-overrides (#522), which touches the same override path: merged together they pass the CPU suite.

@abhishekraok

Copy link
Copy Markdown
Collaborator

Written by Claude Code session eval-metrics-handoff

Cross-family review: Codex (codex exec review, base main, head 0511820) found no actionable defects. null overrides parse to None, while the string "none" stays a string, and the task-config tests cover both cases.

@armancohan
armancohan merged commit 3eda736 into main Nov 4, 2026
8 checks passed
@armancohan
armancohan deleted the ac/max-tokens-null-override branch November 4, 2026 19:16
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.

2 participants