Align Normalizer zero-delta handling with LeRobot training collator#112
Merged
Conversation
Collaborator
|
Thanks @Papaercold — this is a clean, correct fix and the diagnosis in #113 is spot on. The training-side LeRobot collator already guards I confirmed the fix is also complete: Merging. Thanks for the careful report and fix — much appreciated! 🙏 |
StarrickLiu
pushed a commit
to StarrickLiu/wall-x
that referenced
this pull request
Jul 22, 2026
Full regenerated snapshot of the public tree from the internal refactor_2604 export pipeline (delete + overwrite). Only the intended changes remain vs the previous release (stale public_overlay drift was synced back first, so no published hotfix / dependency bump is reverted): - Bake MoE / rmsnorm / silu / m_rope CUDA kernels, compiled at install time; training MFU reaches internal parity (~53%). - Fix the m_rope rope-convention (fp32 cos) so LIBERO eval runs on the vanilla model path. - Replace the closed opt serving stack with an opt-free vanilla websocket serving path (WallXVanillaPolicy + launch_vanilla_serving). - Ship wall_x/distributed; strip robotwin/vga; exclude non-LIBERO subsystems (rl / eval / jax_openpi / VGA data). - DMuon support: libero_dmuon.yml + dmuon git dependency; recommended DMuon LRs (muon_lr=1e-4 / adamw_lr=5e-5) on all LIBERO configs. - Keep the published X-Square-Robot#112 normalizer divide-by-zero guard; keep torch==2.10 / transformers==5.2 dependency pins and the full pyproject config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
StarrickLiu
pushed a commit
to StarrickLiu/wall-x
that referenced
this pull request
Jul 22, 2026
…bsocket serving, DMuon LIBERO configs - Bake fused CUDA kernels (two_expert MoE / rmsnorm / silu / rope) into csrc/ with install-time CUDAExtension build (reaches internal-parity training MFU ~53%). - Add minimal vanilla websocket serving (run_serving.sh + vendored harrix policy) validated bit-identical to the eval predict_batch path. - DMuon LIBERO/lerobot configs use recommended LRs (muon_lr=1e-4, adamw_lr=5e-5) + ZeRO-2; add libero_dmuon.yml. - Preserve published hotfixes (X-Square-Robot#110 arXiv links, X-Square-Robot#112 normalizer delta==0 guard) and richer public scripts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
StarrickLiu
pushed a commit
to StarrickLiu/wall-x
that referenced
this pull request
Jul 22, 2026
…bsocket serving, DMuon LIBERO configs - Bake fused CUDA kernels (two_expert MoE / rmsnorm / silu / rope) into csrc/ with install-time CUDAExtension build (internal-parity MFU ~53%). - Ship the opt-free vanilla websocket serving stack (launch_vanilla_serving + WallXVanillaPolicy) validated bit-identical to the eval predict_batch path; run_serving.sh exposes the full vanilla CLI and rejects full-stack-only flags with guidance. Returns raw action chunks. - DMuon LIBERO/lerobot configs use recommended LRs (muon_lr=1e-4, adamw_lr=5e-5) + ZeRO-2; add libero_dmuon.yml. - Preserve published hotfixes (X-Square-Robot#110 arXiv links, X-Square-Robot#112 normalizer delta==0 guard) and the richer public scripts (restored from oss2/published). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
StarrickLiu
pushed a commit
to StarrickLiu/wall-x
that referenced
this pull request
Jul 23, 2026
…rving, restructured-harrix vendoring, DMuon LIBERO configs - Bake fused CUDA kernels (two_expert MoE / rmsnorm / silu / rope) into csrc/ with install-time CUDAExtension build (internal-parity MFU ~53%). - Vendor the restructured harrix (e2e_infer / model_executors / serving.replica + handlers/monitoring) for the LIBERO eval + vanilla websocket serving; the vanilla policy path is validated bit-identical to the eval predict_batch. - run_serving.sh exposes the full vanilla CLI and rejects full-stack-only flags with guidance; returns raw action chunks. - DMuon LIBERO/lerobot configs use recommended LRs (muon_lr=1e-4, adamw_lr=5e-5) + ZeRO-2; add libero_dmuon.yml. - Preserve published hotfixes (X-Square-Robot#110 arXiv links, X-Square-Robot#112 normalizer delta==0 guard). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Fix a zero-delta normalization mismatch between the LeRobot training collator and the shared model normalizer.
During fine-tuning + evaluation, I observed a case where training loss looked normal, but evaluation produced all-NaN action vectors. I traced this to
Normalizer.normalize_data()dividing by a zero normalization delta.Problem
The LeRobot training collator already handles zero deltas safely in:
This training-side normalization is used for
agent_poshere:and for
actionhere:So during training, if a dimension has
delta == 0, the collator replaces that delta with1before division.However, the shared normalizer in:
previously divided directly by
self.delta[dataset_name]. For constant action/state dimensions, the normalization stats can have:Then normalization can produce
0 / 0 -> NaN.torch.clamp()does not remove NaNs, so these values can propagate into evaluation/inference actions.This explains the behavior I saw:
Fix
This PR updates
Normalizer.normalize_data()to use the same zero-delta guard as the LeRobot training collator:This does not change tensor shapes or nonzero-delta behavior. It only prevents division by zero for zero-range dimensions.
Validation
I reproduced the issue in a fine-tuning + evaluation workflow where predicted actions became all NaNs. After this change, the same workflow no longer produced all-NaN action vectors.