Repository navigation
olmo_core: accept uncapped max_tokens in the request trace - #319
Merged
Merged
Conversation
`_build_generation_kwargs` rejected `max_tokens <= 0`, which raises TypeError when max_tokens is None. The generation path never hit this — it calls `_resolve_max_tokens` first — but `describe_request` builds the same kwargs without resolving, and the async runner traces every request before generation. Any task using `max_tokens=None` (generate to the context limit) therefore failed on this provider before inference. None now passes the guard; a concrete non-positive limit is still rejected. Reported by Codex review on #308. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OlmoCoreProvider._build_generation_kwargsrejectsmax_tokens <= 0, which raisesTypeError: '<=' not supported between instances of 'NoneType' and 'int'whenmax_tokensisNone.The generation path never hit this —
generate()calls_resolve_max_tokens()first, which replacesNonewith the room left in the context. Butdescribe_request()builds the same kwargs without resolving, andrunners/asynq/processing.pytraces every request before generation. So any task usingmax_tokens=Nonefails on this provider before inference starts.That affects the three migrated post-training tasks in flight — #307
popqa:chat, #308omega_500, #309gpqa_*:cot— all of which usemax_tokens=None(generate to the model's context limit) to avoid the fixed-131k footgun in #310. They ran fine onvllm_server, which is why this wasn't caught by the parity runs.Nonenow passes the guard; a concrete non-positive limit is still rejected.Regression test added:
describe_requestwithSamplingParams(max_tokens=None)on the existing fake-provider fixture. Verified it raisesTypeErroratolmo_core.py:384without the fix. Full suite 1958 passed, ruff/ty clean.Reported by Codex review on #308.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ