fix(quantisation): QuantoLoraConv2d cannot be constructed (update_layer missing use_dora) - #3192
Merged
bghira merged 1 commit intoSep 1, 2026
Conversation
…ora argument
QuantoLoraConv2d defines its own update_layer with use_dora as a required
positional parameter, but __init__ calls it with only six arguments:
self.update_layer(adapter_name, r, lora_alpha, lora_dropout, init_lora_weights, use_rslora)
so constructing the layer raises
TypeError: update_layer() missing 1 required positional argument: 'use_dora'
QuantoLoraConv2d is the QConv2d entry in custom_module_mapping and is
instantiated by dispatch_default, so quanto LoRA on any model with Conv2d
layers cannot be set up at all.
use_dora is already a parameter of __init__ (guarded to False just above), and
update_layer uses it to drive dora_init and the self.use_dora bookkeeping, so
passing it through is what the method was written to receive.
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.
Problem
QuantoLoraConv2dcannot be constructed. It defines its ownupdate_layerwithuse_doraas a required positional parameter:but
__init__calls it with six arguments (peft_workarounds.py:187):This is not a dead path:
QuantoLoraConv2dis theQConv2dentry incustom_module_mappingand is instantiated bydispatch_default, so quanto LoRA on any model withConv2dlayers fails during module replacement.Why
use_dora, specificallyIts sibling
QuantoLoraLinearcallsupdate_layerwith the same six arguments and is fine, because it does not define its ownupdate_layer— it inherits peft'sLoraLayer.update_layer, whereuse_dorahas a default.QuantoLoraConv2doverrides the method without a default, so the same six-argument call no longer binds. That asymmetry is the whole bug.use_dorais already a parameter ofQuantoLoraConv2d.__init__(and is guarded toFalsetwo lines above), andupdate_layergenuinely consumes it:so today the
self.use_dora[adapter_name] = Falsebookkeeping never runs either. Passing the parameter through is what the method was written to receive.Verification
Both
self.update_layer(...)call sites in the file were replayed against theupdate_layerresolved for their own class, usingast+inspect.Signature.bind(parse only — nothing imported, no torch or quanto needed):Formatting checked with the repo's pinned hook —
black 24.8.0 --line-length=125(from.pre-commit-config.yaml) reports the file unchanged both before and after. The new line is 109 characters, within the 125 limit, andflake8runs withE501in--extend-ignoreregardless.Net diff: +1 / −1.
🤖 Generated with Claude Code