Skip to content

[NPU][1/N] NPU basic functions refactor and new modelslim quant type#13359

Merged
iforgetmyname merged 40 commits intosgl-project:mainfrom
iforgetmyname:npu_refactor
Dec 4, 2025
Merged

[NPU][1/N] NPU basic functions refactor and new modelslim quant type#13359
iforgetmyname merged 40 commits intosgl-project:mainfrom
iforgetmyname:npu_refactor

Conversation

@iforgetmyname
Copy link
Collaborator

@iforgetmyname iforgetmyname commented Nov 16, 2025

Motivation

Due to the underlying structural difference between gpgpus and npus, we have introduced a lot of is_npu branches in current repository from previous commits. Though literarlly it helps the out-of-box experience for our end-users and matches our rapid development pace, this way of orignizing codes breaks readability and of cource maintainability of the whole sglang project. We believe this is not a long-term solution and a healthy and robust way of continously maintaining multi-hardware support, such that starting with this pr, we are trying to refactoring npu-related codes into a specific folder that hides hardware differences and only exposes simplified interfaces that can be called by different models.

Modifications

Accuracy Tests

CI should cover all.

Benchmarking and Profiling

Checklist

logger.warning("Failed to import from custom_ar with %r", e)


if not is_hip() and not is_npu():
if not CUSTOM_ALLREDUCE_AVAILABLE:
Copy link
Member

Choose a reason for hiding this comment

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

help us clean the code

if is_cuda:
  ...
elif is_hip:
  ...
elif is_npu:
   ...
else:

@iforgetmyname iforgetmyname mentioned this pull request Nov 25, 2025
4 tasks
@iforgetmyname iforgetmyname marked this pull request as ready for review December 2, 2025 01:13
@iforgetmyname
Copy link
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions bot added the run-ci label Dec 2, 2025
@iforgetmyname iforgetmyname changed the title [WIP] Ascend NPU refactor [1/N] NPU basic functions refactor and new modelslim quant type Dec 2, 2025
@iforgetmyname iforgetmyname changed the title [1/N] NPU basic functions refactor and new modelslim quant type [NPU][1/N] NPU basic functions refactor and new modelslim quant type Dec 2, 2025
@ping1jing2 ping1jing2 self-assigned this Dec 2, 2025
@iforgetmyname
Copy link
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions bot added the run-ci label Dec 3, 2025
@iforgetmyname iforgetmyname merged commit 894c0dc into sgl-project:main Dec 4, 2025
168 of 174 checks passed
@iforgetmyname iforgetmyname deleted the npu_refactor branch December 4, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments