[GH-ISSUE #1757] Layer split (RTX 3090 + 2x Tesla P40, Windows): every batched prefill chunk aborts with prefill gemm: cublasGemmEx: cuBLAS status 14 — 100% on 0.1.40.4 / 0.1.41, single-GPU unaffected #702

Closed
opened 2026-11-04 01:45:11 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @vgame86 on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1757

Summary

With a 3-GPU layer split (RTX 3090 + 2x Tesla P40, Pascal sm_61) on Windows, every request whose rendered prompt exceeds the short-read threshold (~64 tokens) aborts the engine on its first batched prefill chunk with:

prefill gemm: cublasGemmEx: cuBLAS status 14

(CUBLAS_STATUS_INTERNAL_ERROR; the engine then std::exit(1)s via ck() in src/prefill/gemm.cu:81, and the server answers the client with the engine stopped unexpectedly (exit code 1); the next request restarts it.)

This is not tool/function-calling related and not a small-chunk issue: a plain multi-hundred-token Chinese prompt without tools crashes identically. Tools only made the visible difference because they render a 3-token message into a 277-token prompt, crossing the 64-token short-read threshold.

Reproduction

  • Windows 11 (WDDM), NVIDIA driver 551.61, CUDA 12.4 (driver-reported)
  • GPUs: 0 = RTX 3090 (sm_86, display), 1-2 = Tesla P40 24 GB (sm_61)
  • Engine: ready-made 0.1.41 release (CUDA 12.9 experimental build, BUILD.json: archs 60/61/70/75/80/86/89, "experimental": true)
  • Model: Qwen3.8-Flash-Next, IQ3_S (GSQ-RCO), 48 layers

Serve config (argv as logged):

strata.exe --serve --pack .../iq3_s --native ...-00001-of-00002.gguf --ple-gguf ...-00002-of-00002.gguf
  --expert-profile .../expert-profile.bin --expert-cache auto --prefill auto
  --spec 4 --spec-min-p 0.5 --mtp .../rt --max-context 65536 --kv int8
  --resident-experts --resident-budget-gib 16
  --layer-split 32,40 --vram-reserve-mib 400 --vision

(i.e. 3090: layers 0-31, P40 #1: 32-39, P40 #2: 40-47 + head).

Then send any chat request whose rendered prompt is > 64 tokens, e.g. a ~170-token question. With STRATA_TRACE=1 in the config's env:

strata trace: request 174 0
strata trace: prompt start 173 -1
strata trace: lent 149 slots for 256 tokens in 0.8 ms
strata trace: prompt chunk 0 of 169
prefill gemm: cublasGemmEx: cuBLAS status 14

Second session, identical:

strata trace: request 277 0
strata trace: prompt start 276 -1
strata trace: prompt chunk 0 of 272
prefill gemm: cublasGemmEx: cuBLAS status 14

What I can rule out / confirm

Configuration Result
3-GPU split (32,40), prompt ≤ 64 tokens (verify-window path) ✅ works, repeatedly
3-GPU split (32,40), prompt > 64 tokens (batched prefill) ❌ 100% abort on first chunk, every time, every session (0.1.40.4 and 0.1.41)
3-GPU split, 0.1.40.3, same shape ⚠️ intermittent — some sessions completed full conversations (1000+ token generations) before aborting; most aborted after 1-2 requests
Single GPU (3090 only, no --layer-split), same model/pack, long prompts (≥ 277 tokens, incl. multi-page answers) ✅ works, 0.1.40.3 and 0.1.41

Additional checks:

  • The aborting call is the BF16 Gemm::bf16 path (cublasGemmEx, CUDA_R_16BF, no f16 suffix in the error line). The Pascal fp32 fallback in the same function ("cublasSgemm (bf16 on Pascal)") never appears in any of the logs (0 occurrences across ~25 crash sessions), i.e. when the batched prefill runs on the P40 stages the code is reaching the raw BF16 cublasGemmEx — the path that #395 measured as unsupported on a P40. If that reading is right, the question is why bf16_path()/grow() silently falls through to the BF16 call instead of the cublasSgemm fp32 route on sm_61.
  • Free VRAM at crash time was low but not zero in most sessions (100/84/118 MiB; one session 0 MiB — the engine itself printed the LOW: requests may stall warning). Short reads (≤64 tokens) on the same sessions work, so it doesn't look like a plain OOM; but I have not isolated this (see "not yet tried").
  • No nvlddmkm/Display events in the Windows System log around the crash times — no TDR, no driver fault. It is a clean cuBLAS error return.
  • Unrelated to --resident-experts per se: 0.1.40.3 completed long replies with the same resident-RAM mode before aborting later.

Not yet tried (happy to run)

  1. STRATA_BF16_TC=2 (force the FP16 test path) on the split, to see whether the crash follows the BF16 call or the split itself.
  2. 2-GPU split (3090 + one P40) to see whether a single Pascal stage is enough to trigger it.
  3. 3-GPU split with --short-read 0 and --short-read 2048 to move the threshold.
  4. Same setup on a P40-only pair (no 3090) — I don't have a second sm_86 card, but community testers in #875/#1239 do.
  5. Linux, if you think WDDM is involved.

Full per-line logs of two sessions (startup → crash, STRATA_TRACE=1) are available; ask and I'll paste/attach.

  • #1650 — same abort signature (cublasGemmEx ... status 14) but on sub-32-token chunks with --short-read 0, reported on RTX 2080 Ti + P100. Possibly the same underlying GEMM-path bug, different trigger.
  • #395 — "cuBLAS has no BF16 GEMM for Pascal, measured NOT_SUPPORTED on a P40"; the code comment in src/prefill/gemm.cu routes Pascal through cublasSgemm fp32 — which is exactly the path we never observe taken.
  • #875 / #929 / #1239 / #1469 — other P40-in-a-layer-split reports for reference.

Workaround

Run the model on the 3090 alone (drop --layer-split and the P40s from gpu). Verified stable for long prompts and function-calling requests. Cost: no speed benefit from the P40s.

Originally created by @vgame86 on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1757 ## Summary With a 3-GPU layer split (RTX 3090 + 2x Tesla P40, Pascal sm_61) on Windows, **every request whose rendered prompt exceeds the short-read threshold (~64 tokens) aborts the engine on its first batched prefill chunk** with: ``` prefill gemm: cublasGemmEx: cuBLAS status 14 ``` (`CUBLAS_STATUS_INTERNAL_ERROR`; the engine then `std::exit(1)`s via `ck()` in `src/prefill/gemm.cu:81`, and the server answers the client with `the engine stopped unexpectedly (exit code 1); the next request restarts it`.) This is **not** tool/function-calling related and **not** a small-chunk issue: a plain multi-hundred-token Chinese prompt **without** `tools` crashes identically. Tools only made the visible difference because they render a 3-token message into a 277-token prompt, crossing the 64-token short-read threshold. ## Reproduction - Windows 11 (WDDM), NVIDIA driver **551.61**, CUDA 12.4 (driver-reported) - GPUs: 0 = RTX 3090 (sm_86, display), 1-2 = Tesla P40 24 GB (sm_61) - Engine: ready-made **0.1.41** release (CUDA 12.9 experimental build, `BUILD.json`: archs 60/61/70/75/80/86/89, `"experimental": true`) - Model: Qwen3.8-Flash-Next, IQ3_S (GSQ-RCO), 48 layers Serve config (argv as logged): ``` strata.exe --serve --pack .../iq3_s --native ...-00001-of-00002.gguf --ple-gguf ...-00002-of-00002.gguf --expert-profile .../expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp .../rt --max-context 65536 --kv int8 --resident-experts --resident-budget-gib 16 --layer-split 32,40 --vram-reserve-mib 400 --vision ``` (i.e. `3090: layers 0-31`, `P40 #1: 32-39`, `P40 #2: 40-47 + head`). Then send any chat request whose rendered prompt is > 64 tokens, e.g. a ~170-token question. With `STRATA_TRACE=1` in the config's `env`: ``` strata trace: request 174 0 strata trace: prompt start 173 -1 strata trace: lent 149 slots for 256 tokens in 0.8 ms strata trace: prompt chunk 0 of 169 prefill gemm: cublasGemmEx: cuBLAS status 14 ``` Second session, identical: ``` strata trace: request 277 0 strata trace: prompt start 276 -1 strata trace: prompt chunk 0 of 272 prefill gemm: cublasGemmEx: cuBLAS status 14 ``` ## What I can rule out / confirm | Configuration | Result | |---|---| | 3-GPU split (`32,40`), prompt ≤ 64 tokens (verify-window path) | ✅ works, repeatedly | | 3-GPU split (`32,40`), prompt > 64 tokens (batched prefill) | ❌ **100% abort on first chunk, every time, every session** (0.1.40.4 and 0.1.41) | | 3-GPU split, 0.1.40.3, same shape | ⚠️ intermittent — some sessions completed full conversations (1000+ token generations) before aborting; most aborted after 1-2 requests | | Single GPU (3090 only, no `--layer-split`), same model/pack, long prompts (≥ 277 tokens, incl. multi-page answers) | ✅ works, 0.1.40.3 and 0.1.41 | Additional checks: - The aborting call is the **BF16** `Gemm::bf16` path (`cublasGemmEx`, `CUDA_R_16BF`, no `f16` suffix in the error line). The Pascal fp32 fallback in the same function (`"cublasSgemm (bf16 on Pascal)"`) **never appears in any of the logs** (0 occurrences across ~25 crash sessions), i.e. when the batched prefill runs on the P40 stages the code is reaching the raw BF16 `cublasGemmEx` — the path that `#395` measured as unsupported on a P40. If that reading is right, the question is why `bf16_path()`/`grow()` silently falls through to the BF16 call instead of the `cublasSgemm` fp32 route on sm_61. - Free VRAM at crash time was low but not zero in most sessions (100/84/118 MiB; one session 0 MiB — the engine itself printed the `LOW: requests may stall` warning). Short reads (≤64 tokens) on the same sessions work, so it doesn't look like a plain OOM; but I have not isolated this (see "not yet tried"). - No `nvlddmkm`/Display events in the Windows System log around the crash times — no TDR, no driver fault. It is a clean cuBLAS error return. - Unrelated to `--resident-experts` per se: 0.1.40.3 completed long replies with the same resident-RAM mode before aborting later. ## Not yet tried (happy to run) 1. `STRATA_BF16_TC=2` (force the FP16 test path) on the split, to see whether the crash follows the BF16 call or the split itself. 2. 2-GPU split (3090 + one P40) to see whether a single Pascal stage is enough to trigger it. 3. 3-GPU split with `--short-read 0` and `--short-read 2048` to move the threshold. 4. Same setup on a P40-only pair (no 3090) — I don't have a second sm_86 card, but community testers in #875/#1239 do. 5. Linux, if you think WDDM is involved. Full per-line logs of two sessions (startup → crash, `STRATA_TRACE=1`) are available; ask and I'll paste/attach. ## Related - #1650 — same abort signature (`cublasGemmEx ... status 14`) but on sub-32-token chunks with `--short-read 0`, reported on RTX 2080 Ti + P100. Possibly the same underlying GEMM-path bug, different trigger. - #395 — "cuBLAS has no BF16 GEMM for Pascal, measured NOT_SUPPORTED on a P40"; the code comment in `src/prefill/gemm.cu` routes Pascal through `cublasSgemm` fp32 — which is exactly the path we never observe taken. - #875 / #929 / #1239 / #1469 — other P40-in-a-layer-split reports for reference. ## Workaround Run the model on the 3090 alone (drop `--layer-split` and the P40s from `gpu`). Verified stable for long prompts and function-calling requests. Cost: no speed benefit from the P40s.
Author
Owner

@Niko1221 commented on GitHub (Oct 10, 2026):

Thanks for the very precise report. Reading the code: the 0.1.42 fix for #1650 only retries the FP16 GEMM, and your failing call is the BF16 one. On Pascal the BF16 product goes through FP32 copies of the weight and of the activations. When the card had no room for those copies (you saw 100, 84, 118 and 0 MiB free), the code skipped the conversion and called the plain BF16 cuBLAS function, which a P40 answers with status 14. That fits every detail you list: single GPU works, short prompts (verify windows) work, 0.1.40.3 failing intermittently with the VRAM left.

v0.1.42 converts the weight in tiles when the whole copy does not fit, and if even a small tile does not fit the engine stops with a message that names the card and the settings to change, instead of status 14. On a Tesla P100 forced into the tiled path (about 150 MiB left) a 2,495-token prompt gave the same answer word for word as the untiled path. We could not reproduce status 14 itself on one card, since yours came from a layer split, so the test we would like is the same request that crashed, on v0.1.42. If it still fails, a higher --vram-reserve-mib or moving a layer or two from the P40s to the 3090 (--layer-split 34,41) gives those stages more room.

<!-- gh-comment-id:6099750409 --> @Niko1221 commented on GitHub (Oct 10, 2026): Thanks for the very precise report. Reading the code: the 0.1.42 fix for #1650 only retries the FP16 GEMM, and your failing call is the BF16 one. On Pascal the BF16 product goes through FP32 copies of the weight and of the activations. When the card had no room for those copies (you saw 100, 84, 118 and 0 MiB free), the code skipped the conversion and called the plain BF16 cuBLAS function, which a P40 answers with status 14. That fits every detail you list: single GPU works, short prompts (verify windows) work, 0.1.40.3 failing intermittently with the VRAM left. v0.1.42 converts the weight in tiles when the whole copy does not fit, and if even a small tile does not fit the engine stops with a message that names the card and the settings to change, instead of status 14. On a Tesla P100 forced into the tiled path (about 150 MiB left) a 2,495-token prompt gave the same answer word for word as the untiled path. We could not reproduce status 14 itself on one card, since yours came from a layer split, so the test we would like is the same request that crashed, on v0.1.42. If it still fails, a higher --vram-reserve-mib or moving a layer or two from the P40s to the 3090 (--layer-split 34,41) gives those stages more room.
Author
Owner

@vgame86 commented on GitHub (Oct 12, 2026):

After conducting further testing, I discovered that the issue stemmed from the different architectures of the two graphics cards. When I used only two Tesla P40s to load the model, the pre-fill block did not abort, and when I run llama.cpp with both the RTX 3090 and the Tesla P40, the issue does not occur. I’m not sure how the mainline llama.cpp resolves this problem.

<!-- gh-comment-id:6125536207 --> @vgame86 commented on GitHub (Oct 12, 2026): After conducting further testing, I discovered that the issue stemmed from the different architectures of the two graphics cards. When I used only two Tesla P40s to load the model, the pre-fill block did not abort, and when I run `llama.cpp` with both the RTX 3090 and the Tesla P40, the issue does not occur. I’m not sure how the mainline `llama.cpp` resolves this problem.
Author
Owner

@matunoki commented on GitHub (Oct 13, 2026):

Same symptom here with a different pair: TITAN X (Pascal, sm_61) + RTX 3090 (sm_86), 2-GPU layer split — and it also fails on the FP16 path, with plenty of free VRAM.

Environment: Engine 0.1.43.1 (CUDA 12 ready-made, includes f63a57e), Windows 11, driver 560.81, cuBLAS 12.9.1 (also tried 12.8), Qwen3.8-Flash-Next IQ3_XXS, "gpu": [0,1], "layer_split": "auto" (auto picks TITAN X = layers 0-2, 3090 = layers 3-47).

Symptom: prompts of ≤ ~70 tokens work; the first batched prefill chunk aborts with prefill gemm: cublasGemmEx: cuBLAS status 14 (exit code 0xC0000005). Single-GPU is unaffected.

What I tried:

  • 3090 as the first stage ("gpu": [1,0], "gpu_order": "as_given", layer_split 40): still aborts, so it is not about which card runs the first stage.
  • --prefill 1024 instead of auto (3328): still aborts.
  • --vram-reserve-mib 5000 (both cards with >4 GiB free; log says both keep their own prompt buffers, no loan): still aborts. So it does not look like the "no room for the FP32 conversion copies" case from the comment above.
  • STRATA_BF16_TC=2: the message becomes cublasGemmEx f16: cuBLAS status 14, i.e. the #1650 fixed-algorithm retry also fails here.
  • Swapping cublas64_12.dll for 12.8: no change.
  • A standalone program (cudaSetDevice(0); cudaFree(0); then BF16 cublasGemmEx on the other device, several shapes, all algos) does not reproduce it.
  • --peer-device 1 (second card as peer expert tier): fails at startup with "peer experts: stream: out of memory", even with --peer-slots 2000 --peer-reserve-mib 2500.

Works: --short-read 65536 (everything read through the decode windows): a 6020-token prompt finished, 80 tok/s read, 48-60 tok/s decode. Of course ~10x slower than the batched path.

Decode speed with 2 GPUs is about the same as the 3090 alone (48-60 vs 55-63 tok/s), so there is no gain either.

<!-- gh-comment-id:6152830067 --> @matunoki commented on GitHub (Oct 13, 2026): Same symptom here with a different pair: TITAN X (Pascal, sm_61) + RTX 3090 (sm_86), 2-GPU layer split — and it also fails on the FP16 path, with plenty of free VRAM. Environment: Engine 0.1.43.1 (CUDA 12 ready-made, includes f63a57e), Windows 11, driver 560.81, cuBLAS 12.9.1 (also tried 12.8), Qwen3.8-Flash-Next IQ3_XXS, "gpu": [0,1], "layer_split": "auto" (auto picks TITAN X = layers 0-2, 3090 = layers 3-47). Symptom: prompts of ≤ ~70 tokens work; the first batched prefill chunk aborts with `prefill gemm: cublasGemmEx: cuBLAS status 14` (exit code 0xC0000005). Single-GPU is unaffected. What I tried: - 3090 as the first stage ("gpu": [1,0], "gpu_order": "as_given", layer_split 40): still aborts, so it is not about which card runs the first stage. - --prefill 1024 instead of auto (3328): still aborts. - --vram-reserve-mib 5000 (both cards with >4 GiB free; log says both keep their own prompt buffers, no loan): still aborts. So it does not look like the "no room for the FP32 conversion copies" case from the comment above. - STRATA_BF16_TC=2: the message becomes `cublasGemmEx f16: cuBLAS status 14`, i.e. the #1650 fixed-algorithm retry also fails here. - Swapping cublas64_12.dll for 12.8: no change. - A standalone program (cudaSetDevice(0); cudaFree(0); then BF16 cublasGemmEx on the other device, several shapes, all algos) does not reproduce it. - --peer-device 1 (second card as peer expert tier): fails at startup with "peer experts: stream: out of memory", even with --peer-slots 2000 --peer-reserve-mib 2500. Works: --short-read 65536 (everything read through the decode windows): a 6020-token prompt finished, 80 tok/s read, 48-60 tok/s decode. Of course ~10x slower than the batched path. Decode speed with 2 GPUs is about the same as the 3090 alone (48-60 vs 55-63 tok/s), so there is no gain either.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156200875 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#702
No description provided.