multimodalart HF Staff Claude Opus 4.8 (1M context) commited on
Commit
3a307ee
·
1 Parent(s): 5f7966f

Update NVFP4 notes: flashinfer AOT-dir + HF bucket, speed/memory table

Browse files

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. NVFP4_ZEROGPU.md +30 -9
NVFP4_ZEROGPU.md CHANGED
@@ -41,19 +41,40 @@ and the kernels come from **flashinfer**, which ships a dedicated **sm_120
41
  4. **`FLASHINFER_CUDA_ARCH_LIST=12.0f`** — pins the arch so flashinfer doesn't
42
  need nvcc just to *detect* capability (a stray system CUDA 12.3 otherwise
43
  mis-detects and forces a rebuild).
44
- 5. **Prebake + bake the cache.** Build the FP4 kernels once, then ship
45
- `~/.cache/flashinfer/0.6.12/...` (the `.so`). Runtime loads itno compile.
46
- `app.py::_setup_nvfp4_env()` restores it from `flashinfer_cache/` at startup.
 
 
 
 
 
 
 
 
47
 
48
- At runtime there is **no compilation** — only a `.so` load and an `nvcc --version`
49
- read for the cache key. That's the ZeroGPU property: the GPU window is never
50
- spent compiling.
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  ## Files
53
 
54
- - `flashinfer_cache/0.6.12/...` — prebaked sm_120 FP4 kernels
55
- (`fp4_quantization_120f.so`, `fp4_gemm_cutlass_sm120.so`), committed.
56
- - `app.py::_setup_nvfp4_env()` — env + cache restore (NVFP4 mode only).
57
  - `aoti_dit.py` — skips the AOTI hook when `DREAMVERSE_NVFP4=1`.
58
 
59
  ## Run it
 
41
  4. **`FLASHINFER_CUDA_ARCH_LIST=12.0f`** — pins the arch so flashinfer doesn't
42
  need nvcc just to *detect* capability (a stray system CUDA 12.3 otherwise
43
  mis-detects and forces a rebuild).
44
+ 5. **Use flashinfer's AOT path (relocatable), not the JIT cache.** The JIT cache
45
+ dir (`~/.cache/flashinfer/...`) is **not** relocatablecopy/tar/download it
46
+ and ninja recompiles (~80 s) regardless of mtimes. But flashinfer's
47
+ `build_and_load()` short-circuits: `if self.is_aot: return load(aot_path)` —
48
+ if `FLASHINFER_AOT_DIR/<op>/<op>.so` exists it **loads directly, no ninja, no
49
+ nvcc**. So we ship just the two `.so`
50
+ (`fp4_quantization_120f`, `fp4_gemm_cutlass_sm120`) in an
51
+ `aot/<op>/<op>.so` layout in an **HF bucket**
52
+ (`multimodalart/dreamverse-flashinfer-cache`), and `_setup_nvfp4_env()`
53
+ downloads them and sets `flashinfer.jit.env.FLASHINFER_AOT_DIR`. **Verified:
54
+ 0.2 s load, no JIT** (even with the JIT cache wiped).
55
 
56
+ At runtime there is **no compilation and no nvcc** — just a `.so` load. That's
57
+ the ZeroGPU property: the GPU window is never spent compiling, and a fork loads
58
+ prebaked weights + prebaked FP4 kernels and runs immediately.
59
+
60
+ ## Speed / memory (measured, warm `generate_video`, 512x768x65, 5 steps)
61
+
62
+ | Mode | per-segment | vs bf16 eager |
63
+ |---|---|---|
64
+ | bf16 eager | ~8.5 s | 1.0x |
65
+ | bf16 + AOTI | ~3.8 s | ~2.2x |
66
+ | NVFP4 (eager + prebaked) | ~3.7 s | ~2.3x |
67
+
68
+ NVFP4 ≈ AOTI on speed here, and they **don't stack** (AOTInductor can't C++-
69
+ compile the FP4 op). Peak memory didn't drop (~72 vs ~69 GB) because the
70
+ unquantized Gemma text encoder (~25 GB) dominates. NVFP4's win on this box is
71
+ ZeroGPU-cleanliness; bigger gains need B200 (FA4 + NVFP4 together).
72
 
73
  ## Files
74
 
75
+ - HF bucket `multimodalart/dreamverse-flashinfer-cache` (dataset),
76
+ `aot/<op>/<op>.so` — prebaked sm_120 FP4 kernels (relocatable, no ninja).
77
+ - `app.py::_setup_nvfp4_env()` — pulls the AOT `.so` + sets `FLASHINFER_AOT_DIR`.
78
  - `aoti_dit.py` — skips the AOTI hook when `DREAMVERSE_NVFP4=1`.
79
 
80
  ## Run it