Views
No views yet
| File | Purpose |
|---|---|
fuse3.cpp | C++ graph builder (place in src/models/) |
fuse3.h | C++ header (place in src/models/) |
fuse3_converter.py | Python GGUF converter (place in conversion/) |
export_gguf.py | Standalone GGUF exporter (no llama.cpp fork needed to create GGUF) |
INTEGRATION.md | Step-by-step patches for llama.cpp source files |
1pip install gguf safetensors torch
2python export_gguf.py --model-dir /path/to/fuse-1-Lite --output fuse-1-Lite-f16.gguf --outtype f161git clone https://github.com/ggerganov/llama.cpp
2cd llama.cpp
3
4# Apply patches (see INTEGRATION.md)
5# Copy fuse3.cpp and fuse3.h to src/models/
6# Copy fuse3_converter.py to conversion/
7# Modify src/llama-arch.h, src/llama-arch.cpp, src/llama-model.cpp, src/CMakeLists.txt
8
9# Build
10cmake -B build -DGGML_CUDA=ON
11cmake --build build --config Release1./build/bin/llama-cli \
2 -m fuse-1-Lite-f16.gguf \
3 -p "Write a Python function to check if a number is prime." \
4 -n 512 --temp 0.1Lfm2AttentionDecoderLayer) and short-conv (Lfm2ShortConvDecoderLayer) graph builderssqrtsoftplus(x @ router_weight) → top-k selection → normalizesoftplus(expert_scale) clamped to 0.1host_output + scale * expert_outputtoken_embd.weight, token_embd_norm.weight, output.weightblk.{i}.attn_norm.weight, blk.{i}.attn_q/k/v.weight, blk.{i}.attn_output.weightblk.{i}.attn_q_norm.weight, blk.{i}.attn_k_norm.weightblk.{i}.ffn_norm.weight, blk.{i}.ffn_gate/up/down.weightblk.{i}.shortconv_conv/inproj/outproj.weightblk.{i}.fuse3_router.weight — {n_embd, n_exp} router gateblk.{i}.fuse3_expert_scale.weight — {1} learned scale parameterblk.{i}.fuse3_experts.gate.weight — {n_embd, n_ff_exp, n_exp} stacked expert gatesblk.{i}.fuse3_experts.up.weight — {n_embd, n_ff_exp, n_exp} stacked expert up projectionsblk.{i}.fuse3_experts.down.weight — {n_ff_exp, n_embd, n_exp} stacked expert down projectionsfuse3.augmented_layers — array of layer indices with expertsfuse3.expert_counts — per-layer expert count arrayfuse3.swiglu_limit — float, expert activation clamp (default 10.0)fuse3.expert_scale_init — float, initial scale (not used at inference)1# Q4_K_M (recommended)
2./build/bin/llama-quantize fuse-1-Lite-f16.gguf fuse-1-Lite-q4_k_m.gguf q4_k_m
3
4# Q8_0
5./build/bin/llama-quantize fuse-1-Lite-f16.gguf fuse-1-Lite-q8_0.gguf q8_0