← Back to Pull requests

fix(hipfft): allow D2D copy when peer access is unavailable #14974

Closed
unknown closed this pull request without merging on Nov 05, 2026 03:08 UTC
View on GitHub
unknown unknown commented on Nov 03, 2026 15:24 UTC
Author

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

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Jira ID: ROCM-31629

    [ROCM-31629]: https://amd-hub.atlassian.net/browse/ROCM-31629?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    Diff: 225 lines (+168 / -57) across 2 files Reviewer: evetsso Review duration: 2144m
    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
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.9% (MEDIUM) · Higher = larger blast radius
    36.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.6% · Safe to merge
    14.6%