Downloads · 30 days
0
RaffaelloMolinari/Deepseek-V4-Flash-Dspark-FST
Deepseek-V4-Flash-Dspark-FST is a text generation model from RaffaelloMolinari. Use it when you need the model to write or continue text. It is set up for fst. The card lists the license as other.
This is the FaStar .fst container of DeepSeek V4 Flash (DSpark), a 284-billion-parameter Mixture-of-Experts model. It is a format/quantization conversion of deepseek-ai/DeepSeek-V4-Flash-DSpark, not a retrained or fin…
Downloads · 30 days
0
Access
Public
Updated Jul 9, 2026
Repo size
175 GB
Likes
0
Public
Click a slice to open those files.
.fst175 GB · 100%
From the Hugging Face model README
This is the FaStar .fst container of DeepSeek V4 Flash (DSpark), a 284-billion-parameter
Mixture-of-Experts model. It is a format/quantization conversion of
deepseek-ai/DeepSeek-V4-Flash-DSpark,
not a retrained or fine-tuned model. The .fst format packs the model for execution on the
AMD Ryzen AI 9 365 XDNA2 NPU via the FaStar
inference engine, which spills the ~150 GB of expert weights across SSD → RAM → NPU scratch
buffers using expert virtual memory.
.fst
conversion and FaStar inference engine by Raffaello Molinari.license_link).deepseek-ai/DeepSeek-V4-Flash-DSpark.ds4_npu_engine --serve); see the
repository README.On-device research inference of DeepSeek V4 Flash on an AMD Ryzen AI 9 365 laptop NPU, using the FaStar engine. Suitable for studying expert virtual memory, on-NPU MLA/FFN via IRON-generated MLIR-AIE kernels, and consumer-NPU execution of a 284B model. Generation modes: one-shot, interactive multi-turn, and a streaming web chat UI.
As a reference format/checkpoint for porting other DeepSeek MoE models to the .fst container
and XDNA2 target, or as a substrate for experimenting with NPU kernel fusion, expert prefetch
strategies, and speculative-decoding acceptance tuning.
.fst container, sidecars, and bundled
.xclbin kernels target the AMD Ryzen AI NPU; they are not a drop-in replacement for the
upstream HuggingFace checkpoint on CPU/GPU.Users (both direct and downstream) should be made aware of the risks, biases and limitations inherited from the upstream DeepSeek model, the very low decode throughput, and the on-device NPU-only target. Verify the DeepSeek license terms before redistribution or commercial use.
Requirements: AMD Ryzen AI 9 365 (XDNA2 NPU), 64 GB RAM, ~200 GB NVMe SSD, Ubuntu 24.04 with XRT, AIEBU, and the AMDXDNA driver.
# Build the FaStar engine (CMake fetches header-only deps on first configure)
git clone https://github.com/RaffaelloMolinari/FaStar.git
cd FaStar
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
# XRT lives in /usr on Ubuntu, not /opt/xilinx
export XILINX_XRT=/usr
# One-shot generation (greedy, deterministic):
./build/ds4_npu_engine --model deepseek_v4_dspark.fst \
--prompt "Explain quantum computing" --tokens 128 --temp 0.0
# Speculative decoding with the DSpark draft model:
./build/ds4_npu_engine --model deepseek_v4_dspark.fst --draft_model dspark_draft.fst \
--prompt "Hello world" --tokens 256
# Web UI / chat server:
./build/ds4_npu_engine --model deepseek_v4_dspark.fst --serve --port 8080
This HuggingFace repo must contain: the .fst file, its .fst.hc / .fst.norm /
.fst.tid2eid sidecars, tokenizer.json, and (for speculative decoding) dspark_draft.fst.
The .fst.norm and .fst.hc sidecars are required for coherent output.
This model was not trained — it is a conversion of an existing checkpoint. Training details below describe the source model and the conversion procedure.
Inherited from the upstream deepseek-ai/DeepSeek-V4-Flash-DSpark checkpoint. See that model
card for the original training data.
Conversion to the .fst container (no weight fine-tuning):
python3 scripts/fst_converter.py --model deepseek-ai/DeepSeek-V4-Flash-DSpark \
--output deepseek_v4_dspark.fst
The .fst format stores a page-aligned config header, shared tensors (attention, router, norms)
in Q8_0 / BF16, and expert blocks as dense DS4 MXFP4 (17-byte blocks: 1 e8m0 scale + 16 FP4
nibbles). Verify integrity with scripts/verify_fst.py and scripts/check_fst.py.
Numerical correctness was verified against a pure-PyTorch HuggingFace ground-truth reference
(hf_bos_ref.py, hf_gen_ref.py) using the real DeepSeek weights, and qualitative coherence
was checked with free-form prompts (e.g. "The importance of NPU…").
Per-layer cosine similarity vs. the HF reference (MLA projections, FFN GEMM, dequantization); greedy prefill argmax token match; multi-token speculative-decoding acceptance rate; output coherence over a 43-layer prefill.
The engine produces coherent English, and greedy prefill argmax matches the HF ground truth. A deep-layer hidden-state residual (~±40 RMS at layer 42) is reproduced identically in the pure-PyTorch HF reference and is intrinsic to this checkpoint's MXFP4/MLA numerics, not a FaStar defect.
FaStar is mathematically faithful to the HuggingFace reference for this checkpoint, at the cost of very low on-NPU throughput (~0.05 tok/s). Correctness holds; throughput is the open problem.
Per-layer cosine audits of MLA (wq_a, wkv_a, wo_a, output projection), FFN
(gate/up/down GEMM), and MXFP4 dequantization are built into the repository
(scripts/fst_layer_benchmark.py, scripts/verify_fst_weights.py,
scripts/verify_fused_ffn.py, plus tools/ probes). These localize divergence to the
intrinsic deep-layer residual noted above.
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019). This is an inference-only artifact; the dominant carbon cost was paid upstream during DeepSeek's original training and is not attributable to this conversion.
Decoder-only MoE Transformer with Multi-head Latent Attention (Q latent 1024, KV latent 512), per-layer shared + routed experts (top-k = 6, hash-routed over the first 3 layers with route_scale = 1.5, swiglu_limit = 10), MXFP4 expert weights with e8m0 scales, Q8_0/BF16 shared tensors, and a V4 KV-compressor that streams 512-dim compressed KV rows. A small DSpark draft model enables speculative decoding. Objective: next-token text generation.
/usr; AIEBU assembler; AMDXDNA kernel driver.ds4_npu_engine, C++17, CMake build)..xclbin + _insts.bin ship in the
repo kernels/ directory.tokenizers for the HF BPE tokenizer bridge.If you use this work, please cite the upstream DeepSeek model and the FaStar engine.
BibTeX:
@misc{deepseek-v4-flash-dspark,
author = {{DeepSeek-AI}},
title = {DeepSeek V4 Flash (DSpark)},
howpublished = {\url{https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-DSpark}}
}
@misc{fastar,
author = {Raffaello Molinari},
title = {FaStar: Expert Virtual Memory Inference Engine for DeepSeek V4 Flash on AMD Ryzen AI NPU},
howpublished = {\url{https://github.com/RaffaelloMolinari/FaStar}}
}
APA:
DeepSeek-AI. (n.d.). DeepSeek V4 Flash (DSpark). HuggingFace. https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-DSpark
Molinari, R. (n.d.). FaStar: Expert virtual memory inference engine for DeepSeek V4 Flash on AMD Ryzen AI NPU. GitHub. https://github.com/RaffaelloMolinari/FaStar
.fst: FaStar's page-aligned model container (config header + shared tensors in
Q8_0/BF16 + dense DS4 MXFP4 expert blocks).ExpertPager LRU), uploaded to NPU scratch on demand..xclbin).AiebuKernelCache).See the FaStar repository README for the full architecture overview, CLI flags, web-UI API, kernel rebuild instructions, and known limitations.
Raffaello Molinari (.fst conversion + model card). Model weights and architecture by
DeepSeek-AI.
Open an issue on the FaStar GitHub repository.