Skip to content

Commit 97c11ee

Browse files
hmgaudeckerclaude
andcommitted
Declare the dead regime's assets grid non-distributed
The terminal `dead` regime carries only a tiny `[pref_type, assets]` value function. Inheriting the distributed `assets` grid made its V-array topology claim a sharded assets axis, while the solver emits a replicated array — a mismatch that surfaces as an opaque XLA sharding error mid-solve on multi-GPU runs. Sharding a terminal 3x24 V-array buys nothing; declare `assets` non-distributed for `dead`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 39ac270 commit 97c11ee

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/aca_model/baseline/regimes/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def build_dead_regime(grids: Grids) -> Regime:
449449
"utility_scale_factor": preferences.utility_scale_factor,
450450
},
451451
states={
452-
"assets": grids.assets,
452+
"assets": grids.assets.replace(distributed=False),
453453
"pref_type": grids.pref_type,
454454
},
455455
active=lambda _age: True,

tests/test_model_creation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ def test_dead_regime_is_terminal() -> None:
5858
assert model.user_regimes["dead"].terminal
5959

6060

61+
def test_dead_regime_assets_grid_not_distributed() -> None:
62+
"""The terminal `dead` regime declares its `assets` grid non-distributed.
63+
64+
`dead` carries only a tiny `[pref_type, assets]` value function;
65+
sharding its assets axis across devices buys nothing and makes its
66+
V-array sharding disagree with what the multi-GPU solve produces for
67+
the regimes that transition into it.
68+
"""
69+
dead = build_regime("dead")
70+
assert dead.states["assets"].distributed is False
71+
72+
6173
def test_non_terminal_regimes_not_terminal() -> None:
6274
model = make_baseline_model(n_subjects=1)
6375
for name in REGIME_SPECS:

0 commit comments

Comments
 (0)