Skip to content

cont_engine: evaluate a zero-volume general product through a tile-less evaluator - #590

Draft
kshitij-05 wants to merge 3 commits into
masterfrom
kshitij/fix/zero-volume-general-product
Draft

kshitij-05 wants to merge 3 commits into
masterfrom
kshitij/fix/zero-volume-general-product

Conversation

@kshitij-05

Copy link
Copy Markdown
Member

init_distribution_general already skips the process grid for a zero-volume result (ProcGrid needs at least one row and one column), but make_dist_eval_general still built the SUMMA evaluator and its slabbed pmap from proc_grid_, tripping TA_ASSERT(world_) in ProcGrid::make_pmap.

Fix: a zero-volume result is evaluated through ZeroVolumeEvalImpl, a DistEvalImpl that owns no tiles and produces nothing. Hit by a shape-imposed tensor-of-tensor product whose sliced mode had no tiles.

kshitij-05 and others added 3 commits September 17, 2026 13:02
…ss evaluator

init_distribution_general skips the process grid for a zero-volume result
(ProcGrid needs at least one row and one column), but make_dist_eval_general
still built the SUMMA evaluator and its canonical slabbed pmap from
proc_grid_, tripping TA_ASSERT(world_) in ProcGrid::make_pmap. The result has
no tiles, so evaluate it through ZeroVolumeEvalImpl, a DistEvalImpl that owns
no tiles and produces nothing. Hit by a shape-imposed ToT product whose
sliced aux mode had no tiles.
It is a DistEvalImpl that owns no tiles, not a contraction detail, so it
belongs next to the other distributed evaluators rather than in
expressions/cont_engine.h -- which also relied on picking up DistEvalImpl
transitively through dist_eval/contraction_eval.h. Installed alongside the
other dist_eval headers.
A result mode with no tiles makes the general product's result zero-volume,
which is the corner case where init_distribution_general skips the process
grid. Covers all three ways the result volume vanishes -- an empty left
external (M == 0), fused (n_slabs_ == 0), and right external (N == 0) mode --
with canonical and repermuted targets, dense and block-sparse. Four of those
six combinations abort without the ZeroVolumeEvalImpl path (TA_ASSERT(world_)
in ProcGrid::make_pmap, or nh_ > 0 in contraction_eval). Also pins the
adjacent case that must keep taking the ordinary path: an empty *contracted*
mode, whose result still has tiles and is zero.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants