Fix initialization bug introduced in #2960#3006
Merged
Merged
Conversation
added 2 commits
January 22, 2026 15:30
The quantized adalora SVD layers were not initialized in the new config-passing scheme and therefore raised errors in the GPU tests. For reproduction run ``` make tests_examples_single_gpu ``` which will yield ``` FAILED tests/test_gpu_examples.py::PeftBnbGPUExampleTests::test_4bit_adalora_causalLM - TypeError: SVDLinear4bit.__init__() missing 1 required positional argument: 'config' FAILED tests/test_gpu_examples.py::PeftBnbGPUExampleTests::test_8bit_adalora_causalLM - TypeError: SVDLinear8bitLt.__init__() missing 1 required positional argument: 'config' ```
Now it seems that a ValueError is raised indicating that the lora linear implementation only supports 8 bit for now.
ydshieh
reviewed
Jan 29, 2026
| } | ||
| ) | ||
| new_module = SVDLinear8bitLt(target, adapter_name, **kwargs) | ||
| new_module = SVDLinear8bitLt(target, adapter_name, config=lora_config, **kwargs) |
There was a problem hiding this comment.
Is SVDLinear8bitLt defined in peft? If so, Just make sure we handle the deprecation etc.
Collaborator
Author
ydshieh
reviewed
Jan 29, 2026
|
|
||
| self._active_adapter = adapter_name | ||
| self.update_layer(adapter_name, r, config=config) | ||
| self.update_layer(adapter_name, r, lora_alpha, config=config) |
There was a problem hiding this comment.
not so sure the reason here, especially it passes a new positional argument. It won't break something?
Collaborator
Author
There was a problem hiding this comment.
This is just so that it is compatible with all the other update_layer definitions - the parameter was simply forgotten in PR #2960. Adding lora_alpha restores compatibility.
ydshieh
approved these changes
Jan 29, 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.
The quantized adalora SVD layers were not initialized in the new config-passing scheme and therefore raised errors in the GPU tests.
For reproduction run
which will yield
Note that it seems that with torch 2.10 the error message for torchao linear 4 bit has changed from a
RuntimeErrorto aValueErrorbut it is still the case that 4 bit is not supported, therefore the solution is to expect both exception types.