You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the DOOM forward, CP-SAT returned INFEASIBLE and forward_compile
silently fell back to the heuristic at every width where residual width
was binding (d <= 6400), so optimize>0 was secretly optimize=0. The model
proved infeasible on schedules the heuristic compiles fine, because it
over-counted two resources versus the heuristic it must replay:
1. BIRTH-dirty over-count (attention-head cumulative). The model charged
a full-width dirty cancel to EVERY fresh allocation; the heuristic only
clears the initial-pool dirty subset (recycled columns are already
clean). Under width pressure columns recycle constantly, so the model
charged hundreds of columns of phantom cancels and the pooled attention
cumulative overflowed. Fix: compile_to_onnx / compile_headless_to_onnx
default assume_zero_init=True -- the ONNX runtime always builds the
residual stream from zeros, so the dirty cancels are unnecessary and
model and replay both skip them.
2. Input-pinning over-reservation (residual cumulative). The model
reserved every input column forever (available_residual = d -
input_residual), but the heuristic frees consumed inputs and recycles
their columns (the 600+-wide token Embedding is freed early to carry
the geometry-stage intermediates). Fix: every input except pos_encoding
is now modelled as a freeable residual interval [0, cancel); the cancel
layers are written into the assignment and DirectedLayerScheduler frees
the inputs at replay.
Result on the DOOM forward: d=6400 solves FEASIBLE at 32 layers (heuristic
40), d=11200 at 28 (heuristic 34). The residual floor (d <= 3040, where
the heuristic runs at ~100% residual occupancy) still falls back -- the
model cannot represent the heuristic's within-layer eager freeing -- but
the fallback is now loud, not silent.
Supporting changes:
- Extract build_cpsat_model from solve_schedule (behavior-preserving) so
the model has one definition, plus a diagnostic constraint-family toggle.
- forward_compile(require_solver=True) raises instead of silently falling
back; the default path warns (RuntimeWarning) and surfaces SolveStats on
net.cpsat_solve_stats.
- Tests: input-freeing regression + require_solver guard.
- docs/cpsat_scheduler.md updated for the residual budget, the BIRTH-dirty
conservatism, and the eager-free limitation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments