Skip to content

Kernels: name every tl.constexpr parameter with a trailing comment - #16585

Merged
danielhanchen merged 2 commits into
mainfrom
kernels-constexpr-comments
Nov 4, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
kernels-constexpr-comments

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Comment-only. Every tl.constexpr parameter line in the Unsloth Triton kernels and the Studio diffusion / video kernels now carries a short trailing comment naming what it is (# hd, # block size along K, # int8 clamp max, # fuse swiglu before rotation), so a reviewer can tell at a glance whether a constexpr is a true constant or a per-call size that would recompile.

  • 482 lines across 29 files (unsloth/kernels/**, unsloth/optimizers/flash_adamw.py, studio/backend/core/inference/** kernels).
  • Not touched: unsloth/kernels/nf4*.py, the fast LoRA kernels and the fast-inference decode path, which are being reworked separately.
  • No code changes: comment_tools.py check --changed --allow-docstring-edits --strict-ext passes 29 / 29 files (AST-compared, comments and whitespace only).

The functional recompile fixes found by the same audit are separate PRs: #16582 (Studio diffusion kernels, per-resolution sizes) and #16584 (layernorm dW, fp8 block matmul, nvfp4 split sum).

@danielhanchen danielhanchen self-assigned this Nov 3, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-03T18:41:39.431119Z b41b6df 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. Delightful!

Reviewed commit: b41b6dfe80

ℹ️ 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 5a13ca9 into main Nov 4, 2026
@danielhanchen
danielhanchen deleted the kernels-constexpr-comments branch November 4, 2026 03:20
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