[NPU][1/N] NPU basic functions refactor and new modelslim quant type (#13359)
This commit is contained in:
@@ -31,9 +31,7 @@ from sglang.srt.environ import envs
|
||||
from sglang.srt.metrics.collector import ExpertDispatchCollector
|
||||
from sglang.srt.model_executor.forward_batch_info import ForwardBatch
|
||||
from sglang.srt.server_args import ServerArgs
|
||||
from sglang.srt.utils import Withable, get_int_env_var, is_npu
|
||||
|
||||
_is_npu = is_npu()
|
||||
from sglang.srt.utils import Withable, get_int_env_var
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from sglang.srt.eplb.expert_location import ExpertLocationMetadata
|
||||
@@ -465,10 +463,6 @@ def _list_sum(a: List, b: List) -> List:
|
||||
class _LayerBasedGpuSinglePassGatherer(_SinglePassGatherer):
|
||||
def __init__(self, *args, enable_global_physical_experts: bool, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
if not _is_npu:
|
||||
device = "cuda"
|
||||
else:
|
||||
device = "npu"
|
||||
self._enable_global_physical_experts = enable_global_physical_experts
|
||||
self._data = torch.zeros(
|
||||
(
|
||||
@@ -480,7 +474,7 @@ class _LayerBasedGpuSinglePassGatherer(_SinglePassGatherer):
|
||||
),
|
||||
),
|
||||
dtype=torch.int,
|
||||
device=device,
|
||||
device="cuda",
|
||||
)
|
||||
|
||||
def reset(self):
|
||||
|
||||
Reference in New Issue
Block a user