# luo-jingw/flashrt architecture

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

- Interactive diagram: https://gitdiagram.com/luo-jingw/flashrt
- Repository: https://github.com/luo-jingw/flashrt
- Video tour (about a minute): https://gitdiagram.com/luo-jingw/flashrt/video

## Overview

FlashRT is a realtime inference engine for small-batch, latency-sensitive AI, built around hand-composed model pipelines and specialized kernels. The main user-to-result pattern is a request entering a model or serving frontend, running model-specific inference, and yielding generated text, images, video, or robot actions. The repository also documents VLM, audio, and multiple hardware paths. Several of those implementations are not present in the supplied tree, so their documented capability nodes are shown without speculative internal call chains; sampled-source relationships are cited where available.

Main entry points: [`csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp) (CUTLASS SM90 pipeline), [`csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h`](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h) (CUTLASS GEMM pipeline), [`csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp`](https://github.com/luo-jingw/flashrt/blob/main/csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp) (SM100 GEMM pipeline), [`flash_rt/models/imagewam/pipeline_thor.py`](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/imagewam/pipeline_thor.py) (ImageWAM policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Interfaces and serving"]
  node_cpp_runtime["C++ runtime API<br/>[runtime.h]"]
  node_qwen_service["Qwen serving adapter<br/>[qwen36_engine.py]"]
end

subgraph group_vla["Robot policies"]
  node_pi05_rtx["Pi0.5 RTX policy<br/>[pipeline_rtx.py]"]
  node_pi05_amd["Pi0.5 AMD policy<br/>[pipeline.py]"]
  node_groot_policy["GROOT policy<br/>[pipeline_thor.py]"]
  node_groot_n17["GROOT N1.7 policy<br/>[pipeline_thor.py]"]
  node_pi0_policy["Pi0-FAST policy<br/>[pipeline.py]"]
  node_imagewam["ImageWAM policy<br/>[pipeline_thor.py]"]
  node_imagewam_quant["ImageWAM quantization<br/>[quant_linear.py]"]
end

subgraph group_generation["Generative models"]
  node_bagel["BAGEL image generation"]
  node_motus["Motus video policy<br/>[pipeline_rtx.py]"]
  node_higgs["Higgs Audio serving<br/>[server.py]"]
  node_omnivoice["OmniVoice serving<br/>[server.py]"]
  node_qwen36["Qwen3.6 inference<br/>[qwen36_engine.py]"]
  node_vlm["Qwen3-VL inference"]
end

subgraph group_kernels["Runtime and kernels"]
  node_imagewam_native["ImageWAM native pipeline"]
  node_imagewam_api["ImageWAM C API<br/>[c_api.h]"]
  node_kernel_pipeline["CUTLASS SM90 pipeline<br/>[sm90_pipeline.hpp]"]
  node_kernel_gemm["CUTLASS GEMM pipeline<br/>[mma_pipelined.h]"]
  node_kernel_sm100["SM100 GEMM pipeline<br/>[sm100_pipeline.hpp]"]
  node_cutlass_layout["CUTLASS tensor layouts<br/>[layout.hpp]"]
  node_cutlass_barrier["CUTLASS barriers<br/>[barrier.h]"]
  node_cutlass_cluster["CUTLASS cluster ops<br/>[cluster_sm90.hpp]"]
  node_cutlass_constants["CUTLASS constants"]
  node_cutlass_array["CUTLASS arrays<br/>[array.hpp]"]
  node_cutlass_core["CUTLASS core<br/>[cutlass.h]"]
  node_cutlass_sync["CUTLASS sync logging<br/>[synclog.hpp]"]
  node_cutlass_array_h["CUTLASS arrays<br/>[array.h]"]
  node_cutlass_convert["Numeric conversion"]
end

node_user(("Application"))

node_user -.->|"submits request"| node_qwen_service
node_qwen_service -->|"adapts requests"| node_qwen36
node_user -.->|"requests action"| node_pi05_rtx
node_user -.->|"requests action"| node_pi05_amd
node_user -.->|"requests action"| node_groot_policy
node_user -.->|"requests action"| node_groot_n17
node_user -.->|"requests action"| node_pi0_policy
node_user -.->|"requests action"| node_imagewam
node_imagewam -->|"uses quantization"| node_imagewam_quant
node_imagewam -.->|"native execution"| node_imagewam_native
node_imagewam_native -->|"implements interface"| node_imagewam_api
node_user -.->|"requests image"| node_bagel
node_user -.->|"requests video"| node_motus
node_user -->|"requests audio"| node_higgs
node_user -.->|"requests audio"| node_omnivoice
node_user -.->|"submits image prompt"| node_vlm
node_user -.->|"opens runtime"| node_cpp_runtime
node_kernel_pipeline -->|"uses layouts"| node_cutlass_layout
node_kernel_pipeline -->|"uses cluster ops"| node_cutlass_cluster
node_kernel_pipeline -->|"uses arrays"| node_cutlass_array
node_kernel_pipeline -->|"uses constants"| node_cutlass_constants
node_kernel_pipeline -->|"uses barriers"| node_cutlass_barrier
node_kernel_pipeline -->|"uses core"| node_cutlass_core
node_kernel_pipeline -->|"uses sync logging"| node_cutlass_sync
node_kernel_gemm -->|"uses core"| node_cutlass_core
node_kernel_gemm -->|"uses arrays"| node_cutlass_array_h
node_kernel_gemm -->|"uses conversion"| node_cutlass_convert
node_kernel_sm100 -->|"uses constants"| node_cutlass_constants
node_kernel_sm100 -->|"uses cluster ops"| node_cutlass_cluster
node_kernel_sm100 -->|"uses barriers"| node_cutlass_barrier
node_user -.->|"runs kernels"| node_kernel_pipeline

click node_cpp_runtime "https://github.com/luo-jingw/flashrt/blob/main/cpp/runtime/include/flashrt/cpp/runtime.h"
click node_qwen_service "https://github.com/luo-jingw/flashrt/blob/main/serving/qwen36_agent/qwen36_engine.py"
click node_pi05_rtx "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/pi05/pipeline_rtx.py"
click node_pi05_amd "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/amd/models/pi05/pipeline.py"
click node_groot_policy "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/groot/pipeline_thor.py"
click node_groot_n17 "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/groot_n17/pipeline_thor.py"
click node_pi0_policy "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/pi0fast/pipeline.py"
click node_imagewam "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/imagewam/pipeline_thor.py"
click node_imagewam_quant "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/imagewam/quant_linear.py"
click node_imagewam_native "https://github.com/luo-jingw/flashrt/blob/main/cpp/models/imagewam/src/native_pipeline.cpp"
click node_imagewam_api "https://github.com/luo-jingw/flashrt/blob/main/cpp/models/imagewam/include/flashrt/cpp/models/imagewam/c_api.h"
click node_bagel "https://github.com/luo-jingw/flashrt/blob/main/flash_wm/src/bagel_fp8_engine.py"
click node_motus "https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/motus/pipeline_rtx.py"
click node_higgs "https://github.com/luo-jingw/flashrt/blob/main/serving/higgs_audio_agent/server.py"
click node_omnivoice "https://github.com/luo-jingw/flashrt/blob/main/serving/omnivoice_agent/server.py"
click node_qwen36 "https://github.com/luo-jingw/flashrt/blob/main/serving/qwen36_agent/qwen36_engine.py"
click node_kernel_pipeline "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp"
click node_kernel_gemm "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h"
click node_kernel_sm100 "https://github.com/luo-jingw/flashrt/blob/main/csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp"
click node_cutlass_layout "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/layout.hpp"
click node_cutlass_barrier "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/arch/barrier.h"
click node_cutlass_cluster "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/arch/cluster_sm90.hpp"
click node_cutlass_constants "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/numeric/integral_constant.hpp"
click node_cutlass_array "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/container/array.hpp"
click node_cutlass_core "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/cutlass.h"
click node_cutlass_sync "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/arch/synclog.hpp"
click node_cutlass_array_h "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/array.h"
click node_cutlass_convert "https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/numeric_conversion.h"

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_cpp_runtime,node_qwen_service toneBlue
class node_pi05_rtx,node_pi05_amd,node_groot_policy,node_groot_n17,node_pi0_policy,node_imagewam,node_imagewam_quant toneAmber
class node_bagel,node_motus,node_higgs,node_omnivoice,node_qwen36,node_vlm toneMint
class node_imagewam_native,node_imagewam_api,node_kernel_pipeline,node_kernel_gemm,node_kernel_sm100,node_cutlass_layout,node_cutlass_barrier,node_cutlass_cluster,node_cutlass_constants,node_cutlass_array,node_cutlass_core,node_cutlass_sync,node_cutlass_array_h,node_cutlass_convert toneRose
class node_user toneIndigo
```

## Components

### Interfaces and serving

- [C++ runtime API](https://github.com/luo-jingw/flashrt/blob/main/cpp/runtime/include/flashrt/cpp/runtime.h): `cpp/runtime/include/flashrt/cpp/runtime.h`
- [Qwen serving adapter](https://github.com/luo-jingw/flashrt/blob/main/serving/qwen36_agent/qwen36_engine.py): `serving/qwen36_agent/qwen36_engine.py`

### Robot policies

- [Pi0.5 RTX policy](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/pi05/pipeline_rtx.py): `flash_rt/models/pi05/pipeline_rtx.py`
- [Pi0.5 AMD policy](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/amd/models/pi05/pipeline.py): `flash_rt/amd/models/pi05/pipeline.py`
- [GROOT policy](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/groot/pipeline_thor.py): `flash_rt/models/groot/pipeline_thor.py`
- [GROOT N1.7 policy](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/groot_n17/pipeline_thor.py): `flash_rt/models/groot_n17/pipeline_thor.py`
- [Pi0-FAST policy](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/pi0fast/pipeline.py): `flash_rt/models/pi0fast/pipeline.py`
- [ImageWAM policy](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/imagewam/pipeline_thor.py): `flash_rt/models/imagewam/pipeline_thor.py`
- [ImageWAM quantization](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/imagewam/quant_linear.py): `flash_rt/models/imagewam/quant_linear.py`

### Generative models

- [BAGEL image generation](https://github.com/luo-jingw/flashrt/blob/main/flash_wm/src/bagel_fp8_engine.py): `flash_wm/src/bagel_fp8_engine.py`
- [Motus video policy](https://github.com/luo-jingw/flashrt/blob/main/flash_rt/models/motus/pipeline_rtx.py): `flash_rt/models/motus/pipeline_rtx.py`
- [Higgs Audio serving](https://github.com/luo-jingw/flashrt/blob/main/serving/higgs_audio_agent/server.py): `serving/higgs_audio_agent/server.py`
- [OmniVoice serving](https://github.com/luo-jingw/flashrt/blob/main/serving/omnivoice_agent/server.py): `serving/omnivoice_agent/server.py`
- [Qwen3.6 inference](https://github.com/luo-jingw/flashrt/blob/main/serving/qwen36_agent/qwen36_engine.py): `serving/qwen36_agent/qwen36_engine.py`
- **Qwen3-VL inference**

### Runtime and kernels

- [ImageWAM native pipeline](https://github.com/luo-jingw/flashrt/blob/main/cpp/models/imagewam/src/native_pipeline.cpp): `cpp/models/imagewam/src/native_pipeline.cpp`
- [ImageWAM C API](https://github.com/luo-jingw/flashrt/blob/main/cpp/models/imagewam/include/flashrt/cpp/models/imagewam/c_api.h): `cpp/models/imagewam/include/flashrt/cpp/models/imagewam/c_api.h`
- [CUTLASS SM90 pipeline](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp): `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`
- [CUTLASS GEMM pipeline](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h): `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h`
- [SM100 GEMM pipeline](https://github.com/luo-jingw/flashrt/blob/main/csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp): `csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp`
- [CUTLASS tensor layouts](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/layout.hpp): `csrc/attention/flash_attn_2_src/cutlass/include/cute/layout.hpp`
- [CUTLASS barriers](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/arch/barrier.h): `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/arch/barrier.h`
- [CUTLASS cluster ops](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/arch/cluster_sm90.hpp): `csrc/attention/flash_attn_2_src/cutlass/include/cute/arch/cluster_sm90.hpp`
- [CUTLASS constants](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/numeric/integral_constant.hpp): `csrc/attention/flash_attn_2_src/cutlass/include/cute/numeric/integral_constant.hpp`
- [CUTLASS arrays](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cute/container/array.hpp): `csrc/attention/flash_attn_2_src/cutlass/include/cute/container/array.hpp`
- [CUTLASS core](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/cutlass.h): `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/cutlass.h`
- [CUTLASS sync logging](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/arch/synclog.hpp): `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/arch/synclog.hpp`
- [CUTLASS arrays](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/array.h): `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/array.h`
- [Numeric conversion](https://github.com/luo-jingw/flashrt/blob/main/csrc/attention/flash_attn_2_src/cutlass/include/cutlass/numeric_conversion.h): `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/numeric_conversion.h`

### Other components

- **Application**

## Connections

- Application → Qwen serving adapter: submits request
- Qwen serving adapter → Qwen3.6 inference: adapts requests (evidence: `serving/qwen36_agent/qwen36_engine.py`)
- Application → Pi0.5 RTX policy: requests action
- Application → Pi0.5 AMD policy: requests action
- Application → GROOT policy: requests action
- Application → GROOT N1.7 policy: requests action
- Application → Pi0-FAST policy: requests action
- Application → ImageWAM policy: requests action
- ImageWAM policy → ImageWAM quantization: uses quantization (evidence: `flash_rt/models/imagewam/pipeline_thor.py`)
- ImageWAM policy → ImageWAM native pipeline: native execution
- ImageWAM native pipeline → ImageWAM C API: implements interface (evidence: `cpp/models/imagewam/src/native_pipeline.cpp`)
- Application → BAGEL image generation: requests image
- Application → Motus video policy: requests video
- Application → Higgs Audio serving: requests audio (evidence: `serving/higgs_audio_agent/server.py`)
- Application → OmniVoice serving: requests audio
- Application → Qwen3-VL inference: submits image prompt
- Application → C++ runtime API: opens runtime
- CUTLASS SM90 pipeline → CUTLASS tensor layouts: uses layouts (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`)
- CUTLASS SM90 pipeline → CUTLASS cluster ops: uses cluster ops (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`)
- CUTLASS SM90 pipeline → CUTLASS arrays: uses arrays (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`)
- CUTLASS SM90 pipeline → CUTLASS constants: uses constants (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`)
- CUTLASS SM90 pipeline → CUTLASS barriers: uses barriers (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`)
- CUTLASS SM90 pipeline → CUTLASS core: uses core (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`)
- CUTLASS SM90 pipeline → CUTLASS sync logging: uses sync logging (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/pipeline/sm90_pipeline.hpp`)
- CUTLASS GEMM pipeline → CUTLASS core: uses core (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h`)
- CUTLASS GEMM pipeline → CUTLASS arrays: uses arrays (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h`)
- CUTLASS GEMM pipeline → Numeric conversion: uses conversion (evidence: `csrc/attention/flash_attn_2_src/cutlass/include/cutlass/gemm/threadblock/mma_pipelined.h`)
- SM100 GEMM pipeline → CUTLASS constants: uses constants (evidence: `csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp`)
- SM100 GEMM pipeline → CUTLASS cluster ops: uses cluster ops (evidence: `csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp`)
- SM100 GEMM pipeline → CUTLASS barriers: uses barriers (evidence: `csrc/gemm/mega/cutlass/pipeline/sm100_pipeline.hpp`)
- Application → CUTLASS SM90 pipeline: runs kernels
