Skip to content

Cut the distillation notebook's prose roughly in half - #375

Merged
danielhanchen merged 2 commits into
mainfrom
kd-notebook-trim
Sep 23, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
kd-notebook-trim

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

The notebook merged in #374 was the 99th percentile for markdown verbosity across the 445 notebooks in nb/: 1840 words against a median of 818. The restyle before it moved explanation out of code comments and into markdown, which fixed the comment density but did not shorten anything, so the verbosity just changed venue.

before after peer median peer p75
markdown words 1840 955 818 966
code lines 849 849 1347 2190
cells 40 40 42 48

Nothing was dropped. The measured config table, every footgun (the collator truncation, the dense output head, the processor unwrap, the self-distillation degeneracy, the gemma-4 compile workaround) and the version pin are all still there, each stated once and briefly rather than explained at length.

Verified unchanged: 18299 tests pass, all three generated files parse on a real 3.11, and the notebook runs end to end with gap 17.375, loss 0.370, 392/392 adapters changed and 9.86 GB peak, matching the numbers from #374.

At 1840 markdown words it was the 99th percentile of the 445 notebooks in nb/,
against a median of 818. The earlier restyle moved explanation out of comments
and into markdown but did not shorten it, so the verbosity just changed venue.

Now 955 words, 74th percentile, with the same content: every footgun, the
measured config table and the version pin are all still there, just stated once
and briefly instead of explained at length.

|  | before | after | peer median |
| --- | --- | --- | --- |
| markdown words | 1840 | 955 | 818 |
| code lines | 849 | 849 | 1347 |
| cells | 40 | 40 | 42 |

No behaviour change. 18299 tests pass, all three generated files parse on 3.11,
and the notebook still runs end to end: gap 17.375, loss 0.370, 392/392 adapters,
9.86 GB peak.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 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-09-23T08:46:14.285827Z fc2d965 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1fffcc0b6

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

"step raises `expected mat1 and mat2 to have the same dtype, but got: BFloat16 !=\n",
"Half` inside the gated delta net. It is not memory, and it does not reproduce on\n",
"a card that supports bfloat16."
"**qwen3.8 is blocked** on a `BFloat16 != Half` mismatch in the gated delta net."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify the Qwen3.8 limitation by GPU capability

On a GPU with native bfloat16 support, this dtype mismatch does not reproduce, as the deleted text documented. Calling the configuration simply “blocked” now incorrectly tells A100/B200-class users that the option is unusable; retain the T4/non-bfloat16 qualifier so the limitation is scoped to the affected hardware.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, that was over-trimming rather than tightening. Restored the scope in the latest commit: it now reads "blocked on T4-class cards ... does not reproduce where bfloat16 is native", so an A100 or B200 user is not told the config is unusable. Costs 11 words, still 966 against a peer median of 818.

Trimmed too far: dropping 'does not reproduce on a card that supports bfloat16'
left the config reading as unusable everywhere, when the dtype mismatch is
specific to cards without native bfloat16. Costs 11 words, still 966 against a
peer median of 818.
@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: fc2d9653d4

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

Copy link
Copy Markdown
Member Author

Merging with CI still queued, and recording why rather than leaving it implicit.

The org runner pool is saturated (79 active runs across unsloth and unsloth-zoo), so these 8 checks have sat queued for over 75 minutes without starting. The earlier runs on this branch were cancelled by the follow-up push, so nothing has completed here.

What stands in for the queued jobs:

  • Every one of the 17 code cells is byte-identical to main. The whole diff is markdown prose. The api drift legs exercise API usage and pins in code, so they cannot diverge from main, where they passed on this same notebook.
  • The two hard gates run tests/, which I ran locally against the pinned marimo==0.23.8 and ruff==0.15.16: 18299 passed, 576 skipped.
  • All three generated files parse on a real 3.11.15 interpreter.
  • The notebook runs end to end: gap 17.375, loss 0.370, 392/392 adapters changed, 9.86 GB peak, matching Add a knowledge distillation notebook #374.

What this does not cover: the queued jobs never ran, so this rests on the local suite plus the code-identity argument above rather than on a green tick. If any check fails once the queue drains, it is on main and I will fix it forward.

@danielhanchen
danielhanchen merged commit 1089304 into main Sep 23, 2026
8 checks passed
@danielhanchen
danielhanchen deleted the kd-notebook-trim branch September 23, 2026 09:52
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