Anger/ Robot/ 推理部署/ GR00T N1.7/ 推理计算全流程

GR00T N1.7 推理计算全流程(AlternateVLDiT · mlc-vla / XDOF)

对照 nvidia/GR00T-N1.7-3B + mlc-vla gr00t_n17;每个步骤标 dtype/shape;点击卡片展开看计算细节与原理。对照 π0.5 页差异:无 KV 复用,backbone 只跑一次。

B=1 3 cams×T=2 Se=448 ViT 24 + LLM 16 AlternateVLDiT 32 H=40 FM Euler×4 fp16

总览

符号含义取值来源
Bbatch1compile static
Vcamera views3intent / 0001
Timg每路进 VLM 的时序帧2current + 1 history
Nimg进 ViT 的图像数 = V×Timg6vit_num_images
Hpx×Wpxprocessor 后尺寸256×256image_target_size(bench 原始 240×320)
ps / TpatchViT patch / temporal patch16 / 2config
Cinpatch in = C·T·ps·ps15363·2·16·16
Praw ViT patches15366×256
mspatial merge2config
Nvmerge 后 image tokens384P/m²
SeVL 序列长度(compile static)448384 image + 64 text pad
Ltext_padtext pad 预算64plan note
Lv实际有效 text tokensUNKNOWN随 prompt 变;pad 到 64
Dvlbackbone / LLM hidden2048config
DvitViT hidden1024config
Ddit / DinDiT inner = heads×head_dim153632×48
DhidDiT / MLP hidden1024hidden_size
Haction horizon40本 ckpt;产品目标 50 未冻结
Sastate+action seq into DiT411+H
Dact_padgraph 内 max action/state dim132config
Dact_effXDOF 有效动作维32pad 到 132;布局 UNKNOWN
NdenoiseEuler / FM steps4config / attrs
bucketstimestep 离散桶1000config
emb_id默认 XDOF embodiment id27attrs
dtypeTVM deliver / PT officialfp16 / bf16attrs / Isaac
理论 FLOP 合计(B=1):≈ 2626 GFLOP / infer(vision 1049 + llm 748 + cond 187 + loop 642)。ViT 24 层 · heads 16 · hd 64 · FFN 4096 · deepstack (5,11,17);LLM select_layer=16 · GQA 16Q/8KV · hd 128;VL-SA 4×32×64;DiT 32 · 32×48 · attend_text_every_n_blocks=2。对照 π0.5:无 KV cache,backbone 只跑一次,DiT 每步 cross-attn 重读固定 vl_embs。

Once vs ×4

每推理只跑一次每个 Euler 步(×4)
Image preprocess + patchifyaction_encoder(+pos embed)
embed_vision(ViT)AlternateVLDiT 全 32 blocks(self+cross)
Host: embed_tokens / scatter / mRoPEaction_decoder
backbone_llm(16 layers, full Se)Euler: x ← x + dt·v
encode_condition(VLLN+VL-SA+state)
Sample actions0 noise
Build image_mask / backbone_attention_mask
相对 π0.5 不存在:LLM KV cache;expert suffix decode;baked prefix RoPE for LLM;10-step Gemma expert。

Timing / FLOP(Thor lock)

锁频:gpc 1575 / nvd 1692 MHz。目标 15 Hz = 66.7 ms,0003 仍差 ~67 ms。

IDStacke2e p50HzNotes
0001PyTorch eager XDOF SDPA193.617 ms5.17Full policy; H=40; 4 denoise
v2 earlyUniRT pre-flash141.523 ms7.1LLM input random
0002+ ViT flash144.481 ms6.92同会话对比旧 170.7
0003+ LLM flash(当前 TVM 交付)133.683 ms7.48正式 note
wall_0003同 pack stage walls132.0 ms7.57vision 18.7 / llm 28.2 / enc 6.6 / loop 73.7
FLOP 合计(theory):~2626 GFLOP / infer。Bottleneck:ViT layout+attn;LLM gemm/weight BW(~1.5 GiB);DiT small-M gemm / weight BW ×4(~65 FLOP/B,~2.3 GiB weights)。
Stagep50 (v2 early)p50 (0003 / wall)FLOP
embed_vision~42.8 → 19.2 ms18.7 ms~1049 GFLOP · ~405 M params
backbone_llm~32.6 ms28.2–29.0 ms~748 GFLOP · ~805 M params
encode_condition~5.8–6.6 ms6.6 ms~187 GFLOP · ~256 M params
denoise_step15.3 ms~19.1 ms~161 GFLOP / step
denoise_loop ×459.0 ms73.7 ms~642 GFLOP

对照 π0.5

关键差异:π0.5 保留 VLM prefix KV,供 10 步 Expert 去噪复用。GR00T N1.7 不导出 KV decode 路径:backbone(ViT+LLM)作为 feature extractor 只跑一次;DiT 每 Euler 步通过 cross-attention 重读固定 vl_embs。
π0.5GR00T N1.7
VisionSigLIP-So400mQwen3-VL ViT(Cosmos-Reason2-2B visual)
Language backbonePaliGemma / Gemma-2B ×18 → KVQwen3-VL Text truncated ×16,无 KV
Action headGemma-300M expert(读 KV)AlternateVLDiT 32(self/cross + image/text mask)
Denoise stepsEuler 10Euler / FM 4
Horizon / pad dimH=50, A=32→7H=40, D_pad=132→eff≈32
Seqprefix P=968 + suffix 50Se=448 VL;Sa=41 into DiT
dtype(交付)bf16(部分 fp32)fp16(TVM)

UNKNOWN / 开放缺口

  1. Lv / 语言 token 布局:真实 XDOF prompt 的有效 text 长度、特殊 token、image placeholder 在 Se=448 内的位置 — 仅文档化「384 image + 64 text pad」。
  2. image_mask 索引范围:True 在 image token 位;6-view merge 后的精确 index range 无 host dump。
  3. XDOF 132→32 打包:哪 32 维是有效 eef/joints/gripper 顺序 UNKNOWN。
  4. Horizon 50:产品目标;当前冻结形状 H=40。
  5. Denoise 步数产品选择:intent 仍「未定」是否保持 4。
  6. Host glue wall:UniRT e2e_full 常用 random LLM inputs(无 embed_tokens/scatter/get_rope_index);0001 PT 含 preprocess+decode。
  7. Isaac 默认过旧:勿把 select_layer=12 / DiT=16 当作 N1.7-3B 真相(真值 16/32)。
  8. Deepstack 注入时序:mlc-vla 在 layer 0,1,2 后 add;与 HF/ONNX 完全对齐需再确认。
  9. DiT/ViT 层内中间激活 shape:块 I/O 恒为 [B,S,D];QKV 布局见 modules,未单独测量。