What dominates Intel NPU-5 compile time, why, and what to fix — 120 cold configs over 5 architecture families (Gemma-2, TinyLlama, Llama-3.2, Phi-3, Qwen2), sizes 0.5–7.6 B, prompt window 128 → 32768, three weight precisions (int4 / int8 / fp16), 10 cold repeats each (OpenVINO 2026.0).
enable-schedule-trace → #tasks, write-strategy-to-json → #tiles)
shows each dominant pass's time scales with the amount of IR it processes. FeasibleAllocation time ∝ (#scheduled tasks)0.69Compile cost is a tug-of-war between two effects. The dequantization / weight-table machinery that int8 and int4 bolt on penalises the quantized formats — so for small-to-mid models fp16 compiles fastest (≈0.58× int8) despite its larger weights. But fp16 also carries 2× the weight bytes, and by 7 B that weight-DMA volume takes over: fp16 flips to ≈1.88× int8 (up to 2.4× at mid windows). int4 wins both ways — it has the dequant machinery but half the bytes — staying ≤0.99× int8 at every size. The mechanism shows in the pipeline: the quantized formats (int4, int8) land their heaviest work in the serialization back-end (the weight tables they serialize), while fp16 stays tiling-search-dominated.
The pattern generalises across modality, with a twist. Across 31 CNN configs (7 families — ResNet-18→152 swept 128→640 px, plus EfficientNet, MobileNetV3, DenseNet, RegNet, Inception, ConvNeXt), FeasibleAllocation never dominates a single compile (0/31). Conv graphs are tiling + vertical-fusion bound: MultiClusterStrategy (tiling) leads at low resolution and hands off to MergeVfSubgraphs (vertical fusion) as resolution grows. Same workload-gated shape as the LLMs — attention graphs escalate into scheduling/serialization; conv graphs escalate into tiling/fusion.
Because cost is driven by IR/schedule size in a known regime, the levers are direct:
| regime (when) | dominant pass | root cause | fix |
|---|---|---|---|
| every compile | — | recompiling from scratch | Warm blob cache — a recompile is 20–30× a blob-load. Biggest, universal win. |
| small / short (≤3B) | MultiClusterStrategy | serial tiling search (user/wall≈1.0) | Cache / reuse strategy_out.json across shapes; lower search effort. |
| 7B, mid window | FeasibleAllocation | #tasks explodes → greedy simulate-and-spill re-run 2–3× | Fewer/larger tiles (cut #tasks); bound the window; ship precompiled ELF. |
| extreme window (≥16K) | ELF serialization | artifact size grows linearly with W | Precompiled-blob shipping; the materialization is mechanical, don't repeat it. |
Method: Intel Core Ultra 7 356H, NPU 5 (intel_vpu), OpenVINO
2026.0, driver-compiler 1.33. Weights swept at int4 (symmetric, group-128), int8 and fp16 — each export's on-disk element types verified (fp16 defeats the optimum silent-int8 trap; int4 uses --sym to dodge a group-quant location-verifier compiler bug that fails asymmetric int4). Fully-cold compiles
(NPU_BYPASS_UMD_CACHING, isolated subprocess per repeat), NPUW_LLM window sweep.
Per-pass time = the VPUX compiler's MLIR PassTiming (wall, inclusive of analyses, pipeline
groups excluded); mean over 10 repeats (4 at W≥8192). Why-costly metrics from the release
compiler's own instrumentation via NPU_COMPILATION_MODE_PARAMS
(enable-schedule-trace, write-strategy-to-json) + built-in
dump-statistics-of-ie-ops. Sparse-MoE (Granite) and hybrid-SSM (Qwen3.5) do not
compile on NPU 5 (dynamic shapes). CNNs exported via optimum --library timm, reshaped to static NCHW; input resolution is the plain-static workload axis. vgg16 excluded — its 102M-param fc1 fails SplitNCEOpsOntoWorkloads on NPU 5. Ungated model mirrors; no HF token.