Skip to content

Commit 500956b

Browse files
authored
fix(vulkan): refresh ggml for AMD submission handling (#3482)
Refresh the pinned llama.cpp revision with AMD Vulkan submission batching and DeviceLost diagnostics, adapt the sampler API, and document Windows troubleshooting. Refs #3479.
1 parent b0d44bd commit 500956b

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

runtime/llama.cpp/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ set(LLAMA_BUILD_SERVER OFF CACHE BOOL "" FORCE)
3434
set(LLAMA_CURL OFF CACHE BOOL "" FORCE)
3535
FetchContent_Declare(llama
3636
GIT_REPOSITORY https://github.com/ggml-org/llama.cpp.git
37-
GIT_TAG 8086439a4cea94c71a5dfb8fe4ad1546aebd640f)
37+
# Includes the Vulkan submission-batching and DeviceLost diagnostics fixes
38+
# needed by recent AMD drivers (ggml-org/llama.cpp#26371).
39+
GIT_TAG 803b7fcae893e9caaee3921779628fef83ac0965)
3840
FetchContent_GetProperties(llama)
3941
if(NOT llama_POPULATED)
4042
FetchContent_Populate(llama)

runtime/llama.cpp/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,28 @@ cmake --build build-vulkan --config Release --target llama-funasr-sensevoice
187187
`--backend cpu` remains the default. The Windows Vulkan package currently
188188
accelerates SenseVoiceSmall only, matching the Linux Vulkan package.
189189

190+
#### AMD Windows troubleshooting
191+
192+
Recent AMD drivers can report `VK_ERROR_DEVICE_LOST` or terminate the process
193+
when a graph submission exceeds the driver's timeout. The pinned ggml revision
194+
reduces submission sizes on smaller AMD GPUs and fixes the batching threshold.
195+
To force smaller submissions or collect the last submitted tensors for a bug
196+
report, run from PowerShell with:
197+
198+
```powershell
199+
$env:GGML_VK_MAX_NODES_PER_SUBMIT = "16"
200+
$env:GGML_VK_SERIALIZE_SUBMISSIONS = "1"
201+
.\llama-funasr-sensevoice.exe `
202+
-m sensevoice-small-f16.gguf --vad fsmn-vad.gguf -a sample.wav --backend vulkan
203+
```
204+
205+
Try `8` or `1` if `16` still triggers a driver timeout. Include the complete
206+
stderr output, GPU model, and driver version when reporting a failure. Remove
207+
the variables after diagnosis because serial submissions can reduce throughput.
208+
Use `--backend cpu` as the reliable fallback on affected driver/device pairs.
209+
The current SenseVoiceSmall graph does not create a flash-attention operation,
210+
so a `--no-flash-attn` switch would not change this execution path.
211+
190212
## Build (shared)
191213
```bash
192214
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp

runtime/llama.cpp/fun-asr-nano/funasr-cli/funasr-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ int main(int argc,char**argv){
208208
llama_context*ctx=llama_init_from_model(model,cp);
209209
if(!ctx){fprintf(stderr,"failed to create llama context\n");llama_model_free(model);return 1;}
210210
auto sp=llama_sampler_chain_default_params(); llama_sampler*smpl=llama_sampler_chain_init(sp);
211-
if(rep!=1.0f) llama_sampler_chain_add(smpl,llama_sampler_init_penalties(256,rep,0.0f,0.0f));
211+
if(rep!=1.0f) llama_sampler_chain_add(smpl,llama_sampler_init_penalties(llama_vocab_n_tokens(vocab),256,rep,0.0f,0.0f));
212212
llama_sampler_chain_add(smpl,llama_sampler_init_greedy());
213213

214214
const char*prefix="<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n<|im_start|>user\n语音转写:";

0 commit comments

Comments
 (0)