Description
BPE tokenizers (Llama 3.1, Lexi) produce corrupted output (“???”) on Turing GPUs (Quadro RTX 6000, sm_75) when used via llama.cpp’s CUDA backend. SentencePiece tokenizers (Gemma) work correctly on the same hardware. I use LM STUDIO.
Environment
TensorRT Version: N/A (using cuBLAS directly via llama.cpp)
GPU Type: Quadro RTX 6000 (Turing sm_75, 24GB) + RTX 3070 Ti (Ampere sm_86, 8GB)
Nvidia Driver Version: 580.88
CUDA Version: 12.4
CUDNN Version: N/A
Operating System + Version: Windows 10 22H2 + WSL2 Ubuntu 24.04
Python Version: N/A
TensorFlow Version: N/A
PyTorch Version: N/A
Baremetal or Container: Baremetal
Relevant Files
llama.cpp source: GitHub - ggml-org/llama.cpp: LLM inference in C/C++ · GitHub (tag b9888, commit cb295bf)
ggml-cuda.cu: device property query at line 292 (cc = 100prop.major + 10prop.minor)
common.cuh: cublasSetMathMode at line 1478
mmq.cu: ggml_cuda_should_use_mmq() at line 267 (turing_mma_available check)
Steps To Reproduce
< 1. Build llama.cpp with CUDA support:
cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=“75-real;86-real”
cmake --build build --target llama-server
-
Run with Turing GPU only (isolate via CUDA_VISIBLE_DEVICES):
set CUDA_VISIBLE_DEVICES=1
llama-server.exe -m Llama-3.1-8B-Q5_K_M.gguf --port 1234 -ngl 99 -
Send inference request:
curl -X POST http://localhost:1234/v1/chat/completions
-d ‘{“model”:“test”,“messages”:[{“role”:“user”,“content”:“Hello”}]}’ -
Result: “???” (BPE tokenizer corrupted)
Expected: “Hello! How can I assist you?” -
Same test with CUDA_VISIBLE_DEVICES=0 (Ampere GPU):
Result: “Hello! How can I assist you?” (clean output)
Additional info:
- Model is confirmed on GPU via nvidia-smi (21.9GB VRAM on Quadro)
- SentencePiece models (Gemma 26B) work correctly on Quadro
- Only BPE tokenizers (Llama, Lexi, Qwen) are corrupted
- Tested with GGML_CUDA_FORCE_CUBLAS=ON → still corrupted
- Tested with cublasSetMathMode(CUBLAS_DEFAULT_MATH) → still corrupted
- Tested with GGML_CUDA_FORCE_CUBLAS_COMPUTE_32F=1 → still corrupted!
Please include:
- Exact steps/commands to build your repro
- Exact steps/commands to run your repro
- Full traceback of errors encountered
Regards
Tsitola