Eval bug: Always OOM with mtp model + rocm
Name and Version
image: ghcr.io/ggml-org/llama.cpp:server-rocm build 9191
Operating systems
Linux
GGML backends
CUDA
Hardware
7900xtx
Models
https://huggingface.co/unsloth/Qwen3.6-27B-MTP-GGUF/tree/main Qwen3.6-27B-UD-Q4_K_XL.gguf
https://huggingface.co/llmfan46/Qwen3.6-27B-uncensored-heretic-v2-Native-MTP-Preserved-GGUF Qwen3.6-27B-uncensored-heretic-v2-Native-MTP-Preserved-Q4_K_M.gguf
Problem description & steps to reproduce
Start docker container, browse to 127.0.0.1:8089, prompt "say hi"
ive tried 50k tokens, still oom
services:
llamacpp-server:
# Note: Ensure this image supports your Intel GPU (SYCL)
image: ghcr.io/ggml-org/llama.cpp:server-rocm
restart: unless-stopped
ports:
- "8089:8089"
shm_size: '6gb'
devices:
- "/dev/kfd:/dev/kfd"
- "/dev/dri:/dev/dri"
group_add:
- video
environment:
# Critical for 7900 XTX (gfx1100)
- HSA_OVERRIDE_GFX_VERSION=11.0.0
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/llamacpp:/models:rw
command: >
-m /models/Qwen3.6-27B-uncensored-heretic-v2-Native-MTP-Preserved-Q4_K_M.gguf
--alias qwen
--host 0.0.0.0
--port 8089
--parallel 1
--threads 4
--fit on
--fit-target 2048
--fit-ctx 76800
--spec-type draft-mtp
--spec-draft-n-max 2
--kv-unified
--reasoning-budget 2048
--reasoning-budget-message "\n\nThinking limit reached. Output the best answer possible given the reasoning so far."
--n-gpu-layers 999
--no-mmproj
--no-mmap
--temp 0
--min-p 0.05
--top-p 0.95
--top-k 20
--repeat-penalty 1.0
--presence-penalty 0.0
--flash-attn on
--cache-ram 4096
--jinja
--cache-type-k q8_0
--cache-type-v q8_0
--webui-mcp-proxy
--tools all
# llamacp-embedding-server:
# image: ghcr.io/ggml-org/llama.cpp:server
# restart: unless-stopped
# ports:
# - "8088:8088"
# volumes:
# - /etc/localtime:/etc/localtime:ro
# - /opt/llamacpp:/models:rw
# command: >
# -m /models/nomic-embed-text-v1.Q8_0.gguf
# --host 0.0.0.0
# --port 8088
# --threads 8
# --ctx-size 2048
# --n-gpu-layers 0
# --embedding
# --alias nomic
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
ports:
- "3000:8080"
volumes:
- open-webui-data:/app/backend/data
environment:
# Tell Open WebUI to look for an OpenAI-compatible API (llama.cpp)
- 'OPENAI_API_BASE_URLS=http://llamacpp-server:8089/v1'
- 'OPENAI_API_KEYS=sk-no-key-required'
- 'ENABLE_OLLAMA_API=False' # Optional: disables the default Ollama check
restart: always
volumes:
open-webui-data:
First Bad Commit
No response
Relevant log output
warn: LLAMA_ARG_HOST environment variable is set, but will be overwritten by command line argument --host
0.00.048.295 I log_info: verbosity = 3 (adjust with the -lv N CLI arg)
0.00.048.297 I device_info:
0.00.048.313 I - ROCm0 : AMD Radeon RX 7900 XTX (24560 MiB, 24510 MiB free)
0.00.048.317 I - CPU : AMD Ryzen 7 5800X 8-Core Processor (48091 MiB, 48091 MiB free)
0.00.048.340 I system_info: n_threads = 4 (n_threads_batch = 4) / 16 | ROCm : NO_VMM = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
0.00.048.363 I srv init: running without SSL
0.00.048.377 I srv init: using 15 threads for HTTP server
0.00.048.431 W srv main: -----------------
0.00.048.432 W srv main: CORS proxy is enabled, do not expose server to untrusted environments
0.00.048.432 W srv main: This feature is EXPERIMENTAL and may be removed or changed in future versions
0.00.048.432 W srv main: -----------------
0.00.048.437 W srv main: -----------------
0.00.048.437 W srv main: Built-in tools are enabled, do not expose server to untrusted environments
0.00.048.438 W srv main: This feature is EXPERIMENTAL and may be changed in the future
0.00.048.438 W srv main: -----------------
0.00.048.440 I srv start: binding port with default address family
0.00.049.568 I srv main: loading model
0.00.049.570 I srv load_model: loading model '/models/Qwen3.6-27B-uncensored-heretic-v2-Native-MTP-Preserved-Q4_K_M.gguf'
0.00.049.585 I common_init_result: fitting params to device memory ...
0.00.049.587 I common_init_result: (for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on)
0.12.435.350 W llama_context: n_ctx_seq (151808) < n_ctx_train (262144) -- the full capacity of the model will not be utilized
0.12.554.781 W common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
0.12.770.253 I srv load_model: creating MTP draft context against the target model '/models/Qwen3.6-27B-uncensored-heretic-v2-Native-MTP-Preserved-Q4_K_M.gguf'
0.13.033.220 I srv load_model: initializing slots, n_slots = 1
0.13.055.153 I common_context_can_seq_rm: the context supports bounded partial sequence removal
0.13.104.161 I common_speculative_init: adding speculative implementation 'draft-mtp'
0.13.104.219 I srv load_model: speculative decoding context initialized
0.13.104.220 I slot load_model: id 0 | task -1 | new slot, n_ctx = 151808
0.13.104.257 I srv load_model: prompt cache is enabled, size limit: 4096 MiB
0.13.104.258 I srv load_model: use --cache-ram 0 to disable the prompt cache
0.13.104.258 I srv load_model: for more info see https://github.com/ggml-org/llama.cpp/pull/16391
0.13.104.268 I srv init: idle slots will be saved to prompt cache and cleared upon starting a new task
0.13.117.755 I init: chat template, example_format: '<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
Hello<|im_end|>
<|im_start|>assistant
Hi there<|im_end|>
<|im_start|>user
How are you?<|im_end|>
<|im_start|>assistant
with/without fit on, it happened in CUDA as well. i use nvtop to see the available ram from my 3x3090. basically the last gpu will hit OOM while the other 2 gpu still have plenty of ram available. i suspect the calculation/allocation of memory usage with MTP enabled never factor in "the new running layers".
edit: model loaded successfully. but when processing for the first reply. it will hit OOM. the last gpu memory suddenly spikes
Yep I get the same error with CUDA. It seems like FIT doesn't calculate the size of MTP correctly on the last graphics card. If I do --fit-target 256,BUFFER_SIZE
BUFFER_SIZE being the amount of memory it fails to allocate, it will work correctly.
Another datapoint: I hit an OOM with rocm. No OOM with vulkan (but I am unsure if MTP is actually working in vulkan).
also hitting this on CUDA with Mimo v2.5 + MTP enabled. Without MTP loads fine, with MTP, OOM.
Same issue, RX 7900 XTX / gfx1100, unsloth Qwen3.6-27B-UD-Q4_K_XL. Server loads clean, OOM on first decode. Lowering ctx to 73728 and adding --cache-ram 0 resolved it for me. The fit estimator seems to undercount memory when MTP is involved — it passes pre-flight but there's not enough headroom left by the time inference actually runs.
Additional datapoint from a real AMD/Qwen setup:
I have been running Qwen3.6-27B-MTP on an R9700 32 GB via HIP/ROCm for long local agent loops, and the stable path for me was noticeably more conservative than the repro here.
The combination of:
- Native MTP
- q8_0 KV cache
- 4 GB prompt cache
- ~75k+ effective ctx / fit sizing
looks very plausible as the thing that pushes 24 GB cards over the edge on first decode, even if load / fit succeeds.
So from user side this does look like a real MTP memory accounting problem, but the mitigations that matched my experience were the same direction other commenters found:
- reduce ctx a bit
- disable or shrink
--cache-ram - keep some real headroom after fit instead of using the full estimate
On my side, once I stayed more conservative on the total memory envelope, HIP + MTP became stable. So I would look very closely at the fit estimator / first-decode allocation path when MTP is enabled.