Skip to content

[hipfftw tests] Use reference_fft_data in hipfftw tests + avoid H2H copies for host-residing results - #7189

Merged
regan-amd merged 3 commits into
developfrom
users/regan-amd/reference_in_hipfftw_tests
Jul 8, 2026
Merged

regan-amd merged 3 commits into
developfrom
users/regan-amd/reference_in_hipfftw_tests

Conversation

@regan-amd

@regan-amd regan-amd commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation & technical details

The reference_fft_data structure introduced in #5590 can be used as is in hipfftw tests, simplifying and unifying logic across functional tests and alleviating some code duplications. This PR suggests to do that. Reference FFTW calculations systematically use default out-of-place data layouts as a result of this change. This PR also alleviates some unnecessary copies of host-residing data, upon completion of hipfftw plan execution in tests.
This results in a noticeable speedup for the hipfftw functional changes (about twice as fast on a gfx90a machine).

Test Plan

Current tests suffice.

Test Result

Tests pass.

Submission Checklist

@codecov-commenter

codecov-commenter commented May 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (76.92%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7189   +/-   ##
========================================
  Coverage    64.48%   64.49%           
========================================
  Files         2656     2656           
  Lines       419138   419138           
  Branches     62289    62289           
========================================
+ Hits        270279   270282    +3     
+ Misses      128384   128372   -12     
- Partials     20475    20484    +9     
Flag Coverage Δ *Carryforward flag
TensileLite 33.58% <ø> (ø) Carriedforward from d43536e
hipBLAS 90.81% <ø> (ø) Carriedforward from d43536e
hipBLASLt 34.71% <ø> (ø) Carriedforward from d43536e
hipCUB 82.68% <ø> (ø) Carriedforward from d43536e
hipDNN 86.00% <ø> (ø) Carriedforward from d43536e
hipFFT 50.17% <ø> (+0.07%) ⬆️
hipRAND 76.12% <ø> (ø) Carriedforward from d43536e
hipSOLVER 69.18% <ø> (ø) Carriedforward from d43536e
hipSPARSE 86.10% <ø> (ø) Carriedforward from d43536e
rocBLAS 48.06% <ø> (ø) Carriedforward from d43536e
rocFFT 46.34% <ø> (ø) Carriedforward from d43536e
rocRAND 57.04% <ø> (ø) Carriedforward from d43536e
rocSOLVER 76.92% <ø> (ø) Carriedforward from d43536e
rocSPARSE 72.37% <ø> (ø) Carriedforward from d43536e
rocThrust 91.36% <ø> (ø) Carriedforward from d43536e

*This pull request uses carry forward flags. Click here to find out more.
see 4 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 force-pushed the users/regan-amd/reference_in_hipfftw_tests branch from ee5f227 to d342e2e Compare May 8, 2026 03:23
@regan-amd
regan-amd marked this pull request as ready for review May 8, 2026 17:27
@regan-amd
regan-amd requested a review from a team as a code owner May 8, 2026 17:27
@regan-amd
regan-amd force-pushed the users/regan-amd/reference_in_hipfftw_tests branch 2 times, most recently from 58af0a6 to a090b7e Compare May 28, 2026 00:23
@regan-amd
regan-amd force-pushed the users/regan-amd/reference_in_hipfftw_tests branch 2 times, most recently from fc8c180 to 72fd154 Compare June 4, 2026 20:17
@regan-amd
regan-amd force-pushed the users/regan-amd/reference_in_hipfftw_tests branch from f541fbd to 3b17db3 Compare June 11, 2026 15:30
@regan-amd
regan-amd force-pushed the users/regan-amd/reference_in_hipfftw_tests branch from 3b17db3 to b8c1270 Compare June 23, 2026 20:01
@regan-amd
regan-amd force-pushed the users/regan-amd/reference_in_hipfftw_tests branch from c1fb677 to 869f43f Compare July 7, 2026 21:27
@therock-pr-bot

therock-pr-bot Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass —
📝 PR Title/Description ❌ Fail Error: Title is too long (100 characters).
Expected: at most 80 characters.
Desired format: type(optional-scope): short description
───
Error: Title does not follow Conventional Commits style.
Expected: start with a valid type (feat, fix, docs, …).
Desired format: type(optional-scope): short description
───
Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
• JIRA ID : TESTAUTO-6039
• JIRA ID - #330
• JIRA ID #330
• ISSUE ID : TESTUTO-3334
• ISSUE ID #3334
• ISSUE ID - TESTAUTO-3433
• ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
• Closes #10
• Fixes octo-org/octo-repo#100
• Resolves: #123
• #123
• https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 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

  • ❌ PR Title/Description

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.

@therock-pr-bot

therock-pr-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@regan-amd
regan-amd enabled auto-merge (squash) July 8, 2026 21:51
@regan-amd
regan-amd merged commit c4d932d into develop Jul 8, 2026
32 of 37 checks passed
@regan-amd
regan-amd deleted the users/regan-amd/reference_in_hipfftw_tests branch July 8, 2026 21:55
regan-amd added a commit that referenced this pull request Aug 8, 2026
…quired (#10494)

## Motivation

JIRA ID: ROCM-28393

Fix a possible crash (access violation) in hipfftw functional validation
tests, due to test-side bugs introduced in
#7189. A crash occurs
non-deterministically when consecutive tests share the same FFT
configuration (allowing cache reuse), and manifests as a NULL-plan
dereference inside by `fftw_execute_dft`. Copy operations from cached
reference-results to test buffers were also considering an incorrect
(possible too-large) batch size.

## Technical Details

`hipfftw_functional_validation::SetUp` unconditionally called
`initialize_input` and `launch_async_compute` on the
`reference_fft_data_t` object, even when its constructor successfully
picked up cached results from a previous test. Since `execute_cpu_fft`
destroys the FFTW plan after use, re-launching the async compute on
cached data passes a NULL plan to `fftw_execute_dft`, causing the access
violation. The fix guards both calls behind
`needs_input_initialization()` and `needs_computing()`, skipping
re-computation when the cache already holds valid results for the test
instance of interest.

## Test Plan

Current test base suffice. Manually tested on configurations found to
fail/crash.

## Test Result

Tests pass.

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
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.

3 participants