← Back to Pull requests

[gfx1250] Add MXFP4 GEMM support to FlyDSL backend #786

Closed
unknown closed this pull request without merging on Nov 11, 2026 14:17 UTC
View on GitHub
unknown unknown commented on Oct 30, 2026 15:05 UTC
Author

Description

Adds MXFP4 dense GEMM support for gfx1250 as part of the FlyDSL GEMM backend for training. Preliminary support does not have activation/bias, which is intended for a follow-up PR.

Fixes AMD-ROCm-Internal/frameworks-internal#394

Pipeline structure

All operands stream through LDS with no K-dependent allocation; total LDS use is a constant 144 KB.

  • Data tiles — 3-stage pipeline. A and B each get NUM_STAGES = 3 LDS pages (BLOCK_M×16 words per page). Each K-loop iteration issues one TDM load into page j % 3 while the MMA consumes an earlier page, giving ~2 iterations of load/compute overlap. In steady state a K-tile is loaded by 4 waves (TDM_GROUP_WAVES): 2 split A's 256 rows into halves (TDM_WAVES), 2 split B's.

  • Scales — 2-stage, grouped pipeline. SCALE_STAGES = 2 LDS pages each hold SCALE_GROUP = 8 K-tiles of scales (16 KB per operand). The prologue loads groups 0–1; thereafter, every 8th iteration the tile-load also streams the next scale group into page g % 2, sharing that iteration's wait slot. On those scale-refill iterations the data load switches from 2×half-tile to 1×full-tile to free two waves for the scale groups.

  • Registers — double-buffered. frag_A/B/sA/sB are 2-deep; tile k+1 is read into set k%2 while gemm_step(k) runs, interleaving next-tile LDS reads with current WMMAs.

  • Epilogue — 2-pass C store. The output tile is written in two C_HALF_ROWS = 128-row halves, staged register→LDS→global (TDM) through the LDS region reused from the K-loop, serialized so half 1 reuses half 0's buffer.
  • Performance

    https://github.com/AMD-ROCm-Internal/frameworks-internal/issues/394#issuecomment-6525965976

    Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

  • Infra/Build change

  • Code refactoring
  • Changes

    Please list the changes introduced in this PR:

  • Change A

  • Change B
  • Checklist:

  • I have read and followed the contributing guidelines

  • The functionality is complete

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation

  • My changes generate no new warnings

  • I have added tests that prove my fix is effective or that my feature works

  • New and existing unit tests pass locally with my changes
  • Diff: 334 lines (+250 / -84) across 4 files Reviewer: aris134 Review duration: 17231m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 334 lines diff across 4 files
    0.42
    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.348
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #786"
    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: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    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: 16.7% · Safe to merge
    16.7%