Repository navigation
Fix TENPU row-parallel LoRA input sizing - #255
Merged
hjh0119 merged 1 commit intoNov 6, 2026
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the TENPU row-parallel LoRA input-sizing fix.
No open issues 🎉
What changed in this PR
Fixes TENPU row-parallel LoRA A construction by passing the global input width, preventing it from being sharded twice while preserving native-row and CUDA sizing behavior.
Changes:
- Removes the NPU-specific input-size override and clarifies the constructor’s sizing expectations.
- Adds CUDA/NPU regression tests for TP=1 and TP=2, comparing outputs and input/LoRA gradients against an unsharded reference.
| File | Description |
|---|---|
tests/test_lora_row_parallel.py |
Adds sharded LoRA shape, forward-output, and gradient checks. |
src/mcore_bridge/tuners/lora.py |
Corrects TENPU LoRA A input sizing while retaining native-row handling. |
Review effort: Balanced
hjh0119
approved these changes
Nov 6, 2026
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
Fix TP-sharded LoRA A construction for TENPU row-parallel linears. PEFT reads a local
in_featuresfrom TENPU, so pass the reconstructed global width to the constructor and let TENPU shard it once. Retain the nativeRowParallelLinearbranch, where PEFT reads the globalinput_size.Add a TP=1/2 regression test for CUDA and NPU that compares forward output, input gradients, and LoRA A/B gradients against an unsharded matrix reference.
Evidence
[8, 512]for a local input width of 1024, failing withGEMM not possible.rtol=0, atol=0for forward output and input/LoRA A/B gradients:2 passed, 2 deselected(pytest tests/test_lora_row_parallel.py -k npu -q -s).