Skip to content

Eval bug: Warning Message - sched_reserve: layer 0 is assigned to device CPU but the fused Gated Delta Net tensor is assigned to device CUDA0 (usually due to missing support) #24712

Closed as not planned

Description

@DDashT

Name and Version

version: 9671 (c1304d7)
built with MSVC 19.50.35723.0 for x64

Operating systems

Windows

GGML backends

CUDA

Hardware

GPU RTX 5060 Laptop (8GB)
CPU Intel Core Ultra 7 255HX (32GB)

Models

Qwen3.5-9B-Coder.Q4_K_M.gguf

Problem description & steps to reproduce

When I run llama-server with model Qwen3.5-9B-Coder.Q4_K_M.gguf --ctx-size 262144 --device CUDA0 I get a warning message regarding :

W sched_reserve: layer 0 is assigned to device CPU but the fused Gated Delta Net tensor is assigned to device CUDA0 (usually due to missing support)
W sched_reserve: fused Gated Delta Net (chunked) not supported, set to disabled

This results in significantly slower speeds. As per the interweb the release build lacks support even though I just did a pull of the latest version today and build everything from scratch even with a new NVIDIA GPU Computing Toolkit (CUDA) v13.3

First Bad Commit

No response

Relevant log output

Logs

```0.00.049.797 I log_info: verbosity = 3 (adjust with the -lv N CLI arg)
0.00.049.801 I device_info:
0.00.153.784 I - CUDA0 : NVIDIA GeForce RTX 5060 Laptop GPU (8150 MiB, 7043 MiB free)
0.00.153.801 I - CPU : Intel(R) Core(TM) Ultra 7 255HX (32189 MiB, 15402 MiB free)
0.00.153.853 I system_info: n_threads = 20 (n_threads_batch = 20) / 20 | CUDA : ARCHS = 1200 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | BLACKWELL_NATIVE_FP4 = 1 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
0.00.153.857 I srv llama_server: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true
0.00.153.902 I srv init: api_keys: ****Y123
0.00.153.932 I srv init: using 19 threads for HTTP server
0.00.154.110 I srv start: binding port with default address family
0.00.168.366 I srv llama_server: loading model
0.00.168.383 I srv load_model: loading model 'C:\Users\DST\Desktop\System\models\Qwen3.5-9B-Coder.Q4_K_M.gguf'
0.00.168.451 I common_init_result: fitting params to device memory ...
0.00.168.451 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.07.933.427 W sched_reserve: layer 0 is assigned to device CPU but the fused Gated Delta Net tensor is assigned to device CUDA0 (usually due to missing support)
0.07.933.433 W sched_reserve: fused Gated Delta Net (chunked) not supported, set to disabled
0.07.987.136 I common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
0.09.483.447 I srv load_model: initializing slots, n_slots = 4
0.10.621.623 W srv load_model: speculative decoding will use checkpoints
0.10.621.670 W common_speculative_init: no implementations specified for speculative decoding
0.10.621.673 I slot load_model: id 0 | task -1 | new slot, n_ctx = 262144
0.10.621.677 I slot load_model: id 1 | task -1 | new slot, n_ctx = 262144
0.10.621.678 I slot load_model: id 2 | task -1 | new slot, n_ctx = 262144
0.10.621.678 I slot load_model: id 3 | task -1 | new slot, n_ctx = 262144
0.10.621.759 I srv load_model: prompt cache is enabled, size limit: 8192 MiB
0.10.621.759 I srv load_model: use `--cache-ram 0` to disable the prompt cache
0.10.621.760 I srv load_model: for more info see #16391
0.10.621.761 I srv load_model: context checkpoints enabled, max = 32, min spacing = 256
0.10.621.789 I srv init: idle slots will be saved to prompt cache and cleared upon starting a new task
0.10.639.588 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

'
0.10.653.258 I srv init: init: chat template, thinking = 1
0.10.653.282 I srv llama_server: model loaded
0.10.653.287 I srv llama_server: server is listening on http://127.0.0.1:8070
0.10.653.298 I srv update_slots: all slots are idle

</details>

<!-- Long logs that you upload as files go here, outside the "console" area -->

Activity

  1. Kononnable commented on Jun 17, 2026

    @Kononnable
    Contributor

    Can you check if log show up with reduced context window? Something like --ctx-size 4096.
    It's far more likely that fit mechanism moves the layer to RAM/CPU because this model with large context is too large for 8GB VRAM.

  2. DDashT commented on Jun 17, 2026

    @DDashT
    Author

    Thanks for the prompt attention - Amazing!

    I can not find a log anywhere and some documentation i read said there will be no log on a windows system? Maybe you can direct me to where this would be? The docs i have read says all the logging will be what is showing up in the terminal window running the llama-server.

    I am thinking of also trying do download the latest binary to see if that'll make any difference so it's not my make-process that is messing anything up (even though i am following all instructions as per the documentation)

    I have tried setting the ctx-size to less than 262144, say 131072, and i get this response:

    0.08.771.101 W llama_context: n_ctx_seq (131072) < n_ctx_train (262144) -- the full capacity of the model will not be utilized
    0.09.469.060 W sched_reserve: layer 0 is assigned to device CPU but the fused Gated Delta Net tensor is assigned to device CUDA0 (usually due to missing support)
    0.09.469.065 W sched_reserve: fused Gated Delta Net (chunked) not supported, set to disabled

    The size of the model is ~6GB so it should fit, yes? I see your point about the fit mechanism but found documentation on using the
    --device CUDA0 flag to force llama-server to ONLY use the GPU and leave the smartness of the fit algo out of it to avoid this issue.

    Thanks for your help in advance - Greatly appreciated!

  3. leanderchandra1231-debug commented on Jun 17, 2026

    @leanderchandra1231-debug
  4. Kononnable commented on Jun 17, 2026

    @Kononnable
    Contributor

    The size of the model is ~6GB so it should fit, yes?

    Unfortunately no. Model(weights) is not the only thing that goes into VRAM. Some space is also needed for general compute and storing context. That is why I asked about setting context size to value like 4096. Didn't check for your particular model, but 131k context can easily take 2.5GB of memory.

  5. DDashT commented on Jun 17, 2026

    @DDashT
    Author

    Interesting! Your point about context size worked out!

    Image

    You can see GPU Memory usage here - First with ctx-size at 32768 and i got the same warning. Then starting up with just 4096 i did NOT get the warning even though it uses more or less the memory (~2-300MB less). I could actually go to a ctx-size of 16384 and it still worked. So i guess that is the problem - Context size.

    These are the log entries for device info running ctx-size 16384:
    0.00.048.391 I device_info:
    0.00.154.012 I - CUDA0 : NVIDIA GeForce RTX 5060 Laptop GPU (8150 MiB, 7043 MiB free)
    0.00.154.027 I - CPU : Intel(R) Core(TM) Ultra 7 255HX (32189 MiB, 11110 MiB free)
    0.00.154.077 I system_info: n_threads = 20 (n_threads_batch = 20) / 20 | CUDA : ARCHS = 1200 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | BLACKWELL_NATIVE_FP4 = 1 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
    0.00.154.081 I srv llama_server: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true

    Is there any way of "flushing" out whatever else is using the precious GPU memory (As per log (8150 MiB, 7043 MiB free))?

    This is the idle state of the GPU - using 1.7GB just idling! That seems a little crazy

    Image

    These are the processes using GPU resources currently. Clearly Teams, Brave and VSCode can be shut down and gain a little there but dwm.exe is by far eating up the most memory.

    Image

    I found this info on dwm.exe - Trying that now and restarting to see what that can do:

    Method 1: Windows Graphics Settings
    Open Settings > System > Display > Graphics.
    Click Browse under "Choose an app to set preference" and navigate to C:\Windows\System32\dwm.exe.
    Click Options for dwm.exe and select Power saving (usually uses integrated GPU) or High performance (uses discrete GPU).
    Click Save.

    Thank you for helping out with this - Amazing help! Please send a link so i can buy you a coffee - Or two! 😊😊

  6. John-194 commented on Jul 8, 2026

    @John-194
    Contributor

    I experienced this warning by going above a context threshold using --fit-ctx. The thing is about "layer 0 is assigned to device CPU". I found that patching this to

    hp_ngl = llama_model_n_layer(model) + llama_model_n_layer_nextn(model)

    fixed the warning and improved generation speed by 7%.
    Model I am using: Qwen 3.6 35B A3B with MTP.

  7. abnabdullah commented on Jul 21, 2026

    @abnabdullah

    I'm hitting the exact same issue with a different setup — confirms this isn't hardware-specific.

    Name and Version
    version: 10068+ (built from source, WSL2 Ubuntu, CUDA 13.3)

    Hardware
    GPU: NVIDIA GeForce RTX 5070 Ti (16GB VRAM)
    CPU: Intel Core Ultra 7 265KF (20 cores)
    RAM: 32GB

    Model
    Qwen3.6-27B (both Q5_K_S and UD-Q4_K_XL quants from unsloth/Qwen3.6-27B-GGUF)

    Problem
    Same warning appears regardless of quant size or -ngl value (tried -ngl 999 and -ngl -1):

    sched_reserve: layer 0 is assigned to device CPU but the fused Gated Delta Net tensor is assigned to device CUDA0 (usually due to missing support)
    sched_reserve: fused Gated Delta Net (chunked) not supported, set to disabled

    Result: generation speed is ~0.3 tokens/second (confirmed via print_timing logs across a 182-token generation, consistently 0.30-0.32 t/s throughout). GPU-Util shows 100% during generation but power draw stays near idle (~20W of 300W cap), suggesting the GPU is busy but not doing the actual heavy compute — consistent with the op falling back to CPU while something else spins on GPU.

    This happens even when the model fits within VRAM (confirmed via nvidia-smi, ~15.8GB/16.3GB used).

    Happy to provide full logs or test any proposed fix on this hardware.

  8. John-194 commented on Jul 21, 2026

    @John-194
    Contributor

    @abnabdullah How do you fit Q5 or Q4 27B into 16 GB VRAM using only ngl 99? Also try with
    GGML_CUDA_DISABLE_GRAPHS=1
    this solves issues for me when I try offloading to CPU

  9. HelloItMeMort commented on Jul 25, 2026

    @HelloItMeMort

    I experienced this warning by going above a context threshold using --fit-ctx. The thing is about "layer 0 is assigned to device CPU". I found that patching this to

    hp_ngl = llama_model_n_layer(model) + llama_model_n_layer_nextn(model)

    fixed the warning and improved generation speed by 7%. Model I am using: Qwen 3.6 35B A3B with MTP.

    This fixed it for me. I recommend you open a PR for this

  10. abnabdullah commented on Jul 25, 2026

    @abnabdullah

    I experienced this warning by going above a context threshold using --fit-ctx. The thing is about "layer 0 is assigned to device CPU". I found that patching this to
    hp_ngl = llama_model_n_layer(model) + llama_model_n_layer_nextn(model)
    fixed the warning and improved generation speed by 7%. Model I am using: Qwen 3.6 35B A3B with MTP.

    This fixed it for me. I recommend you open a PR for this

    great find، please open a PR

  11. abnabdullah commented on Jul 27, 2026

    @abnabdullah

    From 0.4 tok/s to a Fully Working Local AI Agent on a Single RTX 5070 Ti

    After several rounds of profiling, the real bottleneck was not the Qwen3.6 architecture or the Gated Delta Net kernel—it was VRAM pressure and memory offloading.

    Without an agent, Qwen3.6-27B UD-Q4_K_XL exceeded the available 16GB VRAM when fully offloaded, causing severe memory paging and only 0.4 tokens/sec Limiting GPU layers to -ngl 58 stabilized the hybrid CPU/GPU setup and improved generation to 7.68 tokens/sec without reducing model quality.

    The best standalone result came from switching to Qwen3.6-27B IQ4_XS, which still uses 4-bit quantization but fits completely on the GPU. At a 4K context window, it achieved:

    111 tokens/sec prompt processing
    42.75 tokens/sec generation
    738 generated tokens in about 17 seconds

    For the Hermes Agent integration, the configuration was expanded to a 65K context window with -ngl 59. Hermes worked successfully with OpenAI-compatible Chat Completions, Jinja tool calling, reasoning support, and compressed KV cache.

    The agent successfully completed a full autonomous workflow:

    Created project files
    Ran intentionally broken Python code
    Captured the real NameError
    Fixed the code
    Created automated tests
    Re-ran the tests until they passed
    Generated a structured report
    Calculated SHA256 hashes for the project files

    The main trade-off with Hermes is the large initial system prompt. Hermes sent approximately 19.5K tokens before the first user message, so the first response required around 42 seconds at 65K context. After the context was cached, later interactions dropped to roughly 8–17 seconds, with generation typically around 10–12 tokens/sec.

    Testing a 98K context window also worked, but reduced performance to approximately 9.6 tokens/sec, with the first request taking around 53 seconds. For this hardware, 65K is currently the best balance between agent capability, context size, and responsiveness.

    The final lesson: local AI performance is not only about model size. Quantization format, GPU layer allocation, context length, KV cache configuration, and prompt reuse can make the difference between an unusable system and a practical autonomous coding agent.

  12. John-194 commented on Jul 27, 2026

    @John-194
    Contributor

    @abnabdullah you should use --override-tensor instead of --ngl if a dense model does not fit VRAM. I have posts about that: server config and benchmark

  13. TheFuchsen commented on Aug 8, 2026

    @TheFuchsen

    I am running 2 3090s (total of 48gb of vram, 1gb reserved for windows) and I'm hitting this issue consistently with more than 8gb to spare between both cards.

    Using Qwen 3.6 27b Q8.

    Lowering the context lenght, despite having plenty of free vram, solved the issue most of the time. Now it doesn't. Removed the mmproj, same thing. Lowered the ctx even more, same thing. Lowered ubatch, same thing.

    If this was a memory allocation issue, it should be stated like that, triggering an OOM warning, not just arbitrarily dropping anything to CPU. I am not using auto fit.

    EDIT:

    No, the PR mentioned above did not fix it for me:

    Image
  14. TheFuchsen commented on Aug 8, 2026

    @TheFuchsen

    This is interesting: In my case, changing --spec-draft-n-max from 2 to 3 also causes layer 0 is assigned to device CPU but the fused Gated Delta Net tensor is assigned to device CUDA0 (usually due to missing support)

    Also, I'm noticing a considerably larger amount of memory being used in one GPU than the other, so I suspect is not "only" layer 0 that's dropping to system Ram:

    Image
  15. abnabdullah commented on Aug 9, 2026

    @abnabdullah

    @abnabdullah you should use --override-tensor instead of --ngl if a dense model does not fit VRAM. I have posts about that: server config and benchmark

    Thanks — I tested the --override-tensor approach extensively with Qwen3.6-27B IQ4_XS, and it works very well for this use case.

    Hardware:

    RTX 5070 Ti 16 GB
    Intel Core Ultra 7 265KF
    llama.cpp build 793 (221f0f6)

    Instead of partially offloading complete layers, I kept -ngl 99 and moved only selected FFN tensors to CPU, for example:

    -ot 'blk.(0|1|2|3|4|5|6|7|8|9).ffn_.*=CPU'

    With this configuration llama.cpp still reports:

    fused Gated Delta Net (autoregressive) enabled
    fused Gated Delta Net (chunked) enabled
    Lightning Indexer enabled

    So the attention/GDN tensors remain on CUDA while only the FFNs are placed on CPU.

    I later tested a larger configuration with two independent 64K slots:

    -c 131072
    -np 2
    -ot 'blk.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21).ffn_.*=CPU'

    This also loads successfully with fused GDN enabled.

    GPU buffers in that configuration were approximately:

    CUDA model: 11051.91 MiB
    KV cache: 2304.00 MiB
    recurrent: 299.25 MiB
    compute: 589.93 MiB

    This gave enough headroom on the 16 GB GPU and avoided the fused-GDN warning entirely.

    So at least for this hybrid Qwen architecture, tensor-level FFN offloading seems much better than moving complete blocks/layers to CPU.

    Thanks for pointing me in this direction.

  16. John-194 commented on Aug 9, 2026

    @John-194
    Contributor

    @abnabdullah if --override-tensor helped then consider testing my PR #26622 which implements this as a simple arg. Let me know in the PR if you like it.

    Also consider testing with Q4_K_S or Q4_K_M because IQ4_XS might be slower when using CPU

  17. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

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