Add README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- robotics
|
| 6 |
+
- quantization
|
| 7 |
+
- w4a4
|
| 8 |
+
- svdquant
|
| 9 |
+
- world-action-model
|
| 10 |
+
- fastwam
|
| 11 |
+
base_model: armanakbari4/fastwam-ur3-3task-10k
|
| 12 |
+
datasets:
|
| 13 |
+
- armanakbari4/ur3-3task-lerobot
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# FastWAM UR3 3-task β SVDQuant W4A4 (real packed INT4)
|
| 17 |
+
|
| 18 |
+
A 4-bit post-training quantisation of the UR3 3-task FastWAM fine-tune (step 7000). The weight is
|
| 19 |
+
stored **packed at 4 bits** and contracted on integer tensor cores β this is not a fake-quant
|
| 20 |
+
checkpoint that stores 4-bit values in 16-bit tensors.
|
| 21 |
+
|
| 22 |
+
| | |
|
| 23 |
+
|---|---|
|
| 24 |
+
| base model | [`armanakbari4/fastwam-ur3-3task-10k`](https://huggingface.co/armanakbari4/fastwam-ur3-3task-10k) :: `ur3_3task_10k_step7000.pt` (11.2 GiB bf16) |
|
| 25 |
+
| method | SVDQuant (Li et al., ICLR 2025) β SmoothQuant migration + rank-32 FP16 low-rank branch + per-group-64 INT4 residual |
|
| 26 |
+
| precision | **W4A4**, weights per-group-64, activations per-group-64 dynamic |
|
| 27 |
+
| quantised | the 600 block Linears of both experts (2 Γ 30 blocks Γ {self_attn q/k/v/o, cross_attn q/k/v/o, ffn.0, ffn.2}), **5.914 B params** |
|
| 28 |
+
| kept in bf16 | patch/text/time embeddings, heads, action encoder, norms, modulation, proprio encoder |
|
| 29 |
+
| size | **4.5798 BPW**, **3.36 GiB** (down from 11.2 GiB) |
|
| 30 |
+
| calibration | `armanakbari4/ur3-3task-lerobot` β **10 episodes per task Γ 3 tasks, every frame, seed 42 = 9 908 observations** |
|
| 31 |
+
|
| 32 |
+
## Files
|
| 33 |
+
|
| 34 |
+
| file | size | |
|
| 35 |
+
|---|---|---|
|
| 36 |
+
| `ur3_step7000_svdquant_w4a4.pt` | 3.36 GiB | the checkpoint. **Self-contained**: the packed INT4 Linears *and* every unquantised `mot` tensor *and* the proprio encoder |
|
| 37 |
+
| `ur3_3task_10k_dataset_stats.json` | 170 KB | proprio z-scoring and action denormalisation β the checkpoint cannot be run correctly without it |
|
| 38 |
+
| `ur3_prompt_embeddings.pt` | 3.0 MiB | the three task instructions, pre-encoded, so the 11 GB umT5-XXL text encoder is not needed at inference |
|
| 39 |
+
|
| 40 |
+
## Running it
|
| 41 |
+
|
| 42 |
+
Code, kernels and a deployment guide: **https://github.com/arashakb/QuantWAM**
|
| 43 |
+
(`adapters/fastwam/`, `quantwam/kernels/w4a4_triton.py`, `adapters/fastwam/README_ur3_5090.md`).
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
from ur3_infer import UR3QuantPolicy
|
| 47 |
+
pol = UR3QuantPolicy() # ~25 s
|
| 48 |
+
pol.set_task("drawer_lerobot") # or the full instruction string
|
| 49 |
+
chunk = pol.predict(top_rgb, left_rgb, right_rgb, state) # [32, 14], robot units
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
`predict` takes **raw** `HxWx3` uint8 RGB frames and the **raw** 14-d state and applies the whole
|
| 53 |
+
observation contract itself (top β 320Γ256, wrists β 160Γ128, `[top ; [left|right]]` β 384Γ320,
|
| 54 |
+
`*2/255 - 1`; state z-scored and clamped to Β±5), so a caller cannot get the preprocessing subtly
|
| 55 |
+
wrong. Run `python adapters/fastwam/ur3_infer.py --self-test` first on any new machine.
|
| 56 |
+
|
| 57 |
+
Besides these files you need the Wan2.2 VAE (`Wan2.2_VAE.pth`, 2.7 GiB) to encode the camera image
|
| 58 |
+
to the video latent. You do **not** need the 11.2 GiB bf16 checkpoint, the 11 GB text encoder, or
|
| 59 |
+
the 18.8 GB Wan2.2 DiT weights. Total deployment footprint β **6.1 GiB**.
|
| 60 |
+
|
| 61 |
+
## Verification
|
| 62 |
+
|
| 63 |
+
All measured on **held-out** episodes β the calibration episodes are excluded, because a check run
|
| 64 |
+
on fitted data cannot detect the failure it exists to detect.
|
| 65 |
+
|
| 66 |
+
| check | result |
|
| 67 |
+
|---|---|
|
| 68 |
+
| base bf16 model vs recorded actions | NRMSE **0.0055**, corr 0.9998 |
|
| 69 |
+
| packed kernels vs the reference SVDQuant formula, per layer | activation scales **bit-identical**; β€ **0.10 %** of 4-bit codes differ, every one by **exactly 1 LSB** |
|
| 70 |
+
| weight repacking fidelity at export | **0.0000 %** of codes off by 1 LSB |
|
| 71 |
+
| quantised vs bf16, action chunk | NRMSE **0.0010** |
|
| 72 |
+
| **quantised vs recorded actions** | NRMSE **0.0064** β the same as bf16's own **0.0064** |
|
| 73 |
+
| end-to-end from raw camera frames | NRMSE **0.0061**, corr 0.9997 |
|
| 74 |
+
|
| 75 |
+
Quantisation costs essentially nothing on this checkpoint: the quantised model sits as close to the
|
| 76 |
+
recorded actions as the bf16 model does.
|
| 77 |
+
|
| 78 |
+
**Not yet measured: real-robot success rate.** The bf16 model has been evaluated on the physical
|
| 79 |
+
UR3; this checkpoint has not. Everything above is open-loop agreement with recorded trajectories,
|
| 80 |
+
which is necessary but not sufficient.
|
| 81 |
+
|
| 82 |
+
## Hardware notes
|
| 83 |
+
|
| 84 |
+
The kernels execute the INT4 contract on **INT8 tensor cores**, which is exact β every 4-bit code is
|
| 85 |
+
representable in int8 and the int32 accumulation rounds nothing. The 4 bits therefore buy DRAM
|
| 86 |
+
traffic and memory rather than arithmetic.
|
| 87 |
+
|
| 88 |
+
Launch configurations are tuned per compute capability, and only `sm_89` (L40S) ships. On other
|
| 89 |
+
architectures β including **sm_120 / RTX 5090** β the kernel prints `no tuned config for M=β¦ K=β¦ N=β¦`
|
| 90 |
+
and falls back to an occupancy heuristic: **correct, but roughly 2Γ off the tuned optimum** on the
|
| 91 |
+
narrow shapes. Run `analysis/iw_gemm_tune.py` once on the target GPU to fix it.
|
| 92 |
+
|
| 93 |
+
## Tasks
|
| 94 |
+
|
| 95 |
+
* `blue_basket` β put the medicine then the measuring tape inside the blue basket
|
| 96 |
+
* `drawer` β open the drawer, put the white box inside the drawer then close the drawer
|
| 97 |
+
* `stacking_cubes` β put the green cube on top of the black cube and put the red cube on top of the green cube
|