Skip to content

Let scan tuning policy choose warpspeed or not - #8158

Merged
bernhardmgruber merged 20 commits into
NVIDIA:mainfrom
bernhardmgruber:scan_use_warpspeed_in_policy
Apr 9, 2026
Merged

bernhardmgruber merged 20 commits into
NVIDIA:mainfrom
bernhardmgruber:scan_use_warpspeed_in_policy

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

The motivation for this change is that now users can pick the underlying implementation and enforce that choice, which leads to compilation errors if the chosen implementation is not viable (e.g. exceeds 48KiB SMEM, or exceeds registers, or the PTX ISO is too low).

This is also what we need for tuning. We want to enforce a certain scan implementation and fail to compile if the tuning framework selects parameters that are not viable.

Fixes: #8028

@bernhardmgruber
bernhardmgruber requested review from a team as code owners March 24, 2026 17:03
@bernhardmgruber
bernhardmgruber requested a review from shwina March 24, 2026 17:03
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Mar 24, 2026
@bernhardmgruber
bernhardmgruber marked this pull request as draft March 24, 2026 17:03
@copy-pr-bot

copy-pr-bot Bot commented Mar 24, 2026

Copy link
Copy Markdown
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.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Mar 24, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Review to In Progress in CCCL Mar 24, 2026
@github-actions

This comment has been minimized.

@bernhardmgruber
bernhardmgruber force-pushed the scan_use_warpspeed_in_policy branch 2 times, most recently from 6b84735 to 175e58c Compare March 30, 2026 16:32
@bernhardmgruber
bernhardmgruber marked this pull request as ready for review March 30, 2026 16:41
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Mar 30, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@bernhardmgruber
bernhardmgruber force-pushed the scan_use_warpspeed_in_policy branch from 39df475 to 289d74c Compare April 1, 2026 20:46
@bernhardmgruber
bernhardmgruber requested a review from a team as a code owner April 1, 2026 21:36
@bernhardmgruber
bernhardmgruber requested a review from wmaxey April 1, 2026 21:36
@github-actions

This comment has been minimized.

@bernhardmgruber
bernhardmgruber force-pushed the scan_use_warpspeed_in_policy branch from ea541e5 to 3aa7edc Compare April 7, 2026 08:41
@github-actions

This comment has been minimized.

@bernhardmgruber
bernhardmgruber force-pushed the scan_use_warpspeed_in_policy branch from 3aa7edc to 5c6d621 Compare April 9, 2026 08:30
@bernhardmgruber

bernhardmgruber commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor Author

I see SASS diffs for SM100 and SM120. Almost exclusively in the setup code around the SMEM allocator. More instructions are generated.

@miscco miscco 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.

I shudder from the complexity of all that tuning

Comment on lines 194 to 196
#if _CCCL_CUDACC_AT_LEAST(12, 8)
_CCCL_GRID_CONSTANT
_CCCL_GRID_CONSTANT
#endif // _CCCL_CUDACC_AT_LEAST(12, 8)

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.

Are we sure this is still needed, I thought that _CCCL_GRID_CONSTANT is only used above 12.8

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The DeviceScanKernel entry point is also used for the old scan implementation, so yes, we still need that.

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.

Oh I meant whether we need the conditional compilation

Comment on lines +113 to +115
constexpr auto policy = get_warpspeed_policy<PolicySelector>();
setup_scan_resources(
get_warpspeed_policy<PolicySelector>(),
policy,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This fixed the SASS regression. The tuning policy was computed at runtime. We should be careful in the future to always put a tuning policy into a constexpr variable before accessing it.

@github-actions

This comment has been minimized.

@miscco

miscco commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

So, something here breaks CCCL.C.

That looks like an invalid value passed

/home/coder/cccl/c/parallel/test/algorithm_execution.h:154: FAILED:
    {Unknown expression after the reported line}
  due to a fatal error condition:
    SIGFPE - Floating point error signal
 

@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

I can't reproduce it locally. Seems it's in the old scan implementation.

@bernhardmgruber
bernhardmgruber force-pushed the scan_use_warpspeed_in_policy branch from 8a365ab to f497303 Compare April 9, 2026 13:04
@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

Found it. I selected the warpspeed tuning even on older architectures, which led to a division by zero in the host code. Fixed.

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 28m: Pass: 100%/275 | Total: 6d 09h | Max: 1h 23m | Hits: 85%/177731

See results here.

@NaderAlAwar NaderAlAwar 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.

C and benchmark parts look good

@bernhardmgruber
bernhardmgruber merged commit cf1a8ef into NVIDIA:main Apr 9, 2026
291 of 294 checks passed
@bernhardmgruber
bernhardmgruber deleted the scan_use_warpspeed_in_policy branch April 9, 2026 16:21
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Apr 9, 2026
jainishmehta pushed a commit to jainishmehta/cccl that referenced this pull request Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Allow to control SMEM check in warpspeed scan

3 participants