Skip to content

INT8 attention: no direct launch when Triton is absent (diffusion leg red on main) - #17889

Merged
danielhanchen merged 1 commit into
mainfrom
fix-int8-fast-launch-no-triton
Nov 16, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-int8-fast-launch-no-triton

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

(Python 3.13, diffusion) has failed on main since #17855 (direct INT8 attention launches after the first call). 13 cases of studio/backend/tests/test_diffusion_int8_attention_triton_device.py::test_int8_attention_launches_on_the_operands_card fail:

core/inference/diffusion_int8_attention_triton.py:1153: in _launch
    if _fast_launch_ok() and isinstance(kernel, triton.runtime.jit.JITFunction):
E   AttributeError: 'NoneType' object has no attribute 'runtime'

The module keeps triton = None when Triton cannot be imported, and that CI leg has no Triton. The device test drives the launcher with stand-in kernels, so it reaches _launch without Triton. #17855's gate then dereferences triton.runtime. The fast path itself is right; it just needs to be off when there is no Triton to launch through.

Change

  • _fast_launch_ok() returns False when triton is None, so every launch takes the regular kernel[grid](...) path. With Triton installed nothing changes, and the UNSLOTH_* kill switch keeps working.
  • New test_fast_launch_is_off_without_triton pins it: T.triton = None with the switch forced on still answers False.

Verification

The two INT8 Triton device and compile-key test files, run with Triton blocked (sys.modules["triton"] = None, as on the diffusion leg) and with Triton installed:

no Triton Triton installed
main 13 failed passes
this branch 15 passed, 2 skipped 15 passed, 2 skipped
new test, source change reverted fails

#17855 added a direct-launch path whose gate reads triton.runtime.jit.JITFunction. Without Triton the
module sets triton = None, so the gate raised AttributeError, and the (Python 3.13, diffusion) leg (no
Triton installed) failed 13 cases of test_int8_attention_launches_on_the_operands_card on main.
_fast_launch_ok now returns False without Triton; a test pins it.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 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-16T03:22:29.441125Z 4db87c5 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. Delightful!

Reviewed commit: 4db87c5f93

ℹ️ 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 b0cadd4 into main Nov 16, 2026
@danielhanchen
danielhanchen deleted the fix-int8-fast-launch-no-triton branch November 16, 2026 03:57
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