fix: migrate from IBM alora to PEFT 0.18.1 native aLoRA#422
fix: migrate from IBM alora to PEFT 0.18.1 native aLoRA#422planetf1 wants to merge 1 commit intogenerative-computing:mainfrom
Conversation
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
89c4710 to
c2fa5c8
Compare
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
|
Example logs from run with cuda (integration+unit): |
jakelorocco
left a comment
There was a problem hiding this comment.
mostly lgtm; a few nits and looks like the tests are failing
|
The new alora tests do fail in CI with: Investigating |
36f4b55 to
c741486
Compare
Migrated m train command from deprecated IBM alora package to PEFT 0.18+ native aLoRA support. - Updated dependencies: removed alora==0.2.0, added peft>=0.18.1 - Replaced IBM imports with PEFT native API (LoraConfig, get_peft_model) - Changed invocation format: invocation_string → alora_invocation_tokens (list of token IDs) - Added comprehensive test suite: 4 unit tests + 2 integration tests with full adapter verification - Tests validate config format, weight integrity, adapter loading, and inference with/without activation
c741486 to
3e2a34e
Compare
|
The CI test failure is caused by not having GPU. The train needs to use CPU instead if no GPUs available. we have the same issue running locally on mac arm (mps) with the current pytorch version. This is why originally we skip the alora test on mac. However this means a mac user cannot use alora at all -- so looking at whether we can detect mps/bad pytorch and revert to cpu-only with a warning rather than fail. |
|
It's quite hard to get the initialization working in the train cli such that after detecting mps/backlevel pytorch it then uses cpu only. After a few attempts I feel an alternative is worthwhile. Fail as now .. but also add an option to use |
Fix: Migrate m train to PEFT 0.18.1 Native aLoRA
Description
Migrates
m traincommand from IBM's deprecatedalora==0.2.0package to PEFT 0.18.1+ native aLoRA support. This removes an external dependency and uses the officially supported PEFT API.Key Changes:
alora==0.2.0dependencypeft>=0.18.1LoraConfig,get_peft_model)alora_invocation_tokensparameter (list of token IDs) instead ofinvocation_stringSpecial Note:
I set peft to 0.18.1 not 0.18.0 (a minor update) since there are issues in swapping adapters & loading parameters which seemed as if they could affect the activities mellea performs
Hugging face tests run on cuda - working except for
FAILED test/backends/test_huggingface.py::test_error_during_generate_with_lockwhich seems a backend bug unrelated to thisTodos:
Implementation Checklist
Protocol Compliance
Integration
cli/alora/train.pywith PEFT native APIdocs/alora.mddocumentationTesting
test/cli/test_alora_train.py(4 tests, all passing)test/cli/test_alora_train_integration.py(2 tests, verified on CUDA)