Conversation
Contributor
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
from
September 15, 2026 01:57
2ab5a45 to
8250b47
Compare
tpn
force-pushed
the
codex/cuda-coop-developer-overview-20260908
branch
from
September 15, 2026 18:01
27473c2 to
bb530c1
Compare
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
2 times, most recently
from
September 15, 2026 23:45
48d6ed0 to
d6b38b1
Compare
tpn
force-pushed
the
codex/cuda-coop-developer-overview-20260908
branch
2 times, most recently
from
September 16, 2026 03:34
66ca852 to
a4e44a8
Compare
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
from
September 16, 2026 03:34
d6b38b1 to
d2d8f60
Compare
tpn
marked this pull request as ready for review
September 16, 2026 16:20
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The review requests stronger verification of explicit max_registers preservation and a documentation wording correction.
Pull request overview
Adds inferred CUDA launch bounds for exact cooperative block specializations while preserving explicit resource options and specialization identity.
Changes:
- Infers scalar bounds from exact 1D/2D/3D block dimensions.
- Preserves explicit launch and register limits and reports oversized launches.
- Adds compile/runtime coverage and programming-guide documentation.
File summaries
| File | Description |
|---|---|
python/cuda_coop/tests/backends/numba_mlir/runtime/test_scan.py |
Validates large 1D/2D/3D scans. |
python/cuda_coop/tests/backends/numba_mlir/compile/test_group_hierarchy_compile.py |
Tests bounds, options, specializations, and diagnostics. |
python/cuda_coop/cuda/coop/numba_mlir/_compiler/_group_planner.py |
Infers and validates launch bounds. |
docs/python/coop/programming_guide.rst |
Documents launch-resource behavior. |
Review details
Suppressed comments (2)
docs/python/coop/programming_guide.rst:1069
- important: The new test passes
launch_bounds=None, and the implementation treats that as unset and infers a bound, but this wording says that supplyinglaunch_boundsexplicitly suppresses inference. Please distinguish non-Nonebounds (and non-Nonemax_registers) so the documented behavior matches the tested behavior.
A kernel specialized for an exact cooperative launch block receives an inferred
``launch_bounds`` equal to that block's thread count, unless the kernel supplies
``launch_bounds`` or ``max_registers`` explicitly. This lets the compiler account
python/cuda_coop/tests/backends/numba_mlir/compile/test_group_hierarchy_compile.py:233
- important: The
max_registerscase currently only asserts that no.maxntiddirective was added. That would still pass if the explicit register cap were dropped, so this test does not cover the advertised preservation; also assert that the compiled target options (or PTX) retainmax_registers=64.
if maximum is None:
assert ".maxntid" not in ptx
else:
assert f".maxntid {maximum}, 1, 1" in ptx
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment has been minimized.
This comment has been minimized.
tpn
force-pushed
the
codex/cuda-coop-developer-overview-20260908
branch
from
September 16, 2026 23:41
a4e44a8 to
35ddb6d
Compare
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
from
September 16, 2026 23:41
d2d8f60 to
5b0a212
Compare
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
from
September 19, 2026 00:15
54488df to
d4594ad
Compare
This comment has been minimized.
This comment has been minimized.
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
2 times, most recently
from
September 19, 2026 02:41
c7b3dd1 to
737beb1
Compare
This comment has been minimized.
This comment has been minimized.
tpn
force-pushed
the
codex/cuda-coop-developer-overview-20260908
branch
from
September 19, 2026 04:20
c032547 to
c421b17
Compare
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
from
September 19, 2026 04:20
737beb1 to
3db9800
Compare
cuda.coop block specializations
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
from
September 19, 2026 04:35
3db9800 to
8e4b420
Compare
This comment has been minimized.
This comment has been minimized.
Use the exact block's thread count as a compile-local launch bound when neither bounds nor a register limit is explicit. Preserve user options and reject exact launches exceeding an explicit maximum. Keep block dimensions in specialization identity and document the launch resource contract without promising a register or performance outcome. Signed-off-by: Trent Nelson <trent@trent.me>
tpn
force-pushed
the
codex/cuda-coop-developer-overview-20260908
branch
from
September 20, 2026 02:56
3afcec0 to
a8376d8
Compare
tpn
force-pushed
the
codex/coop-launch-bounds-20260914
branch
from
September 20, 2026 02:56
8e4b420 to
216928d
Compare
Contributor
🥳 CI Workflow Results🟩 Finished in 34m 44s: Pass: 100%/8 | Total: 1h 27m | Max: 28m 29sSee results here. |
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this is needed
Cooperative planning knows a kernel's exact block size, but the device compiler
previously received no corresponding launch bound. A large block could fail to
launch when its compiled register requirements exceeded the available resources.
Behavior
Infer scalar
launch_bounds=x*y*zin compile-local options whenlaunch_boundsis absent or
Noneandmax_registersis not explicitly set. Preserve explicitinteger/tuple bounds, register limits, dispatcher options, exact dimensions,
and specialization identity. Reject an exact launch exceeding an explicit
maximum with an attributable error.
This supplies launch-resource information; it does not infer occupancy or
cluster bounds. Lower register use may introduce spilling.
Stacked on #11320, following the full primitive and documentation stack. The
launch-bound implementation patch is unchanged by the restack.
Validation
Fresh installed-wheel checks at
216928d0eac1:rtol=3e-4,atol=3e-5).Wheel validation and source, installed-package, and bundled-header comparisons passed.
Remote CI passed at
216928d0eac1: GitHub Actions run. All exact-head checks and statuses, including pre-commit, are successful or conditionally skipped.