Fix lerobot fine-tuning out of the box: version-robust checkpoint loading, optional flash-attn, episode passthrough#102
Open
Liyux3 wants to merge 2 commits into
Open
Conversation
…ding, optional flash-attn, episode passthrough - Adapt fused checkpoint projections (qkv_proj_experts / gate_up_proj) to split module naming when the installed transformers builds split tensors; previously ~700 tensors were silently skipped by strict=False and the vision/LM experts stayed randomly initialized - Re-initialize (instead of crash) checkpoint tensors whose shapes disagree with a customized dof_config, and print a load report - Make flash_attn optional (not in requirements.txt; sdpa/eager never use it) - Honor lerobot_config.episodes for explicit train episode selection - Propagate use_selective_recompute on the wall-oss from_pretrained branch - Add opt-in train_action_preprocessor for customized-dof fine-tuning under freeze_vlm
save_checkpoint referenced self.data_config (the attribute is dataload_config) and dataset pool cursors that lerobot datasets do not have, so any checkpoint save during lerobot fine-tuning raised AttributeError. Guard the dataset-cursor block and read multimodal_data_ratio from the config.
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
Following the workspace README to fine-tune wall-oss-0.5 on a custom lerobot dataset currently breaks in several environment-dependent ways. This PR makes that path work out of the box:
Version-robust checkpoint loading (
modeling_qwen2_5_vl_act.py)qkv_proj_experts.*,gate_up_proj). With transformers versions that build split modules (e.g. 4.51.x, which is needed anyway sinceAttentionInterfacedoes not exist in the pinned 4.49.0),load_state_dict(strict=False)silently skips ~700 tensors: all LM attention/MLP expert weights and every vision-tower MLP stay randomly initialized while training appears to run normally. This PR slices fused tensors into the split naming, with split sizes taken from the model's own state_dict (HF concat order q;k;v / gate;up), so it is a no-op on environments where names already match.dof_config(e.g. the 26-dim multi-embodiment action projections vs a custom single-arm config) previously raisedRuntimeErroreven withstrict=False; they now re-initialize with a clear message, which is the expected behavior when adapting to a new embodiment per the workspace README.Optional flash-attn (
joint_attention.py):flash_attnis imported at module level but is not listed inrequirements.txt, so a fresh install crashes at import. It is now optional; only the flash_attention_2 attention class needs it, sdpa/eager paths never call it.Episode list passthrough (
load_lerobot_dataset.py):lerobot_config.episodesexists in the config template but was ignored; the loader always used a sequential train/test split. Honoring it allows holding out evaluation episodes.use_selective_recomputepassthrough (qwen_vl_act_trainer.py): the wall-oss branch dropped this flag when callingfrom_pretrained, silently disabling selective recompute.Opt-in
train_action_preprocessor(qwen_vl_act_trainer.py): withfreeze_vlm: trueand a customizeddof_config, the freshly re-initialized action in/out projections were frozen at random init. The new flag keeps them trainable alongside the experts; defaultfalsepreserves current behavior.Validation
Fine-tuned wall-oss-0.5 on a custom 7-DoF single-arm lerobot dataset (3 cameras, joint space + gripper), transformers 4.51.3 / torch 2.10 / python 3.12 / RTX 4090 (sm_89):
lm_head,propri_projwhich is absent from the released checkpoint, and the two intentionally re-initialized action projections)freeze_vlm+ selective recompute, bf16, bs1Note
requirements.txtpinstransformers==4.49.0, butwall_x/model/vla_mixin.pyimportsAttentionInterface, which does not exist in 4.49; the pin may want a bump to >=4.50 in a separate change.