Skip to content

int8 LoRA kernels: comment every tl.constexpr parameter (red on main since #19965) - #20004

Merged
danielhanchen merged 1 commit into
mainfrom
fix-int8-lora-constexpr-comments
Nov 27, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-int8-lora-constexpr-comments

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

tests/test_triton_constexpr_comments.py::test_every_constexpr_line_has_a_comment fails on main (53a74eb64e) in Repo tests (CPU, rest):

tl.constexpr parameters without a comment:
  unsloth/kernels/int8_lora.py:213 _int8_mm_kernel.BLOCK_M
  unsloth/kernels/int8_lora.py:214 _int8_mm_kernel.BLOCK_N
  unsloth/kernels/int8_lora.py:215 _int8_mm_kernel.BLOCK_K
  unsloth/kernels/int8_lora.py:216 _int8_mm_kernel.GROUP_M
  unsloth/kernels/int8_lora.py:264 _int8_dgrad_kernel.HAS_D
  unsloth/kernels/int8_lora.py:265 _int8_dgrad_kernel.INV_SQRT_G
  unsloth/kernels/int8_lora.py:267 _int8_dgrad_kernel.BLOCK_M
  unsloth/kernels/int8_lora.py:269 _int8_dgrad_kernel.GROUP_M

#19965 added unsloth/kernels/int8_lora.py, and these eight parameters have no comment. It shows on any PR whose rest shard runs, for example the #19837 staging run.

Fix

Comments only, no code change. Each of the eight parameters gets a one-line comment saying what it is:

  • the tile sizes
  • the K % BLOCK_K == 0 precondition that lets the K loop load unmasked
  • the swizzle group
  • the dgrad epilogue add
  • the 1 / sqrt(G) normalisation

Verification

  • tests/test_triton_constexpr_comments.py: 4 passed. Before, on main: 1 failed, listing the eight parameters above.
  • ruff format and ruff check: clean.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 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-27T16:36:42.501641Z fca8a9c 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: fca8a9ce43

ℹ️ 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 ee6ecad into main Nov 27, 2026
4 of 63 checks passed
@danielhanchen
danielhanchen deleted the fix-int8-lora-constexpr-comments branch November 27, 2026 16:45
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