← Back to Pull requests

Fix overly strict broadcast_in_dim rank rejection #40082

Open
unknown opened this pull request with 149 lines diff across 1 files
View on GitHub
unknown unknown commented on Aug 18, 2026 20:57 UTC
Author

Fixes #40081.

In jax/experimental/mosaic/gpu/fragmented_array.py:broadcast_in_dim, we see the following:

    if len(layout.base_tile_shape) != len(shape):
      raise NotImplementedError(
          "Tiling rank different than broadcast result rank, "
          f"{layout.base_tile_shape} vs {shape}"
      )

This effectively prevents the shape from having length > 2. But this is unnecessary: what we really care about is that the untiled rank is above zero, where untiled_rank = len(shape) - len(layout.base_tile_shape). A leading axis outside of the tiling dimensions is okay.

This does expose two indexing bugs just below:

    new_dimensions = sorted(set(range(len(shape))) - set(source_dimensions))
    expected_layout = layout.reduce(new_dimensions)
    ...
    for new_dim in new_dimensions:
      for i, is_new in enumerate(layout.tiling.tile_dimension(new_dim)):

Here, new_dimensions are indices into the array dimensions, not the tile dimensions. But layout.reduce and tiling.tile_dimension expect tile indices, not array indices. We need to subtract untiled_rank from each of the new_dimensions to do the conversion.

Diff: 149 lines (+111 / -38) across 1 files Reviewer: bchetioui Review duration: 113778m
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 149 lines diff across 1 files
0.40
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%
44%
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.300
Real PR Conversation Timeline
1 comments
"Review active on #40082"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 44.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: 40.0% (MEDIUM) · Higher = larger blast radius
40.0%
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: 44.7% · Lower = rushed or shallow review
44.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: 22.1% · Safe to merge
22.1%
Repository