Skip to content

Conversation

@lbk-sys
Copy link
Contributor

@lbk-sys lbk-sys commented Sep 17, 2025

What does this PR do?

support npu for verl + sglang

bash examples/grpo_trainer/run_qwen3_8b_grpo_sglang_1k_npu.sh

Accuracy test

8b:
8b

30b:
30b

Test

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@CLAassistant
Copy link

CLAassistant commented Sep 17, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
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 introduces changes to support sglang on NPU devices. Key changes include refactoring NPU-specific utilities into a dedicated module, updating sglang import paths, and adding new example scripts for NPU execution. While the refactoring improves code organization, there are critical errors in the new example scripts that will likely cause them to fail.

@FightingZhen FightingZhen changed the title prepare for sglang+verl [Do Not Merge] prepare for sglang+verl Sep 17, 2025
@lbk-sys lbk-sys marked this pull request as ready for review September 17, 2025 08:25
@lbk-sys lbk-sys marked this pull request as draft September 17, 2025 08:25
@lbk-sys lbk-sys force-pushed the verl_sglang_0915 branch 2 times, most recently from a22d3f8 to 73a7154 Compare September 24, 2025 02:47
@lbk-sys lbk-sys changed the title [Do Not Merge] prepare for sglang+verl prepare for sglang+verl Sep 24, 2025
@lbk-sys lbk-sys changed the title prepare for sglang+verl 【NPU】prepare for sglang+verl Sep 24, 2025
Co-authored-by: 1StepForever <[email protected]>
Signed-off-by: lbk-sys <[email protected]>
@lbk-sys lbk-sys changed the title 【NPU】prepare for sglang+verl prepare for sglang+verl Sep 25, 2025
@lbk-sys lbk-sys changed the title prepare for sglang+verl [sglang] feat: add preparation for sglang+verl Sep 26, 2025
Signed-off-by: lbk-sys <[email protected]>
@lbk-sys lbk-sys marked this pull request as ready for review September 26, 2025 03:35
@lbk-sys lbk-sys requested a review from tongyx361 as a code owner September 26, 2025 03:35
Signed-off-by: lbk-sys <[email protected]>
Signed-off-by: lbk-sys <[email protected]>


# Copied from https://github.com/Dao-AILab/flash-attention/blob/main/flash_attn/bert_padding.py
def unpad_input(hidden_states, attention_mask, unused_mask=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

These functions already added in #3608

Signed-off-by: lbk-sys <[email protected]>
@wuxibin89 wuxibin89 merged commit f50e5c2 into volcengine:main Sep 29, 2025
62 of 64 checks passed
@lbk-sys lbk-sys changed the title [sglang] feat: add preparation for sglang+verl [sglang] feat: adapt for sglang+verl Sep 29, 2025
masoudhashemi pushed a commit to masoudhashemi/verl that referenced this pull request Oct 19, 2025
### What does this PR do?
support npu for verl + sglang

```python
bash examples/grpo_trainer/run_qwen3_8b_grpo_sglang_1k_npu.sh
```


### Accuracy test
8b:
<img width="747" height="842" alt="8b"
src="https://github.com/user-attachments/assets/f36ef25a-b32f-4c76-97d0-2e5fe53ff183"
/>

30b:
<img width="759" height="850" alt="30b"
src="https://github.com/user-attachments/assets/97979002-7ebf-47fa-ae57-3e9b6637f12c"
/>

### Test


### Design & Code Changes

> Demonstrate the high-level design if this PR is complex, and list the
specific changes.

### Checklist Before Submitting

> [!IMPORTANT]
> Please check all the following items before requesting a review,
otherwise the reviewer might deprioritize this PR for review.

- [ ] Read the [Contribute
Guide](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)

---------

Signed-off-by: lbk-sys <[email protected]>
Co-authored-by: 1StepForever <[email protected]>
techkang pushed a commit to techkang/verl that referenced this pull request Oct 31, 2025
### What does this PR do?
support npu for verl + sglang

```python
bash examples/grpo_trainer/run_qwen3_8b_grpo_sglang_1k_npu.sh
```


### Accuracy test
8b:
<img width="747" height="842" alt="8b"
src="https://github.com/user-attachments/assets/f36ef25a-b32f-4c76-97d0-2e5fe53ff183"
/>

30b:
<img width="759" height="850" alt="30b"
src="https://github.com/user-attachments/assets/97979002-7ebf-47fa-ae57-3e9b6637f12c"
/>

### Test


### Design & Code Changes

> Demonstrate the high-level design if this PR is complex, and list the
specific changes.

### Checklist Before Submitting

> [!IMPORTANT]
> Please check all the following items before requesting a review,
otherwise the reviewer might deprioritize this PR for review.

- [ ] Read the [Contribute
Guide](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)

---------

Signed-off-by: lbk-sys <[email protected]>
Co-authored-by: 1StepForever <[email protected]>
mtian8 pushed a commit to mtian8/verl that referenced this pull request Nov 1, 2025
### What does this PR do?
support npu for verl + sglang

```python
bash examples/grpo_trainer/run_qwen3_8b_grpo_sglang_1k_npu.sh
```


### Accuracy test
8b:
<img width="747" height="842" alt="8b"
src="https://github.com/user-attachments/assets/f36ef25a-b32f-4c76-97d0-2e5fe53ff183"
/>

30b:
<img width="759" height="850" alt="30b"
src="https://github.com/user-attachments/assets/97979002-7ebf-47fa-ae57-3e9b6637f12c"
/>

### Test


### Design & Code Changes

> Demonstrate the high-level design if this PR is complex, and list the
specific changes.

### Checklist Before Submitting

> [!IMPORTANT]
> Please check all the following items before requesting a review,
otherwise the reviewer might deprioritize this PR for review.

- [ ] Read the [Contribute
Guide](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)

---------

Signed-off-by: lbk-sys <[email protected]>
Co-authored-by: 1StepForever <[email protected]>
wangboxiong320 pushed a commit to wangboxiong320/verl that referenced this pull request Nov 1, 2025
### What does this PR do?
support npu for verl + sglang

```python
bash examples/grpo_trainer/run_qwen3_8b_grpo_sglang_1k_npu.sh
```


### Accuracy test
8b:
<img width="747" height="842" alt="8b"
src="https://github.com/user-attachments/assets/f36ef25a-b32f-4c76-97d0-2e5fe53ff183"
/>

30b:
<img width="759" height="850" alt="30b"
src="https://github.com/user-attachments/assets/97979002-7ebf-47fa-ae57-3e9b6637f12c"
/>

### Test


### Design & Code Changes

> Demonstrate the high-level design if this PR is complex, and list the
specific changes.

### Checklist Before Submitting

> [!IMPORTANT]
> Please check all the following items before requesting a review,
otherwise the reviewer might deprioritize this PR for review.

- [ ] Read the [Contribute
Guide](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)

---------

Signed-off-by: lbk-sys <[email protected]>
Co-authored-by: 1StepForever <[email protected]>
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.

4 participants