Skip to content

[feat] add rsLoRA support to MultiLoRA#187

Merged
tastelikefeet merged 3 commits intomodelscope:mainfrom
xichengpro:main
May 8, 2026
Merged

[feat] add rsLoRA support to MultiLoRA#187
tastelikefeet merged 3 commits intomodelscope:mainfrom
xichengpro:main

Conversation

@xichengpro
Copy link
Copy Markdown
Contributor

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Write the detail information belongs to this PR.

Experiment results

Paste your experiment result here(if needed).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements Rank-Stabilized LoRA (rsLoRA) scaling logic across the linear, embedding, and Megatron forward methods. The reviewer recommends simplifying the scaling calculation with a ternary operator and abstracting the logic to reduce code duplication. A bug was also identified in the embedding forward pass where the LoRA configuration is initialized using an incorrect reference.

Comment thread src/twinkle/model/multi_lora.py Outdated
Comment thread src/twinkle/model/multi_lora.py Outdated
Comment thread src/twinkle/model/multi_lora.py Outdated
@tastelikefeet
Copy link
Copy Markdown
Collaborator

Hi, there are some gemini comments to be resolved

@xichengpro
Copy link
Copy Markdown
Contributor Author

Hi, there are some gemini comments to be resolved

Thanks for the feedback. I've refactored the rsLoRA scaling logic to use a ternary operator.

@tastelikefeet
Copy link
Copy Markdown
Collaborator

Can you please run pre-commit run --all-files to lint the code please? After this, this PR can be merged. Run pip install pre-commit to install pre-commit.

@xichengpro
Copy link
Copy Markdown
Contributor Author

Can you please run pre-commit run --all-files to lint the code please? After this, this PR can be merged. Run pip install pre-commit to install pre-commit.

Thanks for the feedback. All pre-commit checks now pass locally.

@tastelikefeet tastelikefeet merged commit c90fe10 into modelscope:main May 8, 2026
1 of 3 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