Repository navigation
Fix #26558: Eval bug: llama-server hard crash (cublasSgemm INVALID_VALUE) with --spec-type draft-mtp under KV-cache saturation - #27368
ZisIsNotZis wants to merge 2 commits into
Conversation
I agree we should guard against destroying in-flight graphs, but the current time-out of 10s means we would be working at 0.1 t/s (or enqueue the work 10s in advance) - both of which seem unlikely. Note that behavior is to graciously clean-up after execution has finished in CUDA.
Those are systems I have easy access to, and could use for investigation |
|
@ORippler Thanks for the reply! That makes sense, a better method is probably to track each graph's lifecycle instead of blindly syncing, but I think this would require changing a lot of code? Currently the patch does not continuously reduce token throughput, but it can add latency and reduce throughput at eviction points by waiting for all outstanding work on the device’s created streams.robably going to decrease speed, maybe not that extreme at 0.1t/s. For cublas, I'm on 13.6.0.2-1. I don't have higher level hardware, and I think it's probably more difficult to reproduce on higher level cards because if CUDA graph finishes within 10s, nothing happens. Maybe downclocking GPU or simply stress the GPU first somehow, then stress test llama-server so that it don't get enough compute? |
|
#26558 (comment) No longer repros. |
Overview
This PR fixes #26558. The bug was in CUDA graph cache eviction. Cached graphs are launched asynchronously, but stale graph executables were destroyed without waiting for all CUDA streams to finish. MTP graph churn could then leave in-flight work using destroyed graph state, causing the later cublasSgemm_v2 error.
The patch:
Additional information
Minimal stress snippet:
Run the server with:
build/bin/llama-server \ -m "$HOME/hf/Qwen3.5-0.8B-UD-Q4_K_XL.gguf" \ --spec-type draft-mtp --temp 0 \ -c 8192 -np 4 --kv-unified \ --host 127.0.0.1 --port 18081 --no-webuiA passing result is that the process remains alive and the server log contains no CUDA, cuBLAS, abort, or segmentation-fault errors. HTTP errors due to KV-cache exhaustion are not the CUDA crash.
Requirements