Eaman's patches for llama.cpp, optimizations for small language models.


[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]AGENTS.md2026-08-26 14:48 6.5K 
[   ]\2026-08-26 15:07 3.6K 
[TXT]dual_gpu_context_balancing_guide.md2026-08-25 13:38 13K 
[TXT]history.md2026-08-26 14:48 12K 
[TXT]improvemets_list.md2026-08-19 19:29 6.7K 
[TXT]latest_rocm_improvement_3737e41.patch2026-08-26 14:48 99K 
[TXT]latest_rocm_improvement_no_adaptive_mtp_3737e41.patch2026-08-25 13:06 79K 
[DIR]llama_scripts/2026-08-27 23:52 -  
[DIR]logs/2026-08-25 13:40 -  
[TXT]mtp_compact_rollback.md2026-08-26 14:48 17K 
[TXT]mtp_compact_rollback_3737e41.patch2026-08-26 14:48 80K 
[TXT]mtp_compact_rollback_no_adaptive_3737e41.patch2026-08-25 13:06 61K 
[TXT]mtp_cr_eaman.md2026-08-26 10:03 16K 
[DIR]old/2026-08-25 14:12 -  
[DIR]patches/2026-08-26 14:33 -  
[TXT]summary_eaman.md2026-08-26 14:48 77K 
[TXT]usage_eaman.md2026-08-26 14:49 770  

Eaman ROCm/MTP patch for llama.cpp

What the patches do

Improvements now provided by upstream llama.cpp

Recent llama.cpp versions already include joint target/MTP memory fitting, recalculate MTP memory for every candidate context size and pass the final fitted context directly to runtime. These upstream improvements replace parts of the older Eaman fitting and MoE workaround code.

How to build:


git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
git checkout 3737e41
wget https://store.piffa.net/lm/bug/latest_rocm_improvement_3737e41.patch
git apply latest_rocm_improvement_3737e41.patch

You can build for both Vulkan and ROCm backends at the same time, the idea is that Vulkan saves some more vRAM while ROCm gives better prefill performance.


HIPCXX="$(hipconfig -l)/clang" \
HIP_PATH="$(hipconfig -R)" \
cmake -S . -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_HIP_ARCHITECTURES="gfx1030;gfx1031" \
    -DGGML_HIP=ON \
    -DGGML_VULKAN=ON \
    -DGGML_CUDA_FA_ALL_QUANTS=ON \
    -DLLAMA_BUILD_SERVER=ON

cmake --build build \
    --config Release \
    -j"$(nproc)"

How to use: options for llama-server:

Simple MTP example


     --spec-mtp-cr-depth  1 --spec-draft-adaptive \
     --spec-type draft-mtp --spec-draft-p-min 0.75 --spec-draft-n-max 7 \
     --cache-type-k-draft q4_0 --cache-type-v-draft q4_0 \
  
  

Example llama-server scripts for 16GB gpu and dual 16+12GB. Made for AMD 6800 plus 6700XT.