m
mengsihan/act-aloha-sim-transfer-cube-human
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

ACT Aloha Sim Transfer Cube Human - Ascend NPU

Model: lerobot/act_aloha_sim_transfer_cube_human (revision ba73b2766f1371cdc133ca4efb97eb090d744625)
Task: Bimanual Aloha Transfer Cube (AlohaTransferCube-v0) - fine-grained bimanual manipulation via Action Chunking Transformer
Route: demonstration-policy (ACT) - observation (images + proprio) → continuous action chunk
Hardware: Ascend 910B NPU (npu:0, Ascend910_9362) - single card
Dtype: float32 (FP32, atol=1e-4 rtol=1e-3)

Model Contract

Architecture: ACT - ResNet18 backbone (FrozenBatchNorm) + Transformer encoder (4 layers) + decoder (1 layer), dim_model=512, n_heads=8, dim_feedforward=3200, chunk_size=100, latent_dim=32, VAE enabled.

Observation:

  • observation.images.top: (B, 3, 480, 640) RGB top camera, normalized with ImageNet mean [0.485,0.456,0.406] / std [0.229,0.224,0.225]
  • observation.state: (B, 14) joint positions (dual-arm 7+7), normalized MEAN_STD with dataset stats

Action:

  • Output: (B, 100, 14) continuous action chunk (100 steps, 14-DoF bimanual), unnormalized with dataset stats
  • Single-step API select_action returns (B, 14) next action (temporal ensemble disabled, queue-based)
  • Sampling: deterministic at eval (VAE latent = zeros, no noise), seed fixed for reproducibility

Preprocessing: Shared normalization for CPU/NPU using safetensors buffers (normalize_inputs/unnormalize_outputs). Same raw observations, same stats, dtype float32, eval mode.

Real Results (NPU:0)

Default python inference.py on Ascend 910:

  • Model loading: ACTPolicy.from_pretrained("model_weights") → 51.6M params, 206 MB safetensors, device npu:0 proof: model.vae_encoder.layers.0.self_attn.in_proj_weight on npu:0
  • Input: deterministic batch (seed 12345): images (1,3,480,640) random, state (1,14) random; horizon 100, batch 1, n_obs_steps 1
  • Output device: npu:0, shape (1, 100, 14), finite true, bounds min -0.5586 max 0.9322
  • First action (unnorm) first 5: [0.02826, -0.44515, 0.92557, -0.00830, -0.55307]
  • Latency (synchronized, 10 samples): avg 12.67 ms, min 12.52 ms, max 13.07 ms, p50 12.66 ms, p90 13.07 ms
  • Throughput: 7891.8 actions/s, 78.92 action-chunks/s (batch=1, horizon=100, dtype float32, includes backbone+transformer, torch.npu.synchronize per iteration)

CPU-NPU Consistency

Same weights, same raw batch (seed 12345), same preprocessing, same eval mode:

  • CPU shape (1,100,14) vs NPU shape (1,100,14) - matched
  • Finite: true both
  • Max_abs (unnormalized): 6.0e-05, mean_abs: 9.0e-06
  • Tolerance: 0.00103 (atol 1e-4 + rtol 1e-3 * max_ref 0.9322)
  • Result: PASS (within FP32 threshold)

Validation via validate_policy_outputs.py with first 100 flattened values:

{"count": 100, "finite": true, "max_abs": 6.04e-05, "passed": true, "tolerance": 0.00102}

Benchmark benchmark_policy.py (10 latencies, 100 items/call): {"actions_per_s": 8025.8, "avg_ms": 12.45}

Environment & Limitations

  • NPU: Ascend910_9362, 2 devices, torch_npu 2.9.0.post1, CANN 8.5.1, torch.npu.is_available()==True
  • Memory: Model 206 MB + overhead <2 GB, fits single 64 GB HBM, no sharding
  • Verification: Closed-loop gym-aloha rollout not executed (requires sim env); single-step action chunk validation is primary metric per demonstration-policy contract. Env reward/success reported in eval_info.json (83% on 500 eps) not used as NPU proof.

Usage

pip install -r requirements.txt
python inference.py

inference.py prints model/revision/route/backend/device/dtype, input summary, ActionPlan shape/horizon/action_dim, sampler/seed, finite check, synchronized latency, throughput (actions/s, chunks/s), CPU-NPU comparison and PASS/FAIL. All floating inputs and model params verified on npu:0.

Evidence

  • agent workflow
  • npu device call
  • model result