Skip to content

Fix initialization bug introduced in #2960#3006

Merged
githubnemo merged 2 commits into
huggingface:mainfrom
githubnemo:issue/adalora-bnb-init
Jan 29, 2026
Merged

Fix initialization bug introduced in #2960#3006
githubnemo merged 2 commits into
huggingface:mainfrom
githubnemo:issue/adalora-bnb-init

Conversation

@githubnemo
Copy link
Copy Markdown
Collaborator

@githubnemo githubnemo commented Jan 22, 2026

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'

Note that it seems that with torch 2.10 the error message for torchao linear 4 bit has changed from a RuntimeError to a ValueError but it is still the case that 4 bit is not supported, therefore the solution is to expect both exception types.

nemo 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.
}
)
new_module = SVDLinear8bitLt(target, adapter_name, **kwargs)
new_module = SVDLinear8bitLt(target, adapter_name, config=lora_config, **kwargs)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is SVDLinear8bitLt defined in peft? If so, Just make sure we handle the deprecation etc.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed! However, we consider this not part of the public API, otherwise #2960 would have needed to do that in the first place, this is just a patch to fix places where the change from #2960 was forgotten.


self._active_adapter = adapter_name
self.update_layer(adapter_name, r, config=config)
self.update_layer(adapter_name, r, lora_alpha, config=config)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not so sure the reason here, especially it passes a new positional argument. It won't break something?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@githubnemo githubnemo requested a review from ydshieh January 29, 2026 10:50
@githubnemo githubnemo merged commit 1630ca8 into huggingface:main Jan 29, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants