# unitreerobotics/unifolm-wla architecture

> Architecture diagram of the GitHub repository unitreerobotics/unifolm-wla, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/unitreerobotics/unifolm-wla
- Repository: https://github.com/unitreerobotics/unifolm-wla

## Overview

UnifoLM-WLA is a humanoid-robot foundation model and action-expert codebase. Its main workflow prepares and unifies robot demonstrations, trains a vision-language/action model, then serves predicted actions to a robot client. The graph also captures local episode evaluation and the model’s internal VLM, state-projector, and diffusion-action stages. Some subsystem links are documented only by the README or SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`unifolm_wla/model/framework/VLM4A/QwenMMDiT.py`](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/framework/VLM4A/QwenMMDiT.py) (Qwen-MMDiT framework), [`unifolm_wla/dataloader/multi_source_dataset/single_source_dataset.py`](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/single_source_dataset.py) (Source dataset), [`unifolm_wla/training/train_unifolm_wla.py`](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/training/train_unifolm_wla.py) (Training loop), [`unifolm_wla/model/modules/action_model/MMDiT_ActionHeader.py`](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/action_model/MMDiT_ActionHeader.py) (MMDiT action head)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Robot data"]
  node_dataset_config["Dataset config<br/>[config.py]"]
  node_source_dataset["Source dataset"]
  node_action_mapping["Action mapping<br/>[action_mapping.py]"]
  node_se3["Pose transforms<br/>[se3_utils.py]"]
  node_data_loader["Multi-source loader<br/>[dataloader.py]"]
end

subgraph group_model["Model runtime"]
  node_framework_base["Framework base<br/>[base_framework.py]"]
  node_framework_config["Framework config and checkpoint tools<br/>[share_tools.py]"]
  node_qwen_framework["Qwen-MMDiT framework<br/>[QwenMMDiT.py]"]
  node_qwen_vlm["Qwen3 vision-language model<br/>[QWen3.py]"]
  node_state_projector["Robot-state projector<br/>[robot_state.py]"]
  node_action_head["MMDiT action head"]
  node_dit_backbone["Diffusion transformer<br/>[mmdit.py]"]
  node_action_encoder["Action encoder<br/>[action_encoder.py]"]
end

subgraph group_training["Training"]
  node_trainer["Training loop"]
  node_trainer_tools["Trainer utilities<br/>[trainer_tools.py]"]
  node_config_tracker["Config tracking<br/>[config_tracker.py]"]
end

subgraph group_deployment["Serving and evaluation"]
  node_action_server["Robot action server"]
  node_action_adapter["Robot action adapter"]
  node_episode_eval["Local episode evaluation"]
end

node_robot_client(("Robot policy client"))
node_demonstrations[("Robot demonstrations")]

node_demonstrations -.->|"loads samples"| node_source_dataset
node_dataset_config -.->|"configures"| node_data_loader
node_data_loader -->|"constructs"| node_source_dataset
node_source_dataset -->|"maps actions"| node_action_mapping
node_source_dataset -->|"transforms poses"| node_se3
node_trainer -->|"consumes batches"| node_data_loader
node_trainer -->|"trains model"| node_framework_base
node_trainer -->|"uses utilities"| node_trainer_tools
node_trainer -->|"tracks config"| node_config_tracker
node_qwen_framework -->|"extends framework"| node_framework_base
node_qwen_framework -->|"builds inputs"| node_qwen_vlm
node_qwen_framework -->|"predicts actions"| node_action_head
node_qwen_framework -.->|"projects robot state"| node_state_projector
node_qwen_vlm -->|"injects state"| node_state_projector
node_action_head -->|"uses backbone"| node_dit_backbone
node_action_head -->|"uses encoder"| node_action_encoder
node_qwen_framework -->|"loads config"| node_framework_config
node_action_server -->|"loads model"| node_framework_base
node_action_server -->|"adapts actions"| node_action_adapter
node_action_adapter -->|"uses unified layout"| node_action_mapping
node_robot_client -.->|"requests actions"| node_action_server
node_episode_eval -->|"loads episodes"| node_source_dataset
node_episode_eval -->|"maps actions"| node_action_mapping

click node_dataset_config "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/config.py"
click node_source_dataset "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/single_source_dataset.py"
click node_action_mapping "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/action_mapping.py"
click node_se3 "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/se3_utils.py"
click node_data_loader "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/dataloader.py"
click node_trainer "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/training/train_unifolm_wla.py"
click node_trainer_tools "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/training/trainer_utils/trainer_tools.py"
click node_config_tracker "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/training/trainer_utils/config_tracker.py"
click node_framework_base "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/framework/base_framework.py"
click node_framework_config "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/framework/share_tools.py"
click node_qwen_framework "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/framework/VLM4A/QwenMMDiT.py"
click node_qwen_vlm "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/vlm/QWen3.py"
click node_state_projector "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/projector/robot_state.py"
click node_action_head "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/action_model/MMDiT_ActionHeader.py"
click node_dit_backbone "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/action_model/DiT_modules/mmdit.py"
click node_action_encoder "https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/action_model/flow_matching_head/action_encoder.py"
click node_action_server "https://github.com/unitreerobotics/unifolm-wla/blob/main/model_server/action_server_wbc_msgpack_unitree.py"
click node_action_adapter "https://github.com/unitreerobotics/unifolm-wla/blob/main/model_server/unifolm_wla_action_adapter.py"
click node_episode_eval "https://github.com/unitreerobotics/unifolm-wla/blob/main/model_server/eval_local_episode_wbc_msgpack_server_only.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dataset_config,node_source_dataset,node_action_mapping,node_se3,node_data_loader,node_robot_client toneBlue
class node_framework_base,node_framework_config,node_qwen_framework,node_qwen_vlm,node_state_projector,node_action_head,node_dit_backbone,node_action_encoder,node_demonstrations toneAmber
class node_trainer,node_trainer_tools,node_config_tracker toneMint
class node_action_server,node_action_adapter,node_episode_eval toneRose
```

## Components

### Robot data

- [Dataset config](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/config.py): `unifolm_wla/dataloader/multi_source_dataset/config.py`
- [Source dataset](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/single_source_dataset.py): `unifolm_wla/dataloader/multi_source_dataset/single_source_dataset.py`
- [Action mapping](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/action_mapping.py): `unifolm_wla/dataloader/multi_source_dataset/action_mapping.py`
- [Pose transforms](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/se3_utils.py): `unifolm_wla/dataloader/multi_source_dataset/se3_utils.py`
- [Multi-source loader](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/dataloader/multi_source_dataset/dataloader.py): `unifolm_wla/dataloader/multi_source_dataset/dataloader.py`

### Model runtime

- [Framework base](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/framework/base_framework.py): `unifolm_wla/model/framework/base_framework.py`
- [Framework config and checkpoint tools](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/framework/share_tools.py): `unifolm_wla/model/framework/share_tools.py`
- [Qwen-MMDiT framework](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/framework/VLM4A/QwenMMDiT.py): `unifolm_wla/model/framework/VLM4A/QwenMMDiT.py`
- [Qwen3 vision-language model](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/vlm/QWen3.py): `unifolm_wla/model/modules/vlm/QWen3.py`
- [Robot-state projector](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/projector/robot_state.py): `unifolm_wla/model/modules/projector/robot_state.py`
- [MMDiT action head](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/action_model/MMDiT_ActionHeader.py): `unifolm_wla/model/modules/action_model/MMDiT_ActionHeader.py`
- [Diffusion transformer](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/action_model/DiT_modules/mmdit.py): `unifolm_wla/model/modules/action_model/DiT_modules/mmdit.py`
- [Action encoder](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/model/modules/action_model/flow_matching_head/action_encoder.py): `unifolm_wla/model/modules/action_model/flow_matching_head/action_encoder.py`

### Training

- [Training loop](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/training/train_unifolm_wla.py): `unifolm_wla/training/train_unifolm_wla.py`
- [Trainer utilities](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/training/trainer_utils/trainer_tools.py): `unifolm_wla/training/trainer_utils/trainer_tools.py`
- [Config tracking](https://github.com/unitreerobotics/unifolm-wla/blob/main/unifolm_wla/training/trainer_utils/config_tracker.py): `unifolm_wla/training/trainer_utils/config_tracker.py`

### Serving and evaluation

- [Robot action server](https://github.com/unitreerobotics/unifolm-wla/blob/main/model_server/action_server_wbc_msgpack_unitree.py): `model_server/action_server_wbc_msgpack_unitree.py`
- [Robot action adapter](https://github.com/unitreerobotics/unifolm-wla/blob/main/model_server/unifolm_wla_action_adapter.py): `model_server/unifolm_wla_action_adapter.py`
- [Local episode evaluation](https://github.com/unitreerobotics/unifolm-wla/blob/main/model_server/eval_local_episode_wbc_msgpack_server_only.py): `model_server/eval_local_episode_wbc_msgpack_server_only.py`

### Other components

- **Robot policy client**
- **Robot demonstrations**

## Connections

- Robot demonstrations → Source dataset: loads samples
- Dataset config → Multi-source loader: configures (evidence: `unifolm_wla/dataloader/multi_source_dataset/dataloader.py`)
- Multi-source loader → Source dataset: constructs (evidence: `unifolm_wla/dataloader/multi_source_dataset/dataloader.py`)
- Source dataset → Action mapping: maps actions (evidence: `unifolm_wla/dataloader/multi_source_dataset/single_source_dataset.py`)
- Source dataset → Pose transforms: transforms poses (evidence: `unifolm_wla/dataloader/multi_source_dataset/single_source_dataset.py`)
- Training loop → Multi-source loader: consumes batches (evidence: `unifolm_wla/training/train_unifolm_wla.py`)
- Training loop → Framework base: trains model (evidence: `unifolm_wla/training/train_unifolm_wla.py`)
- Training loop → Trainer utilities: uses utilities (evidence: `unifolm_wla/training/train_unifolm_wla.py`)
- Training loop → Config tracking: tracks config (evidence: `unifolm_wla/training/train_unifolm_wla.py`)
- Qwen-MMDiT framework → Framework base: extends framework (evidence: `unifolm_wla/model/framework/VLM4A/QwenMMDiT.py`)
- Qwen-MMDiT framework → Qwen3 vision-language model: builds inputs (evidence: `unifolm_wla/model/framework/VLM4A/QwenMMDiT.py`)
- Qwen-MMDiT framework → MMDiT action head: predicts actions (evidence: `unifolm_wla/model/framework/VLM4A/QwenMMDiT.py`)
- Qwen-MMDiT framework → Robot-state projector: projects robot state
- Qwen3 vision-language model → Robot-state projector: injects state (evidence: `unifolm_wla/model/modules/vlm/QWen3.py`)
- MMDiT action head → Diffusion transformer: uses backbone (evidence: `unifolm_wla/model/modules/action_model/MMDiT_ActionHeader.py`)
- MMDiT action head → Action encoder: uses encoder (evidence: `unifolm_wla/model/modules/action_model/MMDiT_ActionHeader.py`)
- Qwen-MMDiT framework → Framework config and checkpoint tools: loads config (evidence: `unifolm_wla/model/framework/VLM4A/QwenMMDiT.py`)
- Robot action server → Framework base: loads model (evidence: `model_server/action_server_wbc_msgpack_unitree.py`)
- Robot action server → Robot action adapter: adapts actions (evidence: `model_server/action_server_wbc_msgpack_unitree.py`)
- Robot action adapter → Action mapping: uses unified layout (evidence: `model_server/unifolm_wla_action_adapter.py`)
- Robot policy client → Robot action server: requests actions
- Local episode evaluation → Source dataset: loads episodes (evidence: `model_server/eval_local_episode_wbc_msgpack_server_only.py`)
- Local episode evaluation → Action mapping: maps actions (evidence: `model_server/eval_local_episode_wbc_msgpack_server_only.py`)
