Skip to content

MXFP4 dequantize branch test: run the locals the branch reads ahead of it - #15558

Merged
danielhanchen merged 1 commit into
mainfrom
ci-mxfp4-dequant-branch-locals
Oct 27, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-mxfp4-dequant-branch-locals

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Seven tests in tests/test_mxfp4_lora_packed_experts_dequantize.py fail on main (Repo tests (CPU, rest), e.g. job 122197461249 on #15514, and every PR based after #15367):

unsloth/models/vision.py:4132: NameError: name '_fp8_full_finetune' is not defined

Cause

The test compiles only the if in FastBaseModel.from_pretrained that sets quantizer_kwargs["dequantize"], with a hand-written namespace of its inputs. #15367 added a local just ahead of it,

_fp8_full_finetune = full_finetuning and str(quant_method).lower() == "fp8"

and reads it in that if's condition. The product is right; the harness namespace was missing the new local, so every case that reaches the condition stopped on the NameError.

Change

The harness now also runs the name = ... statements ahead of the branch in each block enclosing it (within the function) whose name the branch reads, outermost first, skipping any name the test already provides. Today that adds only the _fp8_full_finetune line; a future local computed the same way is picked up instead of breaking the file again, and the stubs keep precedence.

Verification (local, CPU)

  • Whole file: main 7 failed, 37 passed; this branch 44 passed.
  • Sabotage: replacing that line in vision.py with _fp8_full_finetune = True fails 5 tests on this branch (test_native_load_unchanged_without_packed_path, test_offloading_device_map_keeps_native_load, ...), so the lifted line is the real one from vision.py and it is evaluated on every case.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T14:41:53.393465Z 174b50e 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 174b50eee3

ℹ️ 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 3c1a0b8 into main Oct 27, 2026
0 of 15 checks passed
@danielhanchen
danielhanchen deleted the ci-mxfp4-dequant-branch-locals branch October 27, 2026 14: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.

1 participant