Skip to content

Tests: load the helpers ORPO rewriter constants are built with - #15296

Merged
danielhanchen merged 1 commit into
mainfrom
tests-orpo-loader-private-helpers
Oct 25, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
tests-orpo-loader-private-helpers

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

All 6 tests in tests/python/test_orpo_processor_text_tokenizer.py fail on main since #14185 (Backend CI, Repo tests (CPU, studio)):

E   NameError: name '_fused_pass_logps_re' is not defined

_load_orpo_rewriter rebuilds the ORPO rewriter from unsloth/models/rl_replacements.py by exec'ing every private module-level assignment and then the rewriter function. #14185 added private constants built by a module-level helper, for example _KTO_LOGPS_RE = _fused_pass_logps_re(_KTO_IDS, _KTO_MASK), and the loader never defines that helper. Training is unaffected: in rl_replacements.py the helper is defined above its callers.

Change

The loader also execs, in source order, the module-level functions those private assignments call. It does not exec every private function: some evaluate module globals such as DEVICE_TYPE_TORCH when they are defined, which the loader does not provide. Test-only change.

Testing

  • tests/python/test_orpo_processor_text_tokenizer.py on main (231a4aa1fc): 6 failed. With this change: 6 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T23:14:13.983857Z d56f91e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: d56f91e877

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 9b98bb9 into main Oct 25, 2026
0 of 15 checks passed
@danielhanchen
danielhanchen deleted the tests-orpo-loader-private-helpers branch October 25, 2026 23:19
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.

1 participant