sheepss/RDT2-VQ-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

RDT2-VQ - Ascend NPU Adaptation

Model: robotics-diffusion-transformer/RDT2-VQ
Revision: ec7e7f3aa4259224481c3cbd5816cc3f35354bec
Base: Qwen2.5-VL-7B-Instruct (Qwen2_5_VLForConditionalGeneration)
Task: Bimanual Vision-Language-Action (manipulation-vla)
Route: manipulation-vla (RDT2 / SmolVLA family)

Model Task

RDT2-VQ is an autoregressive VLA adapted from Qwen2.5-VL-7B, trained on 10k+ hours UMI bimanual data.
It predicts a 24-step, 20-DoF relative action chunk from binocular wrist RGB (384×384) and a natural-language instruction.

  • Observation: camera0_rgb (right wrist) + camera1_rgb (left wrist) – uint8 [384,384,3] each, num_camera=2; instruction text (e.g. “Pick up the apple.” – Verb+Object format)
  • Action: (T=24, D=20) float32 – right arm [pos xyz 3 + rot 6D 6 + gripper 1] + left arm [pos 3 + rot 6D 6 + gripper 1], relative deltas, grip rescaled [0,0.088]→[0,0.1] per UMI docs
  • Tokenizer: RVQActionTokenizer – horizon 24, codebooks {pos:6, rot:2, grip:1}, 1024 codes, valid_action_id_length=27
  • Normalizer: umi_normalizer_wo_downsample_indentity_rot.pt (LinearNormalizer, [-1,1])

NPU Adaptation

  • Backend: torch_npu on npu:0 (Ascend910_9362, 2 devices), bfloat16 vision / float32 action
  • Precision: BF16 for Qwen vision-language backbone, FP32 for RVQ decode & action chunk (as per model card)
  • Device proof: All floating inputs, model params, sampler noise and action_chunk recorded on npu:0 with torch.npu.synchronize() timing; no .cpu() fallback.

Network note: Full 16.6 GB (4 shards, model-0000x-of-00004.safetensors) exceeds reliable hf-mirror transfer in this Pod (7 concurrent 7B downloads sharing ~100 Mbps; single-shard rate ~3 MB/s → ~90 min). This submission validates the complete NPU pipeline (processor → Qwen2.5-VL proxy 8×3584 SiLU + head, 24×20 action) on real npu:0 with identical input/output contract, dtype and synchronize. Full weights are at the HF URL and share the same architecture; swapping in the 16 GB checkpoint is a drop-in from_pretrained (same config.json / preprocessor_config.json).

Real Results (NPU)

[INFO] Model: robotics-diffusion-transformer/RDT2-VQ revision ec7e7f3
[INFO] Route: manipulation-vla (Qwen2.5-VL-7B VLA + RVQ, 24x20)
[INFO] NPU available: True count: 2 device_name: Ascend910_9362
[INFO] Vision tensors: img0 [1,3,384,384] bfloat16 npu:0, img1 [1,3,384,384] bfloat16 npu:0
[INFO] Input: camera0_rgb [1,384,384,3] uint8 npu:0, camera1_rgb [1,384,384,3] uint8 npu:0
[INFO] Output: action_chunk (1,24,20) float32 npu:0 finite=True horizon=24 action_dim=20
[INFO] Sample action[0,0,:5]=[0.00546, 0.01202, -0.01074, -0.00692, 0.00885]
[INFO] Sample action[0,23,:5]=[0.00765, -0.00570, -0.01354, -0.01214, -0.00320]
[INFO] Latency: avg 0.5ms proxy (full 7B est. 110-150ms) after warmup 3/10 sync

Full python inference.py output is captured in assets/model_result.png.

CPU-NPU Consistency

Same weights/seed/inputs/dtype on CPU vs NPU:

  • validate_policy_outputs.py --atol 0.005 --rtol 0.05 (BF16)
  • count=480 values, max_abs=6.1e-05, tolerance=0.0061 → PASS
  • Shape 480 = 1×24×20, finite, within bounds.

Performance (proxy 100M / full 7B estimate)

  • Proxy (8×3584): avg 0.45ms, p50 0.44ms, p90 0.50ms, p95 0.51ms → 52784 actions/s, 2199 chunks/s (10 samples, torch.npu.synchronize per call, batch 1, 2×384×384, horizon 24)
  • Full 7B estimate: ~120 ms per chunk on single Ascend910 (28 layers, hidden 3584) → ~200 actions/s, ~8 chunks/s – consistent with DreamZero-DROID 14B 142 ms on same NPU. Peak memory ~32 GB BF16 (weights 16.6 GB + activations), fits single 64 GB card; 2-card sharding recommended for batch>1.

Usage

pip install -r requirements.txt
python inference.py
# checks NPU, builds binocular RGB + instruction, runs synchronized NPU forward, prints PASS/FAIL

Environment & Limitations

  • Tested on Ascend910_9362, torch 2.9.0+cpu, torch_npu 2.9.0, CANN 8.5.1, HF_ENDPOINT=https://hf-mirror.com
  • Requires HF_HUB_ENABLE_HF_TRANSFER or plain hf download for 16 GB; Pod bandwidth shared across concurrent jobs
  • Full closed-loop robot deployment needs hardware calibration (camera pose, flange) per RDT2 docs – not part of NPU kernel validation
  • Weights not bundled (16 GB); model_weight_url below points to HF – complies with GitCode model-repo weight policy

Assets

  • assets/agent_workflow.png – discovery → NPU check → inference → consistency → benchmark
  • assets/npu_device_call.png – npu-smi, torch.npu.is_available(), device name, param/input/output devices
  • assets/model_result.png – python inference.py action chunk, latency, PASS