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
Path C: fail closed on unverified bank-grad overlay
Close the correctness holes found in the parameter-bank residency follow-up.
Root cause 1: bank residency alone is not enough to consume fused gradients.
The fused train-block needs runtime inputs (hidden_entry, target_ids,
target_mask) written into the ABI banks before artifact.value_and_grad runs.
Without the suffix-bypass custom-function surface, merged mode ran the kernel
against stale/zero inputs and then overwrote correct eager in-region grads
with bogus bank values. PathCFusedPlusEagerTrainingRuntime now fails closed:
when suffix-bypass is absent, it keeps the old warmup+eager behaviour and
never calls artifact.value_and_grad or overlays bank grad slots.
Root cause 2: the current fused suffix ABI advertises pending loss codegen.
The m04 installer now refuses to attach the suffix-bypass loss function when
_cppmega_path_c_train_step_suffix_loss_input_abi.reason contains pending, or
when the scalar output ABI does not report computed outputs. This keeps the
route available while preventing unverified suffix numerics from entering the
training critical path.
Also tighten write_into_bank_slot: dtype must match the generated ABI dtype
before slice assignment. MLX silently coerces float32 into int32 bank slots;
this now raises instead of hiding a dtype/layout bug.
Verification:
- ruff on touched files
- pyright on cppmega_mlx/runtime/path_c_physical_abi.py, cppmega_mlx/training/compiled.py, cppmega_mlx/training/path_c_fused_suffix.py; checked no new pyright errors in the touched m04 factory window
- pytest tests/test_path_c_physical_abi.py tests/test_path_c_fused_plus_eager_runtime.py tests/test_path_c_fused_suffix_custom_function.py tests/test_hybrid_lm_path_c_physical_abi_bank_owner.py tests/test_compiled_train.py -q: 91 passed
- pytest tests/test_m04_train_step.py -k "path_c or fused_train_block" -q: 66 passed
- pytest tests/v4/test_fusion_stage_{a,b,c,d,e,f}.py tests/v4/test_fusion_roadmap_gaps.py -q: 401 passed
- live local_gb10_quarter route: status=m04_path_c_training_route_available, suffix_bypass_available=False, bank_grad_overlay_active=False, merged_bank_resident_parameter_count=0, layers.10.block.D eager grad norm non-zero
Remaining work: re-enable suffix-bypass only after the TileLang generated suffix
loss/gradient code passes numerical parity against the eager path. Until then
Path C stays honest warmup/eager instead of silently training the wrong model.
0 commit comments