Skip to content

Tests: share one fp8 to NF4 load of the dense checkpoint - #17812

Merged
danielhanchen merged 1 commit into
mainfrom
unsloth-test-speed-followup
Nov 15, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
unsloth-test-speed-followup

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Test-only change. The three dense-checkpoint tests in tests/test_fp8_to_nf4_load.py (from #17775) each loaded the same tiny fp8 checkpoint to NF4. They now share one load through a module-scoped fixture.

On a shared B200, which is too noisy for timing, the saving is small:

before after
three affected tests, CPU s 29.4 / 29.1 24.1 / 26.6
three affected tests, wall s 38.3 / 54.7 38.8 / 53.0

The CPU time drops by about 3 to 5 s. The wall time is inside the noise. The whole file passes in both arms: 21 passed, 1 skipped.

The tests still catch the bugs they guard:

  • Forcing 16-bit layers to quantize fails all three (14 == 13, and Linear4bit is not Linear).
  • Dropping the reached-keys filter fails test_fp8_keys_the_model_does_not_have_are_ignored.
  • Scaling the dequant by 1.01 fails test_dense_fp8_loads_nf4_bit_identical....

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T10:36:43.998045Z 7246a05 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. Can't wait for the next one!

Reviewed commit: 7246a05aaa

ℹ️ 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 2be2ac8 into main Nov 15, 2026
@danielhanchen
danielhanchen deleted the unsloth-test-speed-followup branch November 15, 2026 11:51
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
Final comment pass for recently merged PRs.

Trims comments added by unslothai#17660, unslothai#17806, unslothai#17807, unslothai#17808, unslothai#17812, unslothai#17830,
unslothai#17854, unslothai#17857 and unslothai#17870 that are still on main.
Multi-line explanations are collapsed to one line, and comments that
restate the code are removed.
Comments that explain a version quirk or a correctness trap are kept,
along with license headers and pragmas.
Changed comment lines: unslothai#17660 5 -> 2, unslothai#17806 4 -> 2, unslothai#17808 1 -> 0,
unslothai#17830 3 -> 1, unslothai#17857 1 -> 0. unslothai#17807, unslothai#17812, unslothai#17854 and unslothai#17870 are
unchanged.
Overall: 6 files, 14 lines removed, 5 added. Only comments change: the
AST check (comment_tools.py check) and the pre-push gate both pass.
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