Llama.cpp는 현재 MTP가 활성화된 사용자를 위해 CPU 기반 샘플링 (sampling)을 사용합니다. 이번 PR은 샘플링을 GPU로 이동시키며, 5090에서는 qwen3.6:35b 모델 기준 tok/s가 8% 증가하는 성능을 보여줍니다. 저는 제 P40에서 테스트했을 때 추론 속도가 4% 향상되는 것을 관찰했습니다. NVIDIA P40에서 최대 84 tok/s를 확인한 것은 매우 흥미로운 결과입니다. 백엔드 샘플링 (Backend sampling)은 Linux + Tesla P40 (sm_61, Pascal) 환경에서 약 4%의 개선을 보여줍니다.
CPU 샘플링 (CPU Sampling): llama-server -m Qwen3.6-35B-A3B-UD-IQ4_NL.gguf --spec-type draft-mtp --seed 42 python3 mtp-bench.py code_python pred= 192 draft= 132 acc= 124 rate=0.939 tok/s=73.1 code_cpp pred= 113 draft= 76 acc= 74 rate=0.974 tok/s=75.9 explain_concept pred= 192 draft= 159 acc= 111 rate=0.698 tok/s=62.4 summarize pred= 192 draft= 167 acc= 107 rate=0.641 tok/s=59.6 qa_factual pred= 192 draft= 159 acc= 111 rate=0.698 tok/s=62.4 translation pred= 119 draft= 92 acc= 73 rate=0.793 tok/s=67.0 creative_short pred= 192 draft= 197 acc= 92 rate=0.467 tok/s=50.7 stepwise_math pred= 192 draft= 133 acc= 124 rate=0.932 tok/s=73.6 long_code_review pred= 192 draft= 155 acc= 113 rate=0.729 tok/s=63.8
백엔드 샘플링 (Backend sampling): llama-server -m Qwen3.6-35B-A3B-UD-IQ4_NL.gguf --spec-type draft-mtp --seed 42 -bs python3 mtp-bench.py code_python pred= 192 draft= 132 acc= 124 rate=0.939 tok/s=76.2 code_cpp pred= 113 draft= 76 acc= 74 rate=0.974 tok/s=79.4 explain_concept pred= 192 draft= 159 acc= 111 rate=0.698 tok/s=64.6 summarize pred= 192 draft= 167 acc= 107 rate=0.641 tok/s=61.6 qa_factual pred= 192 draft= 159 acc= 111 rate=0.698 tok/s=64.6 translation pred= 119 draft= 92 acc= 73 rate=0.793 tok/s=69.6 creative_short pred= 192 draft= 197 acc= 92 rate=0.467 tok/s=52.1 stepwise_math pred= 192 draft= 133 acc= 124 rate=0.932 tok/s=76.6 long_code_review pred= 192 draft= 155 acc= 113 rate=0.729 tok/s=65.7
수락 비율 (Acceptance ratio)은 백엔드 샘플링과 CPU 샘플링 모두 정확히 동일합니다.
이 개선 사항은 RTX 5090에서의 개선(12% vs 4%)보다는 작지만, 이는 예상된 결과입니다. P40은 메모리 대역폭 제한 (memory-bandwidth-bound) 상태이기 때문입니다 (sm_61, 580 GB/s vs RTX 5090의 1,792 GB/s). 따라서 CPU↔GPU 로짓 (logits) 왕복 시간이 전체 디코딩 (decode) 시간에서 차지하는 비중이 더 작습니다. 그럼에도 불구하고, 제가 최근 본 것 중 tok/s(초당 토큰 수) 측면에서 가장 큰 개선입니다 (~+2 t/s). https://github.com/ggml-org/llama.cpp/pull/25532 /u/otacon6531 이 r/LocalLLaMA 에 제출함 [link] [comments]