← Back to Pull requests

[AMDGPU] Give AV registers their own pressure set #243123

Open
unknown opened this pull request with 293 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 16, 2026 16:24 UTC
Author

Problem

  • AV register classes are in no pressure set, so RegPressureTracker ignores AV virtual registers.

  • Since #166483 most vector virtual registers stay AV until register allocation, so:

  • - the generic-tracker scheduler underestimates VGPR pressure;
    - EarlyMachineLICM hoists AV copies as if they were free.

    Fix

  • Set GeneratePressureSet on AV_32, so TableGen creates an AV_32 pressure set. It counts VGPRs, AGPRs and AV registers; the AV classes count only in it.

  • Limit the set to the VGPR budget with a unified register file, twice that on gfx908, and TableGen's limit without AGPRs.

  • The scheduler reads ArchVGPR pressure as AV_32 - AGPR_32, that is VGPRs and AV registers.

  • Set Weight = 1 on AV_32, like VGPR_32 and AGPR_32.
  • Performance evaluation

    116 cases on gfx950. Each case is one Triton op from aiter (aiter.ops.triton) or vLLM (awq_triton) at a real model shape: (N, K) from aiter's tuned gfx950 configs (gpt-oss, DeepSeek-V3/R1, Llama) and Llama-3-8B, M in {1, 16, 128, 2048}. Triton 3.6 emits the LLVM IR, and each llc compiles it with -O3 -relocation-model=pic. Trackers = main with -amdgpu-use-amdgpu-trackers=1.

    Static:

    | llc | instructions | code bytes | kernels with scratch | scratch instructions | occupancy vs main |
    |---|---:|---:|---:|---:|---|
    | main | 79,725 | 491,068 | 16 | 277 | |
    | this patch | 79,131 (−0.75%) | 486,312 (−0.97%) | 11 | 74 | 2 up, 0 down |
    | trackers | 79,373 (−0.44%) | 488,088 (−0.61%) | 6 | 44 | 3 up, 0 down |
    | this patch + trackers | 79,373 (−0.44%) | 488,088 (−0.61%) | 6 | 44 | 3 up, 0 down |

    Run time: one MI350, measured on c0005dfe81fe with the change behind a flag. Geomean of time / main's time (lower is better).

    | kernels | op | cases | this patch | trackers |
    |---|---|---:|---:|---:|
    | bf16 GEMM | aiter gemm_a16w16 | 28 | 0.729 | 0.734 |
    | fp8 GEMM | aiter gemm_a8w8 | 16 | 0.938 | 0.936 |
    | fp8 block-scaled GEMM | aiter gemm_a8w8_blockscale | 16 | 0.955 | 0.953 |
    | int4 AWQ GEMM | vLLM awq_gemm_triton | 6 | 0.936 | 0.900 |
    | MXFP4-weight GEMMs | aiter gemm_afp4wfp4, gemm_a16wfp4, gemm_a8wfp4 | 40 | 1.000 | 1.000 |
    | quantization | aiter dynamic_mxfp4_quant, dynamic_per_token_quant_fp8_i8; vLLM awq_dequantize_triton | 10 | 1.006 | 1.008 |
    | all | | 116 | 0.910 | 0.909 |

    Diff: 293 lines (+219 / -74) across 3 files Reviewer: lialan Review duration: 21240m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 293 lines diff across 3 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.340
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #243123"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 44.9% (MEDIUM) · Higher = larger blast radius
    44.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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 23.9% · Safe to merge
    23.9%