#38379·openvino

[RFC] CPU plugin: property to disable/defer oneDNN weight repack (second full weight copy at load)

Author: SergiioBCreated Sep 24, 2026Updated Sep 28, 2026

Problem description

When loading int4 CPU models, oneDNN repacks compressed weights into its own runtime layout, creating a second full copy of the weights in the process. There is currently no plugin property to disable or defer this repack.

Measured (Linux, CPU plugin, gemma-4-26b-a4b-int4-ov): the weight copy shows up as large heap allocations at engine build time; with an allocator interposer we can make that copy file-backed and reclaimable (kernel evicts under pressure), but we cannot prevent it — so peak load-time memory and page-cache churn still double the weight traffic.

We looked for an existing property (ENABLE_MMAP, CACHE_MODE, KV precision knobs, etc.): none of them gate the repack. Our current workaround sits below the engine (interposer file-backs the repack copy — verified: committed memory 2064 → 506 MB on an 8B-class int4, decode −1%), but the copy itself is pure waste for serving scenarios that would accept the packed-on-disk layout.

Feature request

A CPU-plugin property (e.g. WEIGHTS_REPACK=NO / WEIGHTS_LAYOUT=AS_LOADED) that loads int4 weights in their stored layout and repacks lazily per-layer (or not at all when the caller accepts the trade-off), so memory-constrained serving does not pay for a second copy of the weights.

Environment

  • OpenVINO 2026.5 (lib 2650 line), CPU plugin, Ubuntu 24.04
  • oneDNN CPU backend as bundled
  • Evidence: allocator-interposer counters (733 large allocations totaling ~17.3 GB at load for a ~14.6 GB model export) and smaps before/after

Source: openvinotoolkit/openvino