Skip to content

Reorg to training/{sft,rl} + binary-parquet verl loader (patch)#6

Open
bsabri wants to merge 7 commits into
mainfrom
reorg/training-layout
Open

Reorg to training/{sft,rl} + binary-parquet verl loader (patch)#6
bsabri wants to merge 7 commits into
mainfrom
reorg/training-layout

Conversation

@bsabri

@bsabri bsabri commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reorganizes the repo into a clearer top-level layout and makes the omni / fork GRPO+SFT path runnable on the parquet distribution of HBA — without needing write access to the verl fork.

1. Folder reorg (no behavior change)

  • sft/training/sft/
  • grpo/training/rl/
  • misc_eval_utils/evaluation/
  • OMNI_TRAINING.md, PARQUET_TRAINING.md, and a new CODE_STRUCTURE.mddocs/
  • Updated every path reference in run_grpo.sh / run_tarpo.sh, the README, docs, and .gitignore. The verl/ submodule stays at the repo root.

2. Binary-parquet data loader (the missing piece)

The HBA parquet embeds media (audio/video/image) as raw bytes (list<binary>). The pinned verl/ submodule (DDVD233/verl@hba_public_release) only handles string-path media, so training directly on the parquet fails with pyarrow.lib.ArrowInvalid: Invalid UTF8 payload.

Rather than modifying the pinned submodule, this PR carries the loader as an applyable patch:

  • patches/0001-hba-binary-parquet-loader.patch — lazy binary decode (_detect_binary_media / _read_files_lazy / _lazy_get_row), raw-bytes branches in audio_utils/vision_utils, the new count_mm_tokens.py, the modality-sampler lazy fast-path in main_ppo.create_rl_sampler, and Qwen2.5-Omni model detection (_is_qwen_omni, by config.json model_type).
  • scripts/setup_verl.sh — idempotently inits the submodule and applies the patch. No write access to the verl fork required.

Run once after cloning:

bash scripts/setup_verl.sh

Validation (4× NVIDIA H20)

  • GRPO — 20 steps on the embedded-binary parquet: reward mean trended ≈ 0.59 → 0.84+; rollout → reward → actor update all healthy. (Per-step reward is noisy by design — modality-homogeneous batches.)
  • SFT — Qwen2.5-Omni-7B LoRA: loss 6.66 → ~0.6 over the first ~11 steps.

Notes

  • The verl/ submodule pointer is unchanged (still pinned at hba_public_release); the fix is applied on top via the patch.
  • Without the patch, parquet training fails at load with Invalid UTF8 payload.
  • See docs/CODE_STRUCTURE.md for the full layout and a description of the loader additions.

bsabri added 7 commits June 30, 2026 16:35
Group the training pipelines under training/ (sft/ -> training/sft, grpo/ ->
training/rl), rename misc_eval_utils/ -> evaluation/, and move OMNI_TRAINING.md,
PARQUET_TRAINING.md + new CODE_STRUCTURE.md under docs/. Update all path
references in run_grpo.sh/run_tarpo.sh, README, docs, and .gitignore. The verl/
submodule stays at the repo root.
The verl/ submodule is pinned to DDVD233/verl@hba_public_release, which lacks
the embedded-binary-parquet loader (lazy byte decode of audio/video/image,
modality-batching sampler fast-path, Qwen2.5-Omni model detection). Carry those
changes as patches/0001-hba-binary-parquet-loader.patch and apply them on top of
the pinned submodule via scripts/setup_verl.sh (idempotent) — no write access to
the verl fork required. Wire the setup step into README, OMNI_TRAINING, and
CODE_STRUCTURE.
HARPO (adv_estimator=harpo): port compute_harpo_outcome_advantage into the pinned
verl submodule and activate the ray_trainer branch, shipped as
patches/0002-hba-harpo-advantage.patch and applied by scripts/setup_verl.sh
(validated with a 5-step run on 4x H20). Rename the RL launcher + reward to HARPO
(run_tarpo.sh -> run_harpo.sh, human_behaviour_tarpo.py -> human_behaviour_harpo.py).

All training launchers now use the FULL dataset: GRPO/HARPO train on every train
shard and validate on the full validation split (glob instead of a 32..292 range +
single val shard); SFT configs use the full train/validation splits (not [:10%]/[:5%]).
setup_verl.sh applies every patches/*.patch; 0001 (loader) regenerated with the
full-data launcher. Docs updated (README, OMNI_TRAINING, CODE_STRUCTURE).
Remove the duplicate GRPO launcher: the loader patch now deletes the submodule's
examples/grpo_trainer/_train_grpo_hba.sh, leaving training/rl/run_grpo.sh as the
single GRPO entry point (sibling of run_harpo.sh). Repoint the README RL section
to training/rl/run_grpo.sh / run_harpo.sh.
…a -> train)

Consolidate the scattered setup steps into one quickstart with the verl patching
step (scripts/setup_verl.sh + the two patches) front-and-center, plus a sanity
check. Link it from the README Training section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant