Skip to content

[Bugfix] Fix fully sharded LoRA bug - #10352

Merged
DarkLight1337 merged 2 commits into
vllm-project:mainfrom
jeejeelee:full-shard-lora-bug
Nov 15, 2024
Merged

DarkLight1337 merged 2 commits into
vllm-project:mainfrom
jeejeelee:full-shard-lora-bug

Conversation

@jeejeelee

@jeejeelee jeejeelee commented Nov 15, 2024 •

Copy link
Copy Markdown
Member

FIX #10342 (link existing issues this PR will resolve)

The issue arose because the code did not properly handle cases where all three lora_a
in MergedQKVParallelLinearWithShardedLora could be None. I also handled this issue in MergedColumnParallelLinearWithShardedLoRA.

BTW, fix small typo in worker.py

ping @DarkLight1337 also cc @xyang16 Thanks for catch this bug

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@DarkLight1337

Copy link
Copy Markdown
Member

Can we add a test to avoid similar regressions?

@jeejeelee

Copy link
Copy Markdown
Member Author

Can we add a test to avoid similar regressions?

I've been thinking about this.
current LoRA CI tests only run on a single GPU, which means many TP related logic cannot be verified in CI. Issues like this one cannot be catched when testing on a single GPU.

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@DarkLight1337

Copy link
Copy Markdown
Member

We can add some LoRA tests to distributed tests.

@jeejeelee

Copy link
Copy Markdown
Member Author

We can add some LoRA tests to distributed tests.

I'll do that, but it will probably take some time. Regarding this bug, my local testing shows no issues, including cases where qkv_proj, gate_proj, and up_proj are None.

@DarkLight1337 DarkLight1337 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright, let's try to get this into the upcoming release first.

@DarkLight1337
DarkLight1337 enabled auto-merge (squash) November 15, 2024 08:05
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 15, 2024
@DarkLight1337
DarkLight1337 merged commit 1d65ec7 into vllm-project:main Nov 15, 2024
siddvenk pushed a commit to siddvenk/vllm that referenced this pull request Nov 18, 2024
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@jeejeelee
jeejeelee deleted the full-shard-lora-bug branch November 19, 2024 14:16
sleepwalker2017 pushed a commit to sleepwalker2017/vllm that referenced this pull request Dec 13, 2024
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
philippesic pushed a commit to philippesic/vllm-semantic-cache that referenced this pull request Jul 19, 2026
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
plasticchris pushed a commit to plasticchris/vllm that referenced this pull request Jul 20, 2026
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
wenhow pushed a commit to wenhow/vllm that referenced this pull request Aug 5, 2026
…oject#10352)

### What this PR does / why we need it?

This PR fixes `tests/ut/attention/a2/test_sfa_v1.py` by explicitly
mocking
`get_ascend_config()` in `TestAscendSFAMetadataBuilder`.
-
https://github.com/vllm-project/vllm-ascend/actions/runs/27336219650/job/80761760016#step:13:229

Fix bug in vllm-ascend PR vllm-project#10292:

That PR added a new `AscendConfig` field:

```python
self.c8_enable_reshape_optim = ...
```

and introduced this access in `vllm_ascend/attention/sfa_v1.py`:

```python
if get_ascend_config().c8_enable_reshape_optim:
```

However, `tests/ut/attention/a2/test_sfa_v1.py` directly constructs
`AscendSFAMetadataBuilder` and calls `build()` /
`build_for_graph_capture()`
without initializing or mocking `AscendConfig`. As a result, the tests
can fail
with:

```text
RuntimeError: Ascend config is not initialized. Please call init_ascend_config first.
```

This is a UT isolation issue. The SFA metadata builder tests should not
depend
on process-global Ascend platform initialization side effects.

This PR fixes the tests by mocking:

```python
vllm_ascend.attention.sfa_v1.get_ascend_config
```

and setting the fields required by the SFA path, including:

```python
c8_enable_reshape_optim = False
```

This keeps the test focused on SFA metadata builder behavior and avoids
relying
on global `AscendConfig` state.

- vLLM version: v0.21.0
- vLLM main:
vllm-project@9090368
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Not able to run LLama3 LoRA with --fully-sharded-loras

2 participants