Skip to content

fix(rocfft): fix GPU faults of fused Bluestein with unit batch distance - #13020

Merged
regan-amd merged 3 commits into
users/regan-amd/fix_fused_bluestein_buffer_assignmentfrom
users/regan-amd/fix_fused_bluestein_unit_distance
Oct 12, 2026
Merged

regan-amd merged 3 commits into
users/regan-amd/fix_fused_bluestein_buffer_assignmentfrom
users/regan-amd/fix_fused_bluestein_unit_distance

Conversation

@regan-amd

Copy link
Copy Markdown
Contributor

Motivation

JIRA ID: AIFFT-13, AIFFT-551 (issue found while working on that)

1D complex transforms of lengths involving large prime factors that use the multi-kernel fused Bluestein algorithm fail for inner-batched layouts (unit batch distance, i.e. idist = odist = 1 and istride = ostride = batch). On develop, such plans either fail in rocfft_plan_create or fault on the GPU at execution. With the previous PR in this stack, plan creation succeeds, but execution still faults.

Technical Details

The L1D_CC "dist 1" special case (CC1DNode::AssignParams_internal) reshapes its children's kernel launch geometry, swapping the batch and sub-FFT dimensions so that the batch dimension is the adjacent one. Fused Bluestein stages have already set their Bluestein strides and dists against the original geometry, so after the reshape their kernels index past the Bluestein buffer (GPU memory access fault in the sbcc_*_chirp_mul kernels).

The reshape is now skipped for fused Bluestein nodes (BT_MULTI_KERNEL_FUSED), keeping their launch geometry consistent with their Bluestein strides. This keeps the fused path (no fallback to non-fused Bluestein).

Test Plan

  • New fused_bluestein_non_unit_stride accuracy suite (9 tokens):
    • inner-batched (idist = odist = 1, istride = ostride = batch) fused Bluestein layouts: forward/inverse, single/double, in-place/out-of-place, including the AIFFT-13 reproducers (lengths 4182, 4167, 4128 with batches 2456, 1039, 8092);
    • general non-unit stride and non-unit dist fused Bluestein layouts.
  • Regression: prime_*, adhoc*, fused_bluestein* and all *_idist_1_* suites in full, plus a 5% sample of all other single-device suites.

Test Result

  • Before this stack: 6 of the new tokens fail in rocfft_plan_create; complex_inverse_len_8191_single_op_batch_8_..._idist_1_odist_1 faults on the GPU (sbcc_inv_chirp_mul).
  • After this change: all 9 new tests pass.
  • Regression (gfx1201): full suite pass, no failures.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/rocfft/clients/tests/accuracy_test_adhoc.cpp, projects/rocfft/library/src/tree_node_1D.cpp; no test file found
🔎 pre-commit ❌ Fail Error: Check concluded with cancelled.
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ pre-commit

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

Pre-commit check failed

⛔ pre-commit failed

Please run locally:

  • python -m pip install pre-commit
  • pre-commit install
  • pre-commit run --all-files --show-diff-on-failure

This repo uses .pre-commit-config.yaml.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
projects/rocfft/library/src/tree_node_1D.cpp 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                                    Coverage Diff                                    @@
##           users/regan-amd/fix_fused_bluestein_buffer_assignment   #13020      +/-   ##
=========================================================================================
+ Coverage                                                  71.88%   72.01%   +0.13%     
=========================================================================================
  Files                                                       2876     2876              
  Lines                                                     475561   475562       +1     
  Branches                                                   70287    70288       +1     
=========================================================================================
+ Hits                                                      341856   342473     +617     
+ Misses                                                    109940   109319     -621     
- Partials                                                   23765    23770       +5     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 49.67% <ø> (ø) Carriedforward from aab6641
TensileLite-Unit 83.44% <ø> (ø) Carriedforward from aab6641
hipBLAS 90.62% <ø> (ø) Carriedforward from aab6641
hipBLASLt 42.71% <ø> (ø) Carriedforward from aab6641
hipCUB 82.68% <ø> (ø) Carriedforward from aab6641
hipDNN 86.66% <ø> (ø) Carriedforward from aab6641
hipFFT 42.58% <ø> (ø) Carriedforward from aab6641
hipRAND 76.12% <ø> (ø) Carriedforward from aab6641
hipSOLVER 68.96% <ø> (ø) Carriedforward from aab6641
hipSPARSE 86.99% <ø> (ø) Carriedforward from aab6641
rocBLAS 48.17% <ø> (ø) Carriedforward from aab6641
rocFFT 48.88% <0.00%> (+1.85%) ⬆️
rocRAND 57.39% <ø> (ø) Carriedforward from aab6641
rocSOLVER 76.83% <ø> (ø) Carriedforward from aab6641
rocSPARSE 74.07% <ø> (ø) Carriedforward from aab6641
rocThrust 93.15% <ø> (ø) Carriedforward from aab6641

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
projects/rocfft/library/src/tree_node_1D.cpp 42.52% <0.00%> (-0.35%) ⬇️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@regan-amd
regan-amd marked this pull request as ready for review October 3, 2026 22:40
@regan-amd
regan-amd requested review from a team as code owners October 3, 2026 22:40
@regan-amd
regan-amd force-pushed the users/regan-amd/fix_fused_bluestein_unit_distance branch from ef7e865 to 47bab4d Compare October 8, 2026 21:09
@regan-amd
regan-amd force-pushed the users/regan-amd/fix_fused_bluestein_unit_distance branch from 47bab4d to 7b21aae Compare October 9, 2026 05:35
Fused multi-kernel Bluestein plans with interleaved batches (idist = odist
= 1, istride = ostride = batch) fail in rocfft_plan_create or fault on the
GPU.  Add a suite covering such layouts (forward/inverse, single/double,
in-place/out-of-place), plus general non-unit stride/dist cases.
The L1D_CC "dist 1" special case reshapes its children's kernel launch
geometry, swapping the batch and sub-FFT dimensions.  Fused Bluestein
stages have already set their Bluestein strides and dists against the
original geometry, so after the reshape the kernels index past the
Bluestein buffer and fault on the GPU.  Skip the reshape for fused
Bluestein nodes.
@regan-amd
regan-amd force-pushed the users/regan-amd/fix_fused_bluestein_unit_distance branch from 7b21aae to ebd3410 Compare October 9, 2026 18:31
@regan-amd
regan-amd merged commit 79c5f26 into develop Oct 12, 2026
109 of 126 checks passed
@regan-amd
regan-amd deleted the users/regan-amd/fix_fused_bluestein_unit_distance branch October 12, 2026 15:57
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants