gpo.zugaina.org

Search Portage & Overlays:

sci-ml/flm-q4nx-converter

Convert GGUF fine-tunes to FastFlowLM's Q4NX format for the Ryzen AI NPU

Screenshots

  • flm-q4nx-converter-0_pre20260827
    ~amd64
    python_single_target_python3_12 python_single_target_python3_13 python_single_target_python3_14

    View      Download      Browse     License: Apache-2.0   
    Overlay: stuff

ChangeLog

commit 51d56948fc3de6016d0371e66fdfc863ccff30f1
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sun Oct 11 09:45:21 2026 +0200

sci-ml/flm-q4nx-converter: new package, add 0_pre20260827

ROCm/FLM_Q4NX_Converter repacks the weights of a GGUF file into Q4NX,
the safetensors layout FastFlowLM loads on Ryzen AI NPUs. It does not
build NPU kernels, so it serves fine-tunes of models FastFlowLM already
ships. Upstream has no releases; this is the tip of main.

Five patches:
- configs-path: the layout configs were looked up in ./configs, which
only works from the source directory.
- qwen35-prefill-copies: upstream pull request 23. Without it a dense
Qwen3.5 conversion lacks tensors FastFlowLM requires.
- qwen35-value-heads and qwen38-27b: Qwen3.8-27B, which FastFlowLM
ships from 1.0.7 on and upstream cannot convert. The first makes the
dense path read its linear-attention layout from the GGUF instead of
assuming two value heads per key head; the second adds the model
with its multi-token-prediction layer. Neither is upstream. They are
stored xz-compressed and expanded in src_prepare.
- detect-size-label: gguf-py stores a name such as Qwen3.8-27B-MyTune
as basename Qwen3.8 and size label 27B. Matched by basename alone,
such a file is taken for plain Qwen3 and fails unless -f names the
model, so the two are tried joined first. A renamed fine-tune
matches no name at all; for it the GGUF architecture joined with
the size label is tried last. Not upstream.

The tree goes to /usr/share because upstream has no build metadata and
convert.py is a top-level script. Dependencies follow the imports;
setup_venv.sh installs several packages the code never uses.

flm-q4nx-check is an addition of this package. It compares the tensor
names, types and shapes of a converted file with the official file of
the base model, after checking that every tensor's byte range has the
length its type and shape imply and that the ranges fill the data
section. That is the check to make before loading a conversion on the
NPU.