Spaces:
Running

harness-adapters: Inkling 2 Mini on TRL main (no fork, no patch) + OpenEnv 29c4287a

#13
by ybelkada HF Staff - opened

harness-adapters: Inkling 2 Mini on TRL main (no fork, no patch) + OpenEnv 29c4287a

The Inkling 2 Mini recipe no longer needs the TRL fork. huggingface/trl main now has what trl.patch added: tree packing for Inkling 2 Loop's attention and short convolutions (trl/kernels/tree_inkling2.py, FlexAttention) and adapter-only LoRA sync to vLLM. One thing is in neither TRL nor vLLM yet: vLLM loads an Inkling 2 adapter only under the checkpoint's module names (llm, attn.wq_du, ...), while PEFT on transformers' model saves language_model, self_attn.q_proj.linear, ... The recipe script now renames each adapter TRL publishes to vLLM.

  • Inkling-2-Mini/async_grpo_harbor.py: AsyncGRPOConfig from trl.trainer (TRL main), falling back to trl.experimental.async_grpo; vllm_lora_name passed only when the config has it (TRL main names adapters trl-policy-v{N}, one trainer per vLLM); publish_inkling2_adapters_under_vllm_names() wraps trl.trainer.async_grpo_trainer.save_lora_adapter so every synced adapter gets vLLM's names (safetensors header and target_modules rewritten, files replaced atomically, main rank only). Checkpoints keep transformers' names, so they resume as they are.
  • Inkling-2-Mini/train_hf_jobs.sh: installs trl @ git+https://github.com/huggingface/trl.git@$TRL_COMMIT (default bcd020ca, main) over the launcher's TRL instead of building a wheel from trl.patch; trl.patch is removed.
  • recipe.yaml / README: trl: {commit: bcd020ca}, so the site shows "TRL main" instead of "TRL fork". The HF Jobs "ran as written" flag is off until the job runs on TRL main.
  • OpenEnv pin 82faba6a -> 29c4287a in both launchers and the async_grpo_harbor.py copies (82faba6a plus two harness fixes: Codex's context compaction no longer fails the ATIF cross-check, openenv/OpenEnv#1790; CI configs copied into a task image no longer refuse the task for llm_url rollouts, 57 of 989 tasks of one training split, openenv/OpenEnv#1791). require_openenv checks both.
  • Pages regenerated with build.py --from-json (which reproduces the current Space byte for byte before the change).

Tested (no GPU): the adapter rename gives the same keys, tensors and config as the eval listener's renaming, which vLLM loads; it is idempotent; the wrapper renames what TRL main's _sync_weight saves (it calls save_lora_adapter by module name on every rank, before load_lora_adapter), on the main rank only, and is skipped on the fork. The launchers' and the script's dependency headers resolve with OpenEnv 29c4287a. A GPU smoke run on TRL main is pending, hence the "not run as written yet" label.

Follow-up: a vLLM change mapping transformers' Inkling 2 names in hf_to_vllm_mapper would make the rename unnecessary.

šŸ¤– Generated with Claude Code

ybelkada changed pull request status to open
ybelkada changed pull request status to merged

Sign up or log in to comment