Skip to content

Handle plain CuTe compile callable with DSL options - #28

Merged
lukealonso merged 1 commit into
local-inference-lab:masterfrom
voipmonitor:codex/ff-v15-cute-compile-fallback-20260709
Jul 17, 2026
Merged

lukealonso merged 1 commit into
local-inference-lab:masterfrom
voipmonitor:codex/ff-v15-cute-compile-fallback-20260709

Conversation

@voipmonitor

@voipmonitor voipmonitor commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the existing DSL compile options path for W4A8 dynamic MoE
  • handle runtimes where cutlass.cute.compile is exposed as a plain function instead of a CompileCallable instance
  • instantiate CompileCallable(dsl_compile_options) explicitly in that case, rather than crashing or dropping the options

Root Cause

The GLM 5.2 v15 FF image hit TypeError: function object is not subscriptable in b12x/cute/compiler.py when W4A8 dynamic MoE requested OptLevel(2). In the vLLM worker runtime, cutlass.cute.compile can be a plain function, so cute.compile[dsl_compile_options] is not always valid.

Validation

  • runtime overlay benchmark on 8x RTX Pro 6000 Blackwell for /root/models/GLM-5.2-BF16-AMDMXFP4experts, TP8/DCP1/MTP0/A8 force
  • before patch: first request killed EngineCore with TypeError at cute.compile[dsl_compile_options]
  • after patch: mxfp4-a8-orig completed, decode cc1 88.612 tok/s, prefill 8k 6198 tok/s, prefill 64k 6365 tok/s, KV cache 625344 tokens

Summary by CodeRabbit

  • Bug Fixes
    • Improved compilation compatibility when DSL options are provided.
    • DSL options are now applied correctly whether the compiler is exposed as a configurable callable or a standard function.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e2eb9225-6f61-43da-9941-24f264db8548

📥 Commits

Reviewing files that changed from the base of the PR and between 97b3d64 and 90172a5.

📒 Files selected for processing (1)
  • b12x/cute/compiler.py

Walkthrough

compile() now applies dsl_compile_options through subscript indexing when supported, with a CompileCallable fallback for plain cute.compile functions.

Changes

DSL Compile Options

Layer / File(s) Summary
Conditional compile callable handling
b12x/cute/compiler.py
compile() detects whether the compile callable supports __getitem__; it applies options through indexing when possible and otherwise constructs CompileCallable(dsl_compile_options).

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: supporting a plain CuTe compile callable while preserving DSL options.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@voipmonitor voipmonitor changed the title [codex] Handle plain CuTe compile callable with DSL options Handle plain CuTe compile callable with DSL options Jul 10, 2026
@voipmonitor
voipmonitor marked this pull request as ready for review July 10, 2026 23:38
@voipmonitor

Copy link
Copy Markdown
Contributor Author

Revalidated together with #32 on current B12X master 115926e. Both cherry-pick cleanly; tests/test_cutlass_runtime_patches.py plus tests/test_w4a8_mx_tp_moe.py completed with 84 passed, 1 skipped on SM120. No compatibility patch was required.

@voipmonitor

Copy link
Copy Markdown
Contributor Author

Canonical-stack validation update: current master (115926e) plus #28, #32, #34, and #35 merges without conflicts. The combined SM120 suite passed: 120 passed, 1 skipped (CuTe runtime patching, W4A8 auxiliary-stream launch, W4A16/NF3 launch geometry, and NVFP4 MLA KV cache/API coverage). git diff --check is clean.

@voipmonitor

Copy link
Copy Markdown
Contributor Author

Final canonical-stack validation against master@115926eb: merged #28 -> #32 -> #34 -> #35 without conflicts, then ran the combined production-path suite: 122 passed, 1 skipped. git diff --check and Ruff diagnostics on the changed files are clean. No runtime overlay is required.

@lukealonso
lukealonso merged commit 4b76272 into local-inference-lab:master Jul 17, 2026
2 checks passed
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.

2 participants