fix(hipfft): allow D2D copy when peer access is unavailable #14974
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 225 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.324
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #14974"
general
weight: 0.35
evetsso
Motivation
hipfftXtMemcpy with HIPFFT_COPY_DEVICE_TO_DEVICE returns HIPFFT_INTERNAL_ERROR on multi-GPU systems where direct peer access is unavailable. On a dual RX 7700 XT (Navi 32, gfx1101) Windows host, hipDeviceCanAccessPeer reports no direct access and hipDeviceEnablePeerAccess returns hipErrorInvalidDevice (101). p2p_enabler treated that as fatal and threw before any copy.
That is incorrect. The HIP runtime still completes hipMemcpyPeer and hipMemcpyPeerAsync in this case by staging through host memory. HIP documents that fallback for those APIs in ROCm/rocm-systems#14312. This unblocks the 24 hipfftXtGeneralizedUsage device-to-device cases tracked by ROCM-31629.
Technical Details
In p2p_enabler, remove the else branch that threw HIPFFT_INTERNAL_ERROR when hipDeviceCanAccessPeer returns can_access == 0.
When can_access == 1, peer access is still enabled as before. When it is 0, construction succeeds and the existing device-to-device path still calls hipMemcpyPeerAsync. HIP performs the host staging. hipFFT does not allocate a staging buffer or change the copy.
A closed earlier attempt, ROCm/rocm-libraries#13869, staged the copy inside hipFFT. That is unnecessary now that the runtime contract is documented.
Test Plan
Run full mathCI
Test Result
CI ongoing
Submission Checklist
Jira ID: ROCM-31629
[ROCM-31629]: https://amd-hub.atlassian.net/browse/ROCM-31629?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ