← Back to Pull requests

Add optional residual add to gemm op #1975

Closed
unknown closed this pull request without merging on Jan 14, 2026 03:21 UTC
View on GitHub
unknown unknown commented on Jan 11, 2026 01:46 UTC
Author

Currently fuse residual add with bias/activation. But setup for possible future fusion with gemm e.g. https://github.com/sssshhhhhh/CTranslate2/blob/rocm/src/ops/gemm_gpu.cu
From benchmarking whisper encoder, Add should only be the residual adds so this should save ~3%.
Implementing gemm fusion should then get a further ~8%

 37.34%  37.34%  37.34% SoftMax                 56.99ms
 21.03%  29.76%  58.36% Gemm                    32.09ms
 13.20%  13.20%  71.56% MatMul                  20.15ms
  8.73%   8.73%  80.29% BiasAdd                 13.32ms
  4.43%   4.43%  84.72% LayerNorm               6.76ms
  3.96%  76.65%  88.68% MultiHeadAttention      6.04ms
  3.74%   3.74%  92.42% Transpose               5.71ms
  3.34%   3.34%  95.76% Add                     5.09ms
  1.82%   1.82%  97.58% Split                   2.78ms
  1.34%  98.77%  98.92% TransformerEncoderLayer 2.05ms
  0.36%   0.62%  99.28% Conv1D                  0.55ms
  0.19%  50.73%  99.47% dot_product_attention   0.29ms
  0.12%  99.74%  99.59% WhisperEncoder          0.18ms
  0.09%   0.09%  99.69% GELU                    0.14ms
  0.05%  99.79%  99.74% WhisperReplica::encode  0.08ms
  0.05%  29.55%  99.79% Dense                   0.08ms

Add axis arg to BiasAdd for future bias/gelu fusion in conv1d.
Expand gemm test suite which found a problem with trans_a gemm where the output size was set wrong
Increased acceptable bf16 error from 1e-2 to 4e-2 and removed the various * 10

Diff: 186 lines (+139 / -47) across 2 files Reviewer: jordimas Review duration: 4415m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.36) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 186 lines diff across 2 files
0.36
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.313
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1975"
general weight: 0.35
Reviewers
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: 35.8% (MEDIUM) · Higher = larger blast radius
35.8%
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: 15.5% · Safe to merge
15.5%