Skip to content

[STF] Implement cyclic_partition::get_executor#9803

Open
caugonnet wants to merge 2 commits into
NVIDIA:mainfrom
caugonnet:stf-cyclic-get-executor
Open

[STF] Implement cyclic_partition::get_executor#9803
caugonnet wants to merge 2 commits into
NVIDIA:mainfrom
caugonnet:stf-cyclic-get-executor

Conversation

@caugonnet

Copy link
Copy Markdown
Contributor

Description

cyclic_partition::get_executor was left as abort(), making cyclic the only partitioner unusable as a composite data place mapper (which needs the inverse coordinate-to-place direction: data_place::composite(cyclic_partition{}, grid) aborted at the first allocation).

This implements the exact inverse of apply for zero-based coordinates — the owner of an element is its coordinate modulo the grid extent, independently in each dimension — matching the zero-based contract of the sibling blocked_partition/tiled_partition executors, with a debug assert rejecting negative coordinates.

A co-located unittest sweeps every place of a 2×3 grid over a 3-D box and checks that each coordinate visited by apply maps back to the place that produced it, covering dimensions the grid does not split.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

🤖 Generated with Claude Code

cyclic_partition::get_executor was left as abort(), making cyclic the
only partitioner unusable as a composite data place mapper, which needs
the inverse coordinate-to-place direction. Implement the exact inverse
of apply for zero-based coordinates: the owner of an element is its
coordinate modulo the grid extent, independently in each dimension.

Add a co-located unittest sweeping every place of a 2x3 grid over a 3-D
box and checking that each coordinate visited by apply maps back to the
place that produced it, covering dimensions the grid does not split.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@caugonnet caugonnet requested a review from a team as a code owner July 11, 2026 10:01
@caugonnet caugonnet requested a review from andralex July 11, 2026 10:01
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 11, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 11, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3d857e7d-6cd6-4e4f-bbe6-c16793eb3873

📥 Commits

Reviewing files that changed from the base of the PR and between 11741e0 and 5a28243.

📒 Files selected for processing (1)
  • cudax/include/cuda/experimental/__places/partitions/cyclic_shape.cuh
🚧 Files skipped from review as they are similar to previous changes (1)
  • cudax/include/cuda/experimental/__places/partitions/cyclic_shape.cuh

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Fixed cyclic partition ownership lookup for zero-based coordinates.
    • Added runtime validation to reject negative coordinates and ensure grid dimensions are nonzero.
    • Ensured ownership mapping is correctly computed from coordinates.
  • Tests

    • Added a unit test verifying ownership lookup is the inverse of cyclic placement.
    • Confirmed the full data extent is visited exactly once.

Walkthrough

cyclic_partition::get_executor now computes owners from non-negative zero-based coordinates using nonzero grid dimensions. A unit test verifies that it reverses apply ownership mapping and covers the complete data extent.

Changes

Cyclic executor ownership

Layer / File(s) Summary
Implement cyclic executor lookup
cudax/include/cuda/experimental/__places/partitions/cyclic_shape.cuh
get_executor asserts non-negative coordinates and nonzero grid dimensions, then calculates each owner coordinate with modulo operations.
Validate apply and executor inversion
cudax/include/cuda/experimental/__places/partitions/cyclic_shape.cuh
The unit test maps every position produced by apply back through get_executor, verifies ownership, and checks full extent coverage.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
cudax/include/cuda/experimental/__places/partitions/cyclic_shape.cuh (1)

385-386: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

suggestion: Track visited coordinates, not only the count.

cnt == 7 * 5 * 20 allows duplicates to mask missing elements. Record each coordinate and assert uniqueness so the test actually verifies complete coverage.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c040d1cb-764f-4a09-b6ef-34182eca0a42

📥 Commits

Reviewing files that changed from the base of the PR and between e6abcc8 and 11741e0.

📒 Files selected for processing (1)
  • cudax/include/cuda/experimental/__places/partitions/cyclic_shape.cuh

@caugonnet caugonnet self-assigned this Jul 12, 2026
@caugonnet caugonnet added the stf Sequential Task Flow programming model label Jul 12, 2026
A hand-built dim4 can carry zero extents, which would make the modulo
undefined; real grids already assert positive dimensions, so this only
guards direct misuse.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@caugonnet

Copy link
Copy Markdown
Contributor Author

/ok to test 5a28243

@caugonnet caugonnet enabled auto-merge (squash) July 12, 2026 08:20
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 06m: Pass: 100%/57 | Total: 1d 00h | Max: 1h 06m | Hits: 14%/178813

See results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stf Sequential Task Flow programming model

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant