Skip to content

Eval bug: CUDA SOFT_MAX "invalid argument" on qwen4_exp / Qwen3.8-Flash-Next (Blackwell, compute_120a) #28403

Description

@celalergun

Name and Version

build: b10808-64a155d24
llama-cli --version
version: 0.3.0-dev (build 10808, commit 64a155d)
built with GNU 15.2.0 for Linux x86_64

Operating systems

Linux
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 26.04 LTS
Release: 26.04
Codename: resolute

Which llama.cpp modules do you know to be affected?

llama-server, llama-cli

GGML backends

CUDA

Hardware

NVIDIA RTX PRO 4500 Blackwell (Workstation Edition), 32 GB GDDR7, compute capability 12.0 (compute_120a)
Driver 595.71.05, CUDA Version (nvidia-smi) 13.2
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Tue_Jun_09_02:43:40_PM_PDT_2026
Cuda compilation tools, release 13.3, V13.3.73
Build cuda_13.3.r13.3/compiler.38244171_0

Models

unsloth/Qwen3.8-Flash-Next-GGUF, quant UD-Q4_K_XL (4-shard GGUF: Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf)
Architecture: qwen4_exp (Qwen3.8-Flash-Next), support merged via #27742 on 2026-08-27

Operating systems

Linux

GGML backends

CUDA

Hardware

Intel(R) Xeon(R) Silver 4410Y + NVIDIA RTX PRO 4500 Blackwell Server Edition

Models

Qwen3.8-Flash-Next-GGUF

Problem description & steps to reproduce

Every attempt to actually run inference on this model with the CUDA backend crashes with a CUDA "invalid argument" error in the SOFT_MAX op, always at the same source location (ggml-cuda.cu:2417). This is fully reproducible and I've isolated it to the CUDA execution path specifically — the identical model file runs correctly on CPU only.

Tested configurations, in order:

  1. llama-server with -ngl 99 --cpu-moe (all experts offloaded to CPU, dense/attention layers on GPU) — crashed on the first real client request (via curl to /v1/chat/completions), after the model finished loading successfully.
  2. llama-server with -ngl 99 --cpu-moe --parallel 1 --flash-attn off — crashed earlier, during the server's own internal startup warmup pass (before "model loaded" is printed), so this combination fails even without any client request.
  3. llama-cli with -ngl 0 (no GPU layers) — still crashed on the first prompt. This turned out to be because --no-op-offload is required to actually prevent CUDA from being used at all; -ngl 0 alone still routes CPU-resident tensor ops through the GPU via the automatic "op offload" optimization.
  4. llama-cli with -ngl 0 --no-op-offload (fully CPU, no CUDA involvement) — succeeds, produces coherent output (~3.8–4.1 tok/s, as expected for CPU-only on this model size).

So: any configuration that lets CUDA execute the SOFT_MAX op for this architecture crashes; the only working configuration is the one that avoids CUDA entirely.

First Bad Commit

Not bisected. Architecture support (qwen4_exp) was merged via #27742 on 2026-08-27; this may be present since that merge or introduced by one of the follow-up PRs (#27880, #27941, #27977, #27836). Happy to bisect if a maintainer can point me at likely candidate commits given this is CUDA/SOFT_MAX-specific.

Command line

Crash (config 1):
llama-server
-m unsloth/Qwen3.8-Flash-Next-GGUF/UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf
-ngl 99 --cpu-moe
-c 32768 --jinja
--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0
--host 0.0.0.0 --port 8080
--api-key "..."

Crash (config 2):
llama-server
-m unsloth/Qwen3.8-Flash-Next-GGUF/UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf
-ngl 99 --cpu-moe
-c 32768 --jinja
--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0
--host 0.0.0.0 --port 8080
--api-key "..."
--parallel 1 --flash-attn off

Crash (config 3):
llama-cli
-m unsloth/Qwen3.8-Flash-Next-GGUF/UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf
-ngl 0
-c 4096
-p "Write a haiku about GPUs running out of memory."
-n 64

Works (config 4):
llama-cli
-m unsloth/Qwen3.8-Flash-Next-GGUF/UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf
-ngl 0 --no-op-offload
-c 4096
-p "Write a haiku about GPUs running out of memory."
-n 64

Relevant log output

Crash trace (identical failure point across configs 1–3) /home/bartererpatio/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu:108: CUDA error E ggml_cuda_compute_forward: SOFT_MAX failed E CUDA error: invalid argument E current device: 0, in function ggml_cuda_compute_forward at /home/bartererpatio/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu:2417 E err /home/bartererpatio/llama.cpp/build/bin/libggml-base.so.0(+0x1b236) [...] /home/bartererpatio/llama.cpp/build/bin/libggml-base.so.0(ggml_print_backtrace+0x20d) [...] /home/bartererpatio/llama.cpp/build/bin/libggml-base.so.0(ggml_abort+0x166) [...] /home/bartererpatio/llama.cpp/build/bin/libggml-cuda.so.0(ggml_cuda_error+0xb5) [...] /home/bartererpatio/llama.cpp/build/bin/libggml-base.so.0(ggml_backend_sched_graph_compute_async+0x89f) [...] /home/bartererpatio/llama.cpp/build/bin/libllama.so.0(llama_context::graph_compute+0xa0) [...] /home/bartererpatio/llama.cpp/build/bin/libllama.so.0(llama_context::process_ubatch+0x119) [...] /home/bartererpatio/llama.cpp/build/bin/libllama.so.0(llama_context::decode+0x3e6) [...] /home/bartererpatio/llama.cpp/build/bin/libllama.so.0(llama_decode+0x12) [...] /home/bartererpatio/llama.cpp/build/bin/libllama-server-impl.so(server_context_impl::decode+...) [...] /home/bartererpatio/llama.cpp/build/bin/libllama-server-impl.so(server_queue::start_loop+0x138) [...] Aborted (core dumped)

(full untruncated trace available on request — captured identically across configs 1, 2, and 3)

Successful CPU-only run (config 4) for comparison build : b10808-64a155d24 model : unsloth/Qwen3.8-Flash-Next-GGUF/UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf ftype : Q4_K - Medium

Write a haiku about GPUs running out of memory.
[Start thinking]

[ Prompt: 19.7 t/s | Generation: 3.8 t/s ]

Coherent output produced, no crash, confirming the model/quant/build are otherwise sound.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions