Skip to content

Specialize updates to pipeline states' index - help compiler DCE index - #3473

Open
manishucsd wants to merge 1 commit into
NVIDIA:mainfrom
manishucsd:manish/pipeline_state_opts
Open

Specialize updates to pipeline states' index - help compiler DCE index #3473
manishucsd wants to merge 1 commit into
NVIDIA:mainfrom
manishucsd:manish/pipeline_state_opts

Conversation

@manishucsd

@manishucsd manishucsd commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the PipelineState struct in sm90_pipeline.hpp (used for sm90+ arches) to improve the handling of pipeline stage advancement, especially for single-stage and multi-iteration scenarios. The main changes clarify and optimize how the pipeline state is updated.

Pipeline state advancement improvements:

  • Updated the operator++ to handle the single-stage (Stages == 1) case by toggling phase_ and incrementing count_, ensuring correct phase handling for Stages == 1 and maintaining the previous logic for Stages > 0.
  • Added a templated advance<NumIterations>() method to efficiently advance the pipeline state by a full traversal when NumIterations == Stages, toggling phase_ and updating count_.

In both changes skip updating index and make it easier for the compiler to DCE index for the pipeline guarding single-staged resource or multi-staged resource with index updates equal to Stages

@manishucsd manishucsd changed the title specialize updates to pipeline states' index - help compiler DCE index Specialize updates to pipeline states' index - help compiler DCE index Aug 18, 2026
@yzhaiustc

Copy link
Copy Markdown
Collaborator

LGTM; We should now be ready to merge this PR. @IonThruster

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