KINETIC / docs /architecture.md
AshrafGalibSk's picture
Publish Kinetic modular VLA stack (source, no weights)
9019b27 verified
|
Raw History Blame Contribute Delete
5.57 kB

Kinetic Architecture

Technical blueprint for Kinetic, a lightweight modular Vision-Language-Action (VLA) stack.

1. High-level data flow

User Instruction → Language Reasoner → Task Planner → World Model (persistent state)
Vision Encoder + Sensors → Scene Encoder → World Model
World Model + Subtask → Action Policy → Motion Controller → Robot
Sensors + Vision feedback → World Model

Key principle: modularity + persistent world state. Components are specialized, loosely coupled, and communicate primarily through the World Model.

2. Core components

2.1 Vision Encoder (kinetic.vision)

Item Detail
Purpose Compact visual features from RGB (optional depth)
Interface VisionEncoder.encode(rgb) → VisionFeatures
Default MockVisionEncoder (block pooling + change detection)
Production FastViT, MobileViT, EfficientViT, DINOv2/v3 Tiny, SigLIP
Output Feature map + global embed (e.g. 256-D), not thousands of raw tokens
Optimizations 224/384 resolution, frame skip, pixel-diff change detection

2.2 Scene Encoder (kinetic.scene)

Item Detail
Purpose Structured symbolic scene (not raw tokens for the LLM)
Outputs Detections, 6D poses, attributes, scene graph edges
Default MockSceneEncoder + rule-based build_scene_graph
Production Grounding DINO / OWLv2, ByteTrack, MediaPipe / pose nets

2.3 World Model (kinetic.world)

Central persistent memory: objects, robot proprioception, scene graph, task progress, short/long-term memory.

  • Update: event-driven, delta-aware (IoU / pose thresholds)
  • Persistence: in-memory or SQLite (SqlitePersistence)
  • LLM view: WorldState.summary_for_llm() — compact text/JSON-like summary

2.4 Language Reasoner (kinetic.language)

  • Role: pure intent — no action generation
  • Input: user command + world summary
  • Output: GoalSpec (goal, constraints, target object/location)
  • Default: RuleBasedReasoner
  • High-perf light LLM: BitNetReasoner via Microsoft bitnet.cpp (BitNet b1.58, 1.58-bit, CPU/GPU kernels)
  • Optional: HttpLLMReasoner (OpenAI-compatible endpoint)
  • Critical: event-only — never inside the control cycle (see docs/bitnet.md)

2.5 Task Planner (kinetic.planner)

  • Hierarchical decomposition: Goal → ordered Subtask list with pre/postconditions
  • Default: HierarchicalPlanner (fetch / place / navigate templates)
  • Future: LLM JSON propose → PDDL / TAMP validate

Example (fetch bottle):

locate → navigate → reach → grasp → lift → return_to_user

2.6 Action Policy (kinetic.policy)

  • Input: world state + current subtask
  • Output: ActionCommand (EE pose, joints, gripper, stop)
  • Default: HeuristicPolicy (geometric setpoints + success checks)
  • Production: Diffusion Policy / small transformer / BC

2.7 Motion Controller (kinetic.control)

  • Safety filter, rate limits, joint clamps, pseudo-IK trajectory
  • Production: MoveIt / full IK, collision checking, force limits

2.8 Robot Adapter (kinetic.robots)

  • Generic trajectory → robot API
  • Default: MockSimRobot (arm + grasp physics + RGB proxy)
  • Future: ROS2, Franka, UR5, Unitree, humanoids

3. Event-driven loop (kinetic.loop)

  1. New instruction or sensor tick
  2. Vision → Scene → World Model (delta)
  3. If task-relevant: Reasoner + Planner
  4. Policy selects primitive
  5. Controller → Robot
  6. Feedback → World Model
  7. Repeat

Efficiency: planner/LLM not every frame; only changed objects matter.

4. Training strategy (staged)

  1. Vision & scene — pretrained encoders + synthetic data
  2. Alignment — CLIP / LLaVA-style VL
  3. Planner — LLM fine-tune on planning datasets
  4. Policy — imitation on Open X-Embodiment + sim
  5. Optional light E2E — RL / DAgger

Datasets: Open X-Embodiment, BridgeData V2, CALVIN, LIBERO, RT-1, in-house teleop.

5. Deployment

Target Notes
Jetson Orin Nano INT8 vision/policy, 4-bit LLM
RTX 3050 laptop Dev + TensorRT/ONNX
Apple Silicon ExecuTorch / MLX path
Latency goal <100 ms control cycle

Quantization: 4-bit LLM, INT8 vision/policy. Engines: TensorRT, ONNX Runtime, ExecuTorch.

6. Config

See configs/default.yaml (mock), configs/mujoco.yaml (physics), configs/bitnet.yaml (optional LLM).

7. Diagram

                 User Instruction
                        │
                        ▼
               Language Reasoner (3B)
                        │ Goal
                        ▼
                  Task Planner
                        │ Subtasks
                        ▼
 ┌────────────── World Model ◄──────── feedback ──────────┐
 │                     │                                    │
 │            Vision + Scene Encoder                        │
 │                     │                                    │
 │              Action Policy                               │
 │                     │                                    │
 │            Motion Controller                             │
 │                     │                                    │
 └──────────────────► Robot ────────────────────────────────┘