This repository packages the context-length 128 disaggregated OpenVINO artifacts for Lunar Lake GPU prefill + NPU decode inference of the SFT-tuned 23-expert variant of GPT-OSS.
Device placement:
prefill/: GPU prefill graph
decode/: NPU decode graph
scripts/benchmark_prefill_decode.py: inference and benchmark script
The IR build pipeline is identical to the 6.6b 8E reference (xpuenabler/gpt-oss-6.6b-8E-nf4-awq-optimum-static-128-GpNd). The two architectures share the same KV layout (24 layers, 8 KV heads, head_dim 64) and vocab (201088); only the MoE expert count differs (8 → 23).
Note on hardware verification: The IR rewrite, reshape, and graph-edit steps were executed and validated on a CPU-only host. The Intel GPU and NPU compile / inference verification (and the final all_logits_finite: true benchmark) must be re-run on a Lunar Lake validation machine. See Hardware Requirements and Workarounds.
Reproduce From the Original Hugging Face Model
The script scripts/rebuild_from_original_ctx128_gpnd.py rebuilds this package from:
xpuenabler/gpt-oss-15.5b-23E-SFT
It performs the full pipeline:
Export the original HF model to OpenVINO NF4 stateless decode IR with explicit KV cache I/O.
Reshape the decode graph to the static ctx128 contract.
Reshape the decode graph into a ctx128 prefill graph.
Repair the prefill graph for Intel GPU compile.
Repair the decode graph for Intel NPU finite KV handoff.
Run GPU prefill + NPU decode inference and verify all_logits_finite (requires Lunar Lake hardware).
The benchmark_gpnd_finite/ directory and 04_benchmark_gpnd.log are produced only when the optional final benchmark step is run on a Lunar Lake validation machine (see scripts/benchmark_prefill_decode.py).
Hardware Requirements and Workarounds
The rebuild pipeline has two different kinds of steps:
IR generation/editing steps: operate on files and OpenVINO graph objects. These do not require Intel GPU or NPU hardware.
Device compile / inference verification steps: call core.compile_model(..., "GPU"), core.compile_model(..., "NPU"), or run inference on those devices. These require the actual Intel GPU/NPU device and driver/runtime stack.
Summary
Step
Needs Intel GPU/NPU hardware?
Can be run without hardware?
Workaround
A. optimum-cli export openvino
No
Yes
Export on CPU-only machine; copy IR to target Lunar Lake machine later
B. scripts/repair_disaggregated_prefill_gpu.py graph rewrite
No
Yes
Run without --verify-gpu-compile
B. scripts/repair_disaggregated_prefill_gpu.py --verify-gpu-compile
Intel GPU required
Partially
Skip verify locally; verify on GPU machine later
C. scripts/repair_decode_present_outputs.py graph rewrite
No
Yes
Run without --verify-npu-compile
C. scripts/repair_decode_present_outputs.py --verify-npu-compile
Intel NPU required
Partially
Skip verify locally; verify on NPU machine later
A. optimum-cli export openvino
optimum-cli export openvino does not compile the model for GPU or NPU. It downloads the Hugging Face model, runs PyTorch/Transformers/Optimum/NNCF export, and writes OpenVINO IR files.
Therefore, this step can run on a CPU-only machine as long as the software dependencies are available.
Required resources:
Enough system RAM and disk space for the original model, temporary export files, and final IR. The 15.5b-23E source model is roughly 30 GB in BF16; NF4 IR is ~9 GB.
The GPU verification phase requires Intel GPU hardware:
--verify-gpu-compile
That option internally calls:
core.compile_model(model, "GPU")
If the machine has no Intel GPU or no working OpenVINO GPU plugin/driver, this verification will fail even if the IR rewrite itself is valid.
Workaround:
Run the script without --verify-gpu-compile on a CPU-only machine.
Copy <work_dir>/prefill_gpu_finite/ to a Lunar Lake machine.
Run the same script again with --verify-gpu-compile, or simply compile the generated prefill_gpu_finite/openvino_model.xml with core.compile_model(..., "GPU").
CPU fallback note:
CPU compile can be used as a weak structural sanity check, but it does not prove GPU plugin compatibility.
The original issue was GPU-specific (ScaledDotProductAttention / zero-length layout handling), so final validation must happen on Intel GPU.
C. scripts/repair_decode_present_outputs.py
This script also has two phases.
The graph rewrite phase does not require NPU hardware:
Reads openvino_model.xml.
Rebuilds model outputs so 48 present.* KV outputs are converted to FP32.
The NPU verification phase requires Intel NPU hardware:
--verify-npu-compile
That option internally calls:
core.compile_model(model, "NPU")
If the machine has no Intel NPU or no working OpenVINO NPU plugin/driver, this verification will fail even if the IR rewrite itself is valid.
Workaround:
Run the script without --verify-npu-compile on a CPU-only machine.
Copy <work_dir>/decode_npu_present_f32/ to a Lunar Lake NPU machine.
Run the same script again with --verify-npu-compile, or compile the generated decode_npu_present_f32/openvino_model.xml with core.compile_model(..., "NPU").
CPU fallback note:
CPU compile can confirm that the edited IR is syntactically valid.
CPU compile cannot validate NPU memory planning, NPU supported ops, or NPU plugin-specific behavior.
The final all_logits_finite: true claim still requires running the actual GPU prefill + NPU decode benchmark on a machine with both devices.
Practical Split Build
If GPU/NPU hardware is not available on the build machine, use this split flow:
Machine
Run
CPU build server
optimum-cli export openvino
CPU build server
static decode reshape
CPU build server
prefill reshape
CPU build server
repair_disaggregated_prefill_gpu.py without --verify-gpu-compile
CPU build server
repair_decode_present_outputs.py without --verify-npu-compile
--disable-stateful is required so KV cache is exposed as explicit past_key_values.* inputs and present.* outputs.
--awq and --scale-estimation are intentionally not used in this rebuild path because GPT-OSS fused MoE tensors can trigger NNCF broadcast errors under stateless export.
Appends only the last-token tail KV from decode present.*.
Crops the cache window to 128 tokens.
Replaces NaN/Inf with zero.
Clips KV values to [-2, 2].
Expected Benchmark Result
The exact generated_text baseline for this 15.5b-23E variant has not yet been recorded — the benchmark must be run on a Lunar Lake machine. Use the same command pattern as the reference 6.6b-8E run:
For reference, the 6.6b-8E build produced the following on a Lunar Lake validation machine:
TTFT: 1.097 s
Output throughput: 8.550 token/s
NPU peak memory: 4.307 GiB
GPU peak memory: 16.552 GiB
The 15.5b-23E variant has roughly 2.3× more parameters, so memory and TTFT/throughput will differ accordingly.
Prompt Reproducibility
The benchmark script builds the ctx128 prompt from this seed:
python
1seed =(2"The weather is clear today and the forecast says the afternoon will stay mild "3"with light wind. OpenVINO runs optimized inference on Intel hardware. "4)
It repeats the tokenized seed until it reaches 128 tokens, truncates to exactly 128, then uses greedy nanargmax token selection. To reproduce the same text, keep the tokenizer, prompt seed, context length, decode length, and KV handoff options unchanged.
Included Scripts
scripts/rebuild_from_original_ctx128_gpnd.py
scripts/benchmark_prefill_decode.py
scripts/repair_disaggregated_prefill_gpu.py
scripts/repair_decode_present_outputs.py
scripts/diagnose_disaggregated_logits.py
Pass a Hugging Face token through HF_TOKEN or --token only when remote model download is needed.