Backport smolvla grpo API hooks#3509
Draft
kufupa wants to merge 1 commit intohuggingface:mainfrom
Draft
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.
Title
feat(policies): backport smolvla grpo api hooks
Summary / Motivation
This PR ports SmolVLA GRPO API support from a local, working
lerobotruntime patch into the upstreamhuggingface/lerobotrepository in a minimal, isolated change. It updatesSmolVLAPolicyto expose distribution-parameter access for GRPO-style training paths and aligns call patterns with current policy module imports used in the runtime. This is needed to unblock GRPO experiments relying on probability-distribution parameters (_get_distr_params_chunk) without altering environment setup or external runtime behavior outside this policy surface.Related issues
#(if any)#(if any)What changed
src/lerobot/policies/smolvla/modeling_smolvla.pyfrom the local patched environment runtime into this repo:_get_distr_params_chunkfor GRPO distribution-parameter path.distr_queuequeue bookkeeping setup inSmolVLAPolicy.select_actionflow to handle the new model sampling tuple shape (actions, _ = model.sample_actions(...)).modeling_smolvla.pyto use the current in-repo policy module paths.No breaking changes expected. No migration required beyond updating downstream GRPO callers to use the available
_get_distr_params_chunkpath when needed.How was this tested (or how to run locally)
pre-commit run -a(failed:pre-commitnot installed in this environment).python -m pytestattempts were blocked by missing ML dependencies (torchnot installed in this VM), so full local test run could not complete.git checkout pr/port-smolvla-grpo-env-patchpython -m pytest -q tests/policies/smolvla/test_smolvla_rtc.pypre-commit installpre-commit run -aChecklist (required before merge)
pre-commit run -a)pytest)Reviewer notes
src/lerobot/policies/smolvla/modeling_smolvla.py, especially:_get_distr_params_chunkselect_actionreturn-shape handlingsrc/lerobot/policies/smolvla/modeling_smolvla.py).