제 RTX 4070 Super 12GB에서 llama.cpp를 사용하여 훌륭한 MTP 성능을 얻고 있었으나, MTP PR이 실제로 병합된 이후 성능이 급격히 떨어져 MTP를 사용하지 않을 때와 거의 차이가 없게 되었습니다. 그래서 MTP를 지원하면서 CPU 오프로딩 (CPU offloading)에 더 최적화되어 있다고 알려진 ik_llama.cpp를 시도해 보기로 했습니다. 이렇게 엄청난 속도 향상이 있을 줄은 예상하지 못했습니다!
벤치마크 결과를 진행하기 전에, 제 PC 사양은 다음과 같습니다:
OS: CachyOS (강력 추천)
GPU: RTX 4070 Super 12GB
CPU: AMD Ryzen 7 9700X
RAM: 48GB DDR5-6000 EXPO I
업데이트: 비교를 위해, byteshape가 최근에 출시한 Qwen3.6-35B-A3B-IQ4_XS-4.19bpw 양자화 (quant) 모델을 사용한 일반 llama.cpp의 mtp-bench.py 결과입니다. 이 모델은 Unsloth의 Q4_K_XL과 유사한 정확도를 가지면서도 크기는 4GB 더 작습니다:
❯ ./mtp-bench.py
code_python pred= 192 draft= 122 acc= 118 rate=0.967 tok/s=79.8
code_cpp pred= 192 draft= 117 acc= 110 rate=0.940 tok/s=89.1
explain_concept pred= 192 draft= 124 acc= 113 rate=0.911 tok/s=88.0
summarize pred= 192 draft= 139 acc= 127 rate=0.914 tok/s=95.0
qa_factual pred= 192 draft= 133 acc= 128 rate=0.962 tok/s=97.0
translation pred= 192 draft= 125 acc= 117 rate=0.936 tok/s=91.6
creative_short pred= 192 draft= 109 acc= 99 rate=0.908 tok/s=82.1
stepwise_math pred= 192 draft= 130 acc= 125 rate=0.962 tok/s=97.0
long_code_review pred= 192 draft= 121 acc= 115 rate=0.950 tok/s=88.2
Aggregate: {
"n_requests": 9,
"total_predicted": 1728,
"total_draft": 1120,
"total_draft_accepted": 1052,
"aggregate_accept_rate": 0.9393,
"wall_s_total": 21.86
}
이것은 평균 89.76 tok/s를 보여줍니다.
다음은 제가 사용한 llama.cpp 실행 명령어입니다. 벤치마크에서 결과가 분산되는 것을 방지하기 위해 Temperature는 0.0으로 설정했습니다:
llama-server \
-m Qwen3.6-35B-A3B-IQ4_XS-4.19bpw.gguf \
--fit on \
--fit-target 512 \
--ctx-size 131072 \
--cache-type-k q8_0 \
--cache-type-v q8_0 \
--cache-type-k-draft q8_0 \
--cache-type-v-draft q8_0 \
--spec-type draft-mtp \
--spec-draft-p-min 0.75 \
--spec-draft-n-max 3 \
--no-mmap \
--mlock \
--threads 8 \
--temp 0.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
이제, 같은 양자화(quant)를 사용했지만 ik_llama.cpp로 실행한 벤치마크 결과는 다음과 같습니다:
❯ ./mtp-bench.py
code_python pred= 192 draft= 135 acc= 122 rate=0.904 tok/s=105.1
code_cpp pred= 192 draft= 136 acc= 120 rate=0.882 tok/s=110.3
explain_concept pred= 192 draft= 133 acc= 116 rate=0.872 tok/s=109.0
summarize pred= 56 draft= 38 acc= 37 rate=0.974 tok/s=122.3
qa_factual pred= 192 draft= 141 acc= 127 rate=0.901 tok/s=116.0
translation pred= 192 draft= 143 acc= 113 rate=0.790 tok/s=104.1
creative_short pred= 192 draft= 133 acc= 118 rate=0.887 tok/s=109.4
stepwise_math pred= 192 draft= 140 acc= 125 rate=0.893 tok/s=114.6
long_code_review pred= 192 draft= 128 acc= 108 rate=0.844 tok/s=101.4
Aggregate: {
"n_requests": 9,
"total_predicted": 1592,
"total_draft": 1127,
"total_draft_accepted": 986,
"aggregate_accept_rate": 0.8749,
"wall_s_total": 16.64
}
이것은 평균 110.24 tok/s이며, 22% 증가한 수치입니다!
만약 12GB RTX GPU에서 비슷한 결과를 얻고 싶다면, llama.cpp와 다를 수 있는 다음 ik_llama.cpp 실행 매개변수를 사용하는 것이 좋습니다:
llama-server \
-m Qwen3.6-35B-A3B-IQ4_XS-4.19bpw.gguf \
--fit \
--fit-margin 1664 \
--ctx-size 131072 \
--cache-type-k q8_0 \
--cache-type-v q8_0 \
--cache-type-k-draft q8_0 \
--cache-type-v-draft q8_0 \
--multi-token-prediction \
--draft-p-min 0.75 \
--draft-max 3 \
--no-mmap \
--mlock \
--threads 8 \
--temp 0.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
또한, 저는 CachyOS에서 GPU를 보조 GPU로 실행하고 모니터를 iGPU에 연결하여 사용하기 가능한 VRAM을 100% 활용하고 있다는 점을 언급하고 싶습니다. 모델 로딩 시 OOM(Out Of Memory) 오류가 발생하면 --fit-margin 값을 1792 또는 심지어 2048로 늘려보세요.
감사합니다 :)