Skip to content

FP8 LoRA test: expect the kernel route when unsloth_zoo drops HF output flags - #16855

Merged
danielhanchen merged 1 commit into
mainfrom
dh/fp8-test-zoo-drops-output-flags
Nov 6, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/fp8-test-zoo-drops-output-flags

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

tests/test_fp8_lora.py::test_fp8_loss_ignores_model_output_flags_only_on_its_head fails on main against the current unsloth_zoo (6 parametrized cases, assert not run(owner)).

The test assumed that unsloth_zoo's fused lm_head adapter forwards output_attentions / output_hidden_states into the fused CE, which makes _use_chunked_ce refuse the kernel on every head except the FP8 LoRA one. unsloth_zoo now drops those flags in the adapter itself (_KERNEL_KWARGS in unsloth_zoo/fused_losses/forward_adapter.py). So every head keeps the chunked kernel route, and the "ordinary head refuses the kernel" assertions no longer hold.

Fix

Test only. The test reads whether the installed unsloth_zoo already drops the flags and expects that route on the heads without FP8 LoRA: the head before FP8 is enabled, an ordinary model, and after restore_fp8_lora_for_inference. The FP8 head still has to take the kernel route, and the namespace restore checks are unchanged.

Testing

tests/test_fp8_lora.py -k "output_flags or fp8_loss_route":

unsloth_zoo before after
current main (drops the flags) 6 failed 12 passed
previous main (forwards the flags) 12 passed 12 passed

…ut flags itself

unsloth_zoo's fused lm_head adapter now drops output_attentions /
output_hidden_states for every head, so heads without FP8 LoRA keep the
chunked kernel route too. The test reads which zoo it runs against and
still checks the FP8 head and the restore paths.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 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-11-06T00:58:06.217720Z 016d867 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. Swish!

Reviewed commit: 016d867689

ℹ️ 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".

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