Repository navigation
Model: Skip standalone load for drafters that load with their target - #515
Merged
turboderp merged 1 commit intoNov 3, 2026
Merged
Conversation
exllamav3 1.6.6 (commit 07015a36) gave Gemma4AssistantForCausalLM the capability `load_with_target`: its modules are loaded by the target's load() on the devices of the K/V cache layers it reads, and a standalone load now raises a RuntimeError. Gate the standalone draft load on that cap and let the existing `draft_model=` hand-off to the target's load_gen do the work, mirroring exllamav3's own model_init wiring. Drafters without the cap (MTP component, DFlash) keep their standalone load, and on exllamav3 < 1.6.6 no drafter carries the cap, so behavior there is unchanged. Tensor-parallel targets are unaffected either way: the drafter load path in the target's load_gen already raises a NotImplementedError for them before any allocation. Fixes theroyallab#514
Collaborator
|
Thanks. 👍 |
turboderp
added a commit
that referenced
this pull request
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: this PR is AI-generated. My local AI agent wrote the commit and ran the tests below directly from a live debug session on my machine, under my supervision — every code reference and claim was verified by the agent against live runs and the cited commits during writing, including the negative control and the same-stack before/after measurement. I stand behind it. Follow-ups handled through me.
Closes #514 — root cause, minimal repro and the full environment write-up are in the issue.
Change
Gate the standalone drafter load on exllamav3's
load_with_targetcap and let the existingdraft_model=hand-off to the target'sload_gendo the work, mirroring exllamav3's ownmodel_init.py:378-381wiring. Seven lines inbackends/exllamav3/model.py.The
draft_model is not Nonenarrowing keeps the new condition from adding a freshreportOptionalMemberAccessnext to the preexisting one on the standalone line.Tested (live; single RTX 3090; tabbyAPI @
01f939c+ this commit; exllamav3 1.6.6 release wheel+cu132.torch2.11.0, torch 2.11.0+cu130, Python 3.14.8)exllamav3/model/model.py:603— the exact Gemma4 assistant drafter (google/gemma-4-*-it-assistant) can't load with exllamav3 1.6.6: "loads with its target model: pass it as draft_model to the target's load()" #514 traceback.google/gemma-4-31b-it-assistantdrafter (draft_mode: model,draft_num_tokens: 3, cache 49,152) loads in 6.0–6.2 s (2.5 s warm relaunch); the guard logs the skip; full RP sessions run normally: 44.2 / 47.1 T/s decode (draft 175/567 = 31%, 286/828 = 35% at 17.8k–18.8k prompts), 930/938 T/s prefill (cold, none cached), a 28-token chat completion at 56.3 T/s (draft 17/33 = 52%), cleanModel unloaded.on shutdown.elifpath is byte-identical to before;grep -rl load_with_targetacross exl3 1.6.6 namesarchitecture/gemma4_assistant.pyas the only cap carrier.ruff 0.11.10check + format clean; the docker-smoke import line (import main; from common import model, sampling; from endpoints.OAI import router) imports fine against this tree.Notes
NotImplementedErrorfrom the targetload_gen— this guard neither hides nor triggers it.model_init(which builds a draftCachefor every drafter regardless of the cap) — no behavior divergence touched here.