Skip to content

Comments

[Fix] Fix bugs and refactor codes in lora for better scalability.#3652

Merged
zhaochenyang20 merged 23 commits intosgl-project:mainfrom
aoshen524:feature/lora
Feb 20, 2025
Merged

[Fix] Fix bugs and refactor codes in lora for better scalability.#3652
zhaochenyang20 merged 23 commits intosgl-project:mainfrom
aoshen524:feature/lora

Conversation

@aoshen524
Copy link
Contributor

@aoshen524 aoshen524 commented Feb 18, 2025

Motivation

Motivation
#3414 reports issues regarding limited model support compared to test_generation_models.py. This PR refines the LoRA dataclasses and tests several trending LoRA models on Hugging Face, uncovering some bugs and providing warnings for them to be addressed later.

Modifications

  • Introduced LoRAAdaptor and LoRAModelCase dataclasses for improved test case management in test_lora_backend.py.
  • Implemented dynamic tolerance settings based on the model and adaptor in tests in test_lora_backend.py.
  • Fixed an issue where some LoRA modules only had gate weights and no up weights by initializing the up weights to zero in lora.py.
  • Added a temporary restriction for not supporting embedding and LM head in lora_config.py.
  • Fixed the handling of empty responses and ensured special tokens are skipped in runner.py.
  • Identified an accuracy problem when using flashinfer as the backend.

Checklist

  • Add backend test support for single adaptor.
  • Add backend test support for multi-adaptor, same rank.
  • Add backend test support for multi-adaptor, different rank.
  • Add backend test support for adaptor with Embedding and Lm_head layer weights.

-Introduce LoRAAdaptor and LoRAModelCase dataclasses for better test case management
-Implement dynamic tolerance settings based on model and adaptor
- Implement a TODO for supporting more modules in the future
@aoshen524 aoshen524 closed this Feb 18, 2025
@aoshen524 aoshen524 reopened this Feb 18, 2025
Copy link
Contributor

@Ying1123 Ying1123 left a comment

Choose a reason for hiding this comment

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

LGTM. Let's merge it after Baizhou's approval.

@Fridge003
Copy link
Collaborator

LGTM

@Fridge003 Fridge003 mentioned this pull request Feb 20, 2025
5 tasks
@zhaochenyang20 zhaochenyang20 merged commit e79f742 into sgl-project:main Feb 20, 2025
aoshen524 added a commit to aoshen524/sglang that referenced this pull request Mar 10, 2025
…l-project#3652)

Co-authored-by: ShenAo1111 <1377693092@qq.com>
Co-authored-by: zhaochenyang20 <zhaochen20@outlook.com>
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.

5 participants