feat: modernize dependencies; add Qwen3; refactor attention/rope; add alignment tests#36
Open
mikecovlee wants to merge 6 commits into
Open
feat: modernize dependencies; add Qwen3; refactor attention/rope; add alignment tests#36mikecovlee wants to merge 6 commits into
mikecovlee wants to merge 6 commits into
Conversation
* update_0121 * Add tests for alignment of various models with flash attention and eager implementations - Introduced new test files for alignment testing of models including Gemma2, Phi, Phi3, Llama, Qwen2, and Mistral. - Implemented tests for flash attention forward pass in `test_alignment_flash_attn.py`. - Added eager path tests for Gemma2 and Phi models in `test_alignment_gemma2_eager.py` and `test_alignment_gemma_phi.py`. - Created alignment tests for Llama and Qwen2 models in `test_alignment_llama_qwen2.py`. - Included tests for Mistral and Phi3 models in `test_alignment_mistral_phi3.py`. - Each test verifies model configuration, initialization, and output shapes, ensuring proper integration with the PEFT framework. * Fix code quality issues: typos, documentation, unused imports, and code organization (#5) * Initial plan * Fix review comments: typos, comments, and code quality issues Co-authored-by: mikecovlee <16332179+mikecovlee@users.noreply.github.com> * Fix CI: Make qwen3 import conditional to support older transformers versions Co-authored-by: mikecovlee <16332179+mikecovlee@users.noreply.github.com> * Remove Qwen code from modeling_mistral.py and fix all casual→causal typos Co-authored-by: mikecovlee <16332179+mikecovlee@users.noreply.github.com> * Fix bare except clause in launch.py Co-authored-by: mikecovlee <16332179+mikecovlee@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mikecovlee <16332179+mikecovlee@users.noreply.github.com> * [fix] update torch and transformers dependencies to specific versions * [refactor] update Qwen model imports and improve softcap parameter formatting --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: mikecovlee <16332179+mikecovlee@users.noreply.github.com>
* mixlora: add entropy-regularized router loss (Tsallis/Rényi) from v2.1.0 without destructive changes\n\n- Config: add router_dyn_loss_coef, entropy_* params\n- Router loss: combine entropy and load-balance losses\n- Common: add tsallis/renyi/shannon entropy utilities and export * Address review feedback: fix device/dtype mismatches, input mutation, and add tests (#9) * refactor: remove unused entropy_eps parameter and related assertions in MixLoraConfig --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* Added support for cache locations, optimized generation logic, and fixed the calculation of cumulative steps in the training configuration. * Fixed the label dimension issue when calculating metrics * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update flash-attn to 2.8.3 * Update bitsandbytes to version 0.49.1 and fix the update logic for kv_seq_len to avoid invalid resizing. * Now flash attention can work with llama * Fix Qwen3 support * Replace entry point to `python -m moe_peft` * Fix tests * Update README --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR modernizes MoE-PEFT by updating core dependencies, improving attention/rope/cache compatibility, expanding model support (incl. Qwen3), and enhancing MixLoRA routing with entropy-regularized loss. It also includes a broader set of alignment/regression tests to validate FlashAttention vs eager behavior across multiple model families.
Key changes
modeling_qwen.pyand registry updates)ATTENTION_FUNCTIONS(eager / flash_attn)trust_remote_code=TrueusagesWhy
Checklist
Notes / Potential breaking changes