Skip to content

Fix Olmo Hybrid weight loading in GRPO - #1844

Merged
abhishekraok merged 5 commits into
allenai:mainfrom
primorLee:fix/1842-grpo-hybrid-loader
Oct 14, 2026
Merged

abhishekraok merged 5 commits into
allenai:mainfrom
primorLee:fix/1842-grpo-hybrid-loader

Conversation

@primorLee

@primorLee primorLee commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1842.

The OLMo-core GRPO actor bypassed the model-type dispatcher when loading reference-policy and post-parallelization weights. Hybrid checkpoints therefore reached the generic converter and failed on GDN linear_attn.* keys. Both loading sites now use the dispatcher, and replaced state-dict values are loaded back into the model.

The merge with current main preserves both this PR's load_hf_weights_into_model helper and upstream initialize_promoted_token_embeddings unchanged. The changelog retains both entries.

Validation at 0637a5d:

  • Ruff lint and format checks passed for all three changed Python files.
  • Two source-isolated checks using the actual functions and real CPU PyTorch passed: Hybrid dispatch avoids the generic converter, and replaced state-dict values reach the model.
  • The promoted-token initialization helper is AST-identical to current upstream.
  • The current complete test module cannot be imported on Windows because an upstream dependency imports Linux multiprocessing.ForkProcess; the checks above do not claim full module, FSDP, or GPU validation.

Earlier pre-merge CPU validation is recorded in the PR history. No GPU GRPO startup test was run for this merge.

GPU_TESTS=bypass

AI-assisted implementation and conflict resolution.

@primorLee
primorLee marked this pull request as ready for review August 21, 2026 19:45

@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.

Codex · codex://threads/01a0d61a-a285-7931-ab3a-39b0134c4a25

Codex and claude-personal independently reviewed head 3d152db58. The fix is valid: both GRPO loading paths need the Hybrid dispatcher, and the final model.load_state_dict(...) is necessary because the Hybrid converter replaces state-dict tensors rather than copying in place. No new correctness finding was identified.

Recommended action: resolve the conflicts with current main in open_instruct/olmo_core_utils.py and CHANGELOG.md, retaining both load_hf_weights_into_model and main's initialize_promoted_token_embeddings, plus both changelog entries. Rerun checks on that resolved tree before merging.

Validation: 9 focused CPU tests passed, with the existing Triton-dependent parameter-coverage test excluded on this Mac; Ruff check and format passed for all three changed Python files. Claude-personal independently passed the same 9 tests and observed the Triton import failure in the remaining test. GPU/FSDP loading and a real Hybrid checkpoint were not exercised.

@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.

Codex · codex://threads/01a08720-4354-71f2-bceb-d65a229b9183

Rechecked head 0637a5d and its clean merge with current main. No blocking code findings. The dispatcher routes Hybrid checkpoints correctly, and the helper loads replaced state-dict tensors back into both model-loading paths. The loader functions are unchanged from the previously independently reviewed implementation; main's promoted-token initializer is preserved exactly.

Ruff lint, formatting, and compilation pass for all three Python files. Required GitHub unit tests and code-quality checks are now running after maintainer workflow approval. Merge remains conditional on those passing. GPU/FSDP startup was not exercised by this review.

@abhishekraok
abhishekraok added this pull request to the merge queue Oct 14, 2026
Merged via the queue into allenai:main with commit af64fd1 Oct 14, 2026
7 checks passed
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.

GRPO on the olmo-core path bypasses the hybrid weight-loading dispatch

2 participants