Skip to content

port m train to use peft version of aloras #212

Closed

Description

@jakelorocco

When the m train code was written, peft had not yet added alora support directly. As a result, we are using a fork of peft for our alora support. This forked version is different from the alora support that eventually got added to peft.

Class names and parameter names / values changed between the versions. The PR that added the alora support directly to peft has an example of a fine-tuning script. We should make sure our fine-tuning example complies with that version.

Because of different parameter names / values, I believe aloras trained with this script will also stop working. For example, the original granite aloras do not work with the new peft version:

/opt/homebrew/Caskroom/miniforge/base/envs/gcom/lib/python3.12/site-packages/peft/config.py:165: UserWarning: Unexpected keyword arguments ['alora_invocation_tokens'] for class LoraConfig, these are ignored. This probably means that you're loading a configuration file that was saved using a higher version of the library and additional parameters have been introduced since. It is highly recommended to upgrade the PEFT version before continuing (e.g. by running `pip install -U peft`).

Activity

  1. added
    bug
    enhancement
    on Oct 24, 2025
  2. jakelorocco commented on Oct 24, 2025

    @jakelorocco
    ContributorAuthor

    fyi @nrfulton, I believe this will cause aloras trained with the script to not work with our huggingface backend once my rag-intrinsic changes are merged.

  3. nrfulton commented on Dec 10, 2025

    @nrfulton
    Member

    Assigning @avinash2692 for now, but we can pull in someone else if he doesn't have bandwidth.

  4. planetf1 commented on Feb 6, 2026

    @planetf1
    Contributor

    Now looking at this. Planning to update training.

  5. self-assigned this
    on Feb 6, 2026
  6. planetf1 commented on Feb 6, 2026

    @planetf1
    Contributor

    Updated train command & adding unit tests & integration tests

    Noted when adding an integration test

    test/cli/test_alora_train_integration.py::test_alora_training_integration - ValueError: Grad Scaler with MPS device requires a Pytorch >= 2.8.0
    

    Raised #421 - will test on cuda.

  7. planetf1 commented on Feb 6, 2026

    @planetf1
    Contributor

    Works on cuda:

    test/cli/test_alora_train_integration.py::test_alora_training_integration PASSED [ 52%]
    test/cli/test_alora_train_integration.py::test_lora_training_integration PASSED [ 54%]
    
  8. jakelorocco commented on May 12, 2026

    @jakelorocco
    ContributorAuthor

    Whoever picks up this issue, please make sure that it's not broken. It may actually be working right now.

  9. added
    area/alora
    area/backends
    and removed
    enhancement
    on May 20, 2026
  10. added
    p2
    on Jun 18, 2026
  11. planetf1 commented on Oct 6, 2026

    @planetf1
    Contributor

    Status (2026-10-06): the port completed in PR #422. Suggestion: close as done.

    cli/alora/train.py now uses PEFT 0.18.1's native aLoRA support: it imports LoraConfig straight from peft and sets alora_invocation_tokens there, and the IBM activated-lora fork is no longer referenced anywhere in the code. The pin is peft>=0.18.1 in pyproject.toml (native aLoRA arrived in 0.18.0).

    On your "make sure it's not broken" note from May: the unit test test/cli/test_alora_train.py asserts the config train.py passes to PEFT and runs in normal CI; the integration test test/cli/test_alora_train_integration.py does a full adapter training run, passed on CUDA at merge time (2026-02-06), and runs in the GPU nightly environment. The aLoRA 101 example was also rewritten against the new API in PR #1557 (merged 2026-08-24).

    One expected residue: adapters trained with the old fork still warn about unexpected keyword arguments when loaded under the new peft. That is the normal behaviour for stale artefacts, and the scope of this issue was the training script, so we do not count it as open work.

    Would it be ok to close this one as done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/aloraarea/backendsbugp2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions