Fix streaming-inference alignment with training-time contracts#108
Open
study-overflow wants to merge 1 commit into
Open
Fix streaming-inference alignment with training-time contracts#108study-overflow wants to merge 1 commit into
study-overflow wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We hit this while evaluating LingBot-VA on streaming-inference mode: training loss was healthy and teacher-forced open-loop predictions were accurate, but closed-loop rollouts still collapsed with the same checkpoint — a symptom of inference-side train/test mismatch that compounds across chunks.
Fixes two streaming-inference bugs that decouple closed-loop rollout behavior from training.
Cold-start action conditioning now uses physical zero
torch.zerosdecoded to the per-channel statistical midpoint(q01 + q99) / 2instead of a physical zero action._make_zero_action_condition()that starts from physical zero, applies the same quantile normalization as training, and masks unused channels.KV-cache attention visibility now matches training mask
frame_idper slot,set_frame_context(), and_select_valid_cache_slots()to reproduce the training visibility rules exactly.Validation:
py_compileclean;git diff --checkclean.Files changed: