Skip to content

[BUG] EXL3 reserve allocations ignored for device IDs > 0 #405

Closed

Description

@figuernd

OS

Linux

GPU Library

CUDA 12.x

Python version

3.12

Describe the bug

Autosplit reserve (and the equivalent for tensor parallel) ONLY works for device ID 0.

Reproduction steps

In a system with multiple GPUs try something like autosplit_reserve: [1024,1024]. Device ID 1 will not reserve anything.

Expected behavior

Should reserve for each device as described in the documentation.

Logs

No response

Additional context

No response

Acknowledgements

  • I have looked for similar issues before submitting this one.
  • I have read the disclaimer, and this issue is related to a code bug. If I have a question, I will use the Discord server.
  • I understand that the developers have lives and my issue will be answered when possible.
  • I understand the developers of this program are human, and I will ask my questions politely.

Activity

  1. added
    bug
    on Dec 26, 2025
  2. frenzybiscuit commented on Dec 26, 2025

    @frenzybiscuit

    Cannot reproduce

    (venv) tabbyapi@llm:~/tabbyapi/tabbyAPI$ ./start.sh
    Activating venv
    pip 24.0 from /home/tabbyapi/tabbyapi/tabbyAPI/venv/lib/python3.12/site-packages/pip (python 3.12)
    Loaded your saved preferences from `start_options.json`
    Starting TabbyAPI...
    2025-12-26 12:58:43.542 INFO:     Using backend exllamav3
    2025-12-26 12:58:43.544 INFO:     exllamav3 version: 0.0.18
    2025-12-26 12:58:43.764 WARNING:  The provided model does not have vision capabilities that are supported by ExllamaV3. Vision input is disabled.
    2025-12-26 12:58:43.765 WARNING:  Draft model is disabled because a model name wasn't provided. Please check your config.yml!
    2025-12-26 12:58:43.766 INFO:     Attempting to load a prompt template if present.
    2025-12-26 12:58:43.769 INFO:     Using template "chat_template" for chat completions.
    2025-12-26 12:58:43.771 INFO:     Loading model: /home/tabbyapi/tabbyapi/exl3/MS2411-123B-Animus-Redux-V12.0-4.25BPW-H16-EXL3
    2025-12-26 12:58:43.771 INFO:     Loading with tensor parallel
     -- NCCL init: world_size 4, rank 3, device 0, init_method tcp://127.0.0.1:33567
     -- NCCL init: world_size 4, rank 0, device 1, init_method tcp://127.0.0.1:33567
     -- NCCL warmup, device 0, please wait...
     -- NCCL init: world_size 4, rank 1, device 2, init_method tcp://127.0.0.1:33567
     -- NCCL warmup, device 2, please wait...
     -- NCCL init: world_size 4, rank 2, device 3, init_method tcp://127.0.0.1:33567
     -- NCCL warmup, device 3, please wait...
     -- NCCL warmup, device 1, please wait...
     -- Finished NCCL warmup, device 2
     -- Finished NCCL warmup, device 0
     -- Finished NCCL warmup, device 1
     -- Finished NCCL warmup, device 3
    2025-12-26 12:59:29.034 INFO:     Model successfully loaded.
    Loading model modules ���������������������������������������� 100% 91/91 0:00:00
    2025-12-26 12:59:29.037 INFO:     Your API key is: removed
    2025-12-26 12:59:29.037 INFO:     Your admin key is: removed
    2025-12-26 12:59:29.037 INFO:
    2025-12-26 12:59:29.037 INFO:     If these keys get compromised, make sure to delete api_tokens.yml and restart the server. Have fun!
    2025-12-26 12:59:29.038 INFO:     Generation logging is disabled
    2025-12-26 12:59:29.038 INFO:     Applied sampler overrides from file.
    2025-12-26 12:59:29.039 INFO:     Developer documentation: http://192.168.11.3:5000/redoc
    2025-12-26 12:59:29.042 INFO:     Starting OAI API
    2025-12-26 12:59:29.042 INFO:     Completions: http://192.168.11.3:5000/v1/completions
    2025-12-26 12:59:29.043 INFO:     Chat completions: http://192.168.11.3:5000/v1/chat/completions
    2025-12-26 12:59:29.064 INFO:     Started server process [79315]
    2025-12-26 12:59:29.065 INFO:     Waiting for application startup.
    2025-12-26 12:59:29.065 INFO:     Application startup complete.
    2025-12-26 12:59:29.066 INFO:     Uvicorn running on http://192.168.11.3:5000 (Press CTRL+C to quit)
    

    Using the following:

      tensor_parallel: true
    
      # Sets a backend type for tensor parallelism. (default: native).
      # Options: native, nccl
      # Native is recommended for PCIe GPUs
      # NCCL is recommended for NVLink.
      tensor_parallel_backend: nccl
    
      # Automatically allocate resources to GPUs (default: True).
      # Not parsed for single GPU users.
      gpu_split_auto: true
    
      # Reserve VRAM used for autosplit loading (default: 96 MB on GPU 0).
      # Represented as an array of MB per GPU.
      autosplit_reserve: [256, 256, 256, 256]
    
      # An integer array of GBs of VRAM to split between GPUs (default: []).
      # Used with tensor parallelism.
      gpu_split: [24, 24, 24, 24]
    
  3. figuernd commented on Dec 29, 2025

    @figuernd
    Author

    Disable tensor parallel and change autosplit reserve to [256, 256, 256, 24576] - assuming you have 24GB in device 3, it will ignore the reservation still use device 3.

  4. CNmnius commented on Feb 7, 2026

    @CNmnius

    I'm not sure if it is relevant, but found a weird behavior about autosplit_reserve settings.

    GPU0: 5070Ti, GPU1: 4070TiS.
    Windows 11, NVIDIA-SMI CUDA 13.1, NVCC CUDA 12.8

    • default setting: autosplit_reserve: [96]
      When I load Mistral-Small-3.2-24B-Instruct-2506-exl3_4.0bpw with default settings (TP disabled), the program does not seem equally divide the model on both GPU. Using more VRAM on GPU1.

    • alternative setting 1: autosplit_reserve: [96, 10240]
      I intended to utilize more VRAM on GPU0. However the result is same as the default setting.

    • alternative setting 2: autosplit_reserve: [10240, 96]
      This setting works as I intended, using up 15 GB of VRAM on GPU0 and 5 GB on GPU1.

  5. sashko-zakharchuk commented on Aug 15, 2026

    @sashko-zakharchuk
    Contributor

    Two separate things here. tabbyAPI substitutes its 96 MB default for your autosplit_reserve in
    most split configurations, so exllamav3 never sees your value. In the one configuration where it
    does get through, the reserve is a load-time cap, not a persistent allocation. #450 fixes the
    first; the second is library behaviour and is what the case in the title runs into.

    What backends/exllamav3/model.py passes to load_gen for autosplit_reserve: [1024, 1024]
    (MB as configured; the code divides by 1024 and passes GB):

    config (multi GPU unless noted)        reserve_per_device   use_per_device
    one GPU                                96                   None
    tensor_parallel: true, no gpu_split    96                   None
    gpu_split_auto: false, no gpu_split    96                   None
    autosplit, no gpu_split                1024, 1024           None
    gpu_split set, with or without TP      None                 gpu_split
    

    Only plain multi GPU autosplit carries your value. The parse sits inside the autosplit branch, and
    gpu_split is tested ahead of it and nulls the reserve, which is the # Causes crash if set with GPU split TODO. exllamav3 then pads a short list with 0.5 GB per device
    (exllamav3/model/model.py:387), so on a 4 GPU box the two multi GPU 96 MB rows load with
    [96, 512, 512, 512] MB however you configured it. Your value is discarded on every device,
    device 0 included. A draft model with draft_gpu_split and no gpu_split is worse: it gets
    reserve_per_device and use_per_device at once and trips
    assert not (bool(reserve_per_device) and bool(use_per_device)) before it loads.

    @figuernd the tensor parallel half of your report is real: on main, TP never reads your list, and
    with the patch it does, though on that path exllamav3 subtracts it from each device's free VRAM
    to size the split, and grows every budget by 10% when the split does not fit, so it is not held
    back the way it is on the autosplit path. Your reproduction steps are plain autosplit, which is
    the row that already forwards it, so [1024, 1024] does reach exllamav3 there. What happens on
    arrival is the second thing: set_memory_fraction_reserve is applied to a device only when the
    loader first places a module on it (model_ls.py:135), and every touched device goes back to
    fraction 1.0 once loading finishes (:214). If the model fits on device 0, device 1 is never
    touched and its entry is never applied, and either way nothing stays reserved after load, so
    nvidia-smi will not show it. For the goal in your follow-up, keeping the loader off a device,
    exllamav3 has a direct way: a negative entry for that device excludes it from the split, as long
    as one device is left non-negative. Your follow-up only changes tensor_parallel and
    autosplit_reserve in the config above it, so if that config keeps gpu_split: [24, 24, 24, 24]
    it takes the None row and never tests the reserve.

    @frenzybiscuit your config sets gpu_split: [24, 24, 24, 24], which is tested ahead of the
    autosplit branch and applies with or without tensor parallel, so
    autosplit_reserve: [256, 256, 256, 256] never gets a say. load_gen received
    reserve_per_device=None, use_per_device=[24, 24, 24, 24], so that run could not have shown the
    reserve doing anything either way. Drop gpu_split and your TP config becomes one of the rows
    this changes, if you want to A/B it.

    @CNmnius yours is plain multi GPU autosplit too, so this parse fix will not move your numbers. The
    loader fills the first device until a module runs out of memory and only then advances
    (model_ls.py:202), and it never moves weight back. All three of your results fit if torch's
    device 0 is the card nvidia-smi shows as GPU1. The default [96] pads to 96 MB and 512 MB, so
    that card fills first and ends up holding more. [96, 10240] caps the other one at roughly
    5.5 GB, and the leftover still fits under that, so nothing changes. [10240, 96] caps the first
    at about 5 GB and pushes the rest across, which is the 15/5 you saw. I cannot see which card is
    which from here, so it is worth checking, in tabby's venv:

    venv\Scripts\python -c "import torch; print([torch.cuda.get_device_name(i) for i in range(torch.cuda.device_count())])"
    

    #450 reads the reserve once, ahead of the split branching, so the discarding configurations
    forward your value, and it logs the discard on the gpu_split and draft_gpu_split paths instead
    of dropping it with no warning, since exllamav3 accepts only one of the two. It covers the draft
    assert as well. It does not change the load-time behaviour above. One caveat: a configured reserve
    now takes effect where it used to be replaced with the default, so a large value can turn a config
    that loads today into an Insufficient VRAM in split failure, and under tensor parallel a reserve
    at or above free VRAM on every device makes exllamav3's allocator spin instead of raising, which
    is turboderp-org/exllamav3#288.

    The load_gen arguments come from driving create() and load_model_sync() with exllamav3
    stubbed out. The behaviour is from loading real EXL3 models across two and three GPUs on 1.4.2:
    the fill order, the spill, and the release of the cap are measured, as is the reserve being inert
    in slot 1 and moving weight when set in slot 0. exllamav3 line numbers are from 1.4.2, tabbyAPI's
    from main.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions