← Back to Pull requests

fix(miopen): Fix MultiMarginLoss Windows p width (ALMIOPEN-3424) #16287

Closed
unknown closed this pull request without merging on Nov 19, 2026 16:57 UTC
View on GitHub
unknown unknown commented on Nov 18, 2026 23:59 UTC
Author

JIRA ID : ALMIOPEN-3424
JIRA ID : ROCM-32541

Motivation

Windows x64 packs long as four bytes, while the MultiMarginLoss kernel expects an eight-byte int64_t. The mismatch corrupts p and the following margin and tensor-view arguments, causing incorrect results and HIP launch failures.

Technical Details

Change multimarginloss::InvokeParams::p to int64_t, include <cstdint> directly, and add a MIOpen changelog entry. Both reduction and non-reduction launches already pass this field. The public API remains long; its supported values 1 and 2 widen losslessly when stored.

Risk Assessment

Risk Level: 🟢 Low — two files, limited to MultiMarginLoss invocation metadata and its release note.

Impacted Components

MIOpen MultiMarginLoss forward argument packing for FP32, FP16, and BF16.

Potential Side Effects

Windows argument packing changes to match the existing kernel signature. Linux already uses eight-byte long. Kernel math, solver selection, workspace sizing, and public API signatures are unchanged.

Mitigation Steps

Keep the existing numerical regression suite unchanged; it covers p=1/2, all reduction modes, and contiguous/strided tensors. Scope excludes the other portability audit findings.

Test Plan

  • Existing Smoke/GPU_MultiMarginLoss_* GoogleTest suites provide numerical regression coverage; no duplicate tests were added.

  • Validate this PR commit on Windows GFX1170 with the existing FP32, FP16, and BF16 suites before marking it ready for review.
  • Test Result

  • Local Docker smoke using the actual invocation header and kernel argument packer: fixed layout 12/12 correct; simulated Windows 32-bit-long control 0/12 correct. Covers p=1/2, all reduction modes, and contiguous/strided views.

  • Scoped repository pre-commit checks passed for both changed files.

  • Windows GFX1170 A/B results,: control failed six FP32 cases, then HIP unspecified launch failure, exit 3; equivalent field fix passed FP32 12/12, exit 0, and all three datatype suites 32/32.
  • Diff: 258 lines (+193 / -65) across 3 files Reviewer: JonathanLichtnerAMD Review duration: 1017m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 258 lines diff across 3 files
    0.39
    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%
    56%
    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.332
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16287"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 39.2% (MEDIUM) · Higher = larger blast radius
    39.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: 56.8% · Lower = rushed or shallow review
    56.8%
    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.9% · Safe to merge
    16.9%