VLM Backbone Integration
Load and validate Qwen3.5-4B as the VLA backbone, reuse EO-1 integration code where available, and confirm it works with 320x320 simulation views within the A100 80 GB budget.
Primary Goal
Replace the current placeholder backbone path with a verified multimodal foundation that Phase 3.2 can attach the action head to safely.
Fixed Upstream Decisions (from Phase 1.2 + 2.1–2.3)
IHMC Alex upper body, fixed base, with 17-D actions and a 52-D state vector.
4 frozen 320x320 cameras at 20 Hz: overhead, left wrist, right wrist, and third person.
Phase 2.1 HDF5 episodes and Phase 2.2 JSONL annotations are already assembled into Phase 2.3 reference-based sequences.
Hydra, PyTorch DDP/DeepSpeed, Gilbreth A100 80 GB nodes, and a lab RTX 4090 dev machine.
Qwen3.5 is already the Phase 2.2 model family; Phase 3.1 uses the 4B variant as the VLA backbone.
EO-1 remains the architecture template and preferred reusable codebase for backbone loading and integration.
Key Phase 3.1 Stance: EO-1 Reuse First
Inspect EO-1 first, reuse its backbone-loading path where practical, and keep the new VLM branch separate until later phases add the action head and training integration.
- EO-1 is the default implementation base wherever its backbone-loading, processor, or integration code already solves the problem.
- Qwen3.5-4B is the backbone target because it matches the Phase 2.2 model family and fits both development and A100 environments.
- This phase stops at loading, validation, and profiling; action heads and training integration stay in Phases 3.2 and 3.3.
- The existing TransformerModel remains intact behind a separate config path for backward compatibility.
VLM Backbone Integration Tasks
Five critical components from the Phase 3.1 execution plan
Dependencies & Model Configuration
Add the HuggingFace VLM dependencies and define Qwen3.5-4B Hydra configs for both A100 production and lab-PC development.
This is the setup layer the rest of the phase depends on. If the dependencies do not install cleanly or the configs do not parse on both hardware tiers, every later integration step becomes slower and more fragile.
- Inspect EO-1 codebase for existing dependency declarations and config patterns for VLM backbone loading
- Add vlm dependency group to pyproject.toml; update dev group to include VLM deps
- Create configs/model/vlm.yaml and configs/model/vlm_dev.yaml: adapt from EO-1 config structure if one exists, otherwise follow established base.yaml/large.yaml pattern
- Verify pip install -e ".[vlm]" succeeds and import transformers works
This step is complete when the VLM dependency group installs correctly, `transformers` imports without issue, both VLM configs compose cleanly, and the existing model configs still work as before.
Pretrained Weight Loading Pipeline
Inspect EO-1's loading path, reuse it where possible, and route architecture.type: "vlm" to a verified Qwen3.5-4B backbone without breaking TransformerModel.
This is the real foundation for the model stack. Phase 3.2 cannot attach an action head until the backbone loads reliably, exposes the right hidden states, and is verified to behave correctly on our hardware.
- Inspect EO-1 codebase for backbone wrapper, model loading, weight verification, and model factory code. Document what exists and what can be reused
- Reuse/adapt EO-1's backbone loading code for Qwen3.5-4B. Only introduce a new local wrapper module where the inspected EO-1 code does not already expose a clean integration point
- Extend get_model in models/utils.py with "vlm" routing
- Add vlm marker to tests/conftest.py with auto-skip logic
This step is complete when the Qwen3.5-4B backbone loads in bf16 on GPU, reports the expected model size and hidden dimension, passes basic verification checks, and `get_model()` still routes both VLM and non-VLM configs correctly.
Tokenizer & Processor Configuration
Configure the Qwen3.5 tokenizer and processor for 320x320 MuJoCo images, then measure the real vision-token cost per image.
This is the bridge between raw simulation data and model-ready inputs. It also tells us how much of the context window is consumed by images, which directly affects how much room remains for text and action tokens later on.
- Inspect EO-1 codebase for processor setup, image preprocessing, and vision token counting code. Reuse/adapt where available
- Implement or adapt ProcessorInfo, get_processor_info, preprocess_images, estimate_vision_tokens: placing them in the EO-1-derived module if reusing, or in models/vlm_backbone.py if new
- Run estimate_vision_tokens and record the actual number
- Verify image preprocessing: 320×320 uint8 numpy array to valid pixel_values tensor
This step is complete when the processor accepts 320x320 MuJoCo images and task text correctly, produces valid tensors, and the measured vision-token count is recorded for context-budget planning.
VLM Inference Sanity Check
Run end-to-end forward passes on real simulation images and prompts to confirm the backbone, processor, hidden states, and generation all work together.
Loading the model is only the first step. This check shows that the full multimodal path works on our actual simulation images and prompts before we start building training and action-generation logic on top of it.
- Inspect EO-1 codebase for inference scripts, forward-pass test utilities, or validation code. Adapt for our sim images/prompts if available
- Create scripts/validate_vlm_backbone.py with 8 checks and artifact output
- Add TestVLMInference tests to tests/test_vlm_backbone.py
- Run validation script on lab PC with model=vlm_dev and on A100 with model=vlm
This step is complete when multi-view inference runs without errors, logits and hidden states have the expected shapes, outputs remain numerically stable, and generated text is non-empty and coherent enough for a sanity check.
A100 Memory Profiling & Characterization
Profile Qwen3.5-4B VRAM usage on A100 across sequence lengths, batch sizes, and inference versus training modes.
Phase 3.2 needs measured memory numbers, not rough guesses. This profiling work tells us how much headroom is left for the action head and what training settings are realistic without running into OOM failures.
- Inspect EO-1 codebase for memory profiling scripts or VRAM estimation utilities. Adapt if available
- Implement or adapt scripts/profile_vlm_memory.py with sweep, metrics collection, and report generation
- Create infra/gilbreth/job_templates/08_profile_vlm_memory.sh
- Run on A100: confirm all configurations complete without OOM
This step is complete when the A100 profiling sweep produces clear VRAM measurements across the target settings and leaves us with a documented memory budget for Phase 3.2.
Key Deliverables
Expected outputs by end of Phase 3.1:
- VLM backbone module — EO-1-derived or new models/vlm_backbone.py (or equivalent) with backbone wrapper, verified weight loading, hidden state extraction, and multimodal preprocessing. Provenance documented (which parts from EO-1, which newly written)
- Two-tier Hydra configs — configs/model/vlm.yaml (A100 production) and configs/model/vlm_dev.yaml (lab PC), adapted from EO-1 config structure where applicable
- Vision token characterization — measured vision tokens per 320×320 image, context window budget analysis for VLA sequence design
- Inference validation — 8-check validation script confirming end-to-end forward pass with real MuJoCo sim images
- A100 memory profile — measured VRAM table across sequence lengths and batch sizes, with quantified action head budget for Phase 3.2
- Cluster support — SLURM jobs for weight pre-caching and memory profiling on Gilbreth
Definition of Done
Dependencies Ready
The vlm dependency group installs, transformers imports, and both VLM Hydra configs parse without breaking existing model configs.
Backbone Loaded
Qwen3.5-4B loads with bf16 dtype, verified parameter count, valid hidden size, and correct get_model() routing.
Inference Validated
Processor setup, hidden-state extraction, and multi-view forward passes work on 320x320 MuJoCo images with non-empty generation.
Profiled for Phase 3.2
Vision token counts, A100 memory measurements, and the action-head VRAM budget are recorded for the next phase.
4 days