Skip to content

hexagon: GR00T N1.6 within the fidelity bar when served - #80

Open
thanhdq1o2 wants to merge 5 commits into
VinRobotics:mainfrom
thanhdq1o2:hexagon-n1d6-served
Open

thanhdq1o2 wants to merge 5 commits into
VinRobotics:mainfrom
thanhdq1o2:hexagon-n1d6-served

Conversation

@thanhdq1o2

Copy link
Copy Markdown
Contributor

Hexagon's matrix unit (HMX) multiplies with F16 activations whatever the weight type. In GR00T N1.6's SigLIP2 tower that rounding grows from the first blocks, and a served LIBERO observation landed 1.0e-2 from a CPU-only F32 build of the same commit, above the 2.9e-3 bar. This PR lets an arch keep chosen weights' matmuls on the CPU, and uses it for N1.6: on Hexagon the tower and its projector keep F32 weights and the first three blocks' matmuls run on the CPU. Other backends are unchanged.

Changes

Commit What
c6277ed WeightLoader::GemmScope: GEMM weights declared while it lives take another resident type
fd3d02b fallback_keep_on_cpu(): the fallback wrapper leaves every MUL_MAT that reads a registered weight to the CPU. backend.h adds hmx_f16_activations() and keep_matmul_on_cpu(), a no-op in other builds
f0b12ae GR00T N1.6 on Hexagon: SigLIP2 and its projector in F32, the first three blocks' matmuls on the CPU, unless --weight-dtype is given
634e8a1 hexagon.md, CHANGELOG, IQ-10 benchmark at f0b12ae

GR00T N1.6 on the Dragonwing IQ-10

Before After
max|Δ| served (LIBERO observation) 1.0e-2 8.9e-4
max|Δ| fixed input, one view / two views 1.3e-3 / 7.5e-4 9.4e-4 / 5.0e-4
vla-bench mean, TEMPLATE.md 682.1 ms 733.7 ms
System RAM 4889 MiB 5691 MiB

The reference is a CPU-only build (-DGGML_HEXAGON=OFF) of the same commit with --weight-dtype f32 --flash-attn 0.

Verified

  • All 13 archs are within 2.9e-3 on fixed inputs; the other 12 give the same actions as before.
  • All 13 archs serve on the new vla-server (Async serving: ROUTER socket, predict thread and latest-wins request queue #34): a finite chunk, the same chunk for a repeated request, an error reply to a malformed and to an invalid request, and serving continues. GR00T N1.5 stays above the bar there (1.2e-2).
  • An x86 CPU-only build compiles and ctest passes (11/11).

Tried and left out

  • F32 weights for N1.6 without the CPU blocks: 5.4e-3 served.
  • GR00T N1.5: with F32 weights, its vision tower, LM, VL self-attention or DiT on the CPU each leave it at 1.1e-2 to 1.3e-2; only every matmul on the CPU, with flash attention off, brings it under the bar (1.8e-3).

GEMM weights declared while a GemmScope lives take its type instead of
the loader's, and the loader's type comes back when it ends. An arch
can then keep one module in a different resident type from the rest.
fallback_keep_on_cpu() registers a weight whose products the
accelerator computes too coarsely for an arch; accel_runs() then leaves
every MUL_MAT that reads it to the CPU. Hexagon's matrix unit rounds the
activations to F16 whatever the weight type, so a weight registered in
F32 gets the CPU F32 product. backend.h adds hmx_f16_activations() and
keep_matmul_on_cpu(), which does nothing in other builds.
Hexagon's matrix unit multiplies with F16 activations, and in SigLIP2's
first blocks that rounding grows through the tower: a served LIBERO
observation lands 1.0e-2 from a CPU-only F32 build on the Dragonwing
IQ-10, above the 2.9e-3 bar. F32 weights alone leave it at 5.4e-3.
Unless --weight-dtype is given, the tower and its projector now keep
F32 weights on Hexagon and the first three blocks' matmuls run on the
CPU. Other backends are unchanged.

GR00T N1.6 goes from 1.0e-2 to 8.9e-4 served, 9.4e-4 and 5.0e-4 on
fixed inputs (one and two views), at 689.5 to 739.7 ms (mean,
vla-bench). The other archs give the same actions.
hexagon.md: the HMX rounds activations to F16 whatever the weight
type; GR00T N1.6's SigLIP2 tower keeps F32 weights and its first three
blocks' matmuls on the CPU, 1.0e-2 to 8.9e-4 served. GR00T N1.5 spreads
the same rounding over the model: no single module on the CPU brings it
under the bar, only every matmul does. Fidelity and serving tables
updated. qualcomm-iq10.md and the summary row at f0b12ae: GR00T N1.6
682.1 to 733.7 ms, the other archs within run-to-run noise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant