2025-04-16 09:28:58 +08:00
|
|
|
#
|
|
|
|
|
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
|
|
|
|
|
# This file is a part of the vllm-ascend project.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2025-10-21 20:19:46 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_distributed # noqa
|
2026-03-06 09:08:52 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_fusion_matcher_compat_ops # noqa
|
2026-03-16 15:39:42 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_kv_cache_interface # noqa
|
2026-03-25 08:57:06 +08:00
|
|
|
from vllm_ascend import envs
|
2026-03-21 16:05:38 +08:00
|
|
|
from vllm_ascend.utils import is_310p
|
2026-03-19 09:16:22 +08:00
|
|
|
|
|
|
|
|
if not is_310p():
|
|
|
|
|
import vllm_ascend.patch.platform.patch_mamba_config # noqa
|
|
|
|
|
else:
|
|
|
|
|
import vllm_ascend.patch.platform.patch_mamba_config_310 # noqa
|
2026-03-11 00:12:02 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_minimax_m2_config # noqa
|
[bugfix]fix extra npu context in device 0 (#8041)
<!-- Thanks for sending a pull request!
BEFORE SUBMITTING, PLEASE READ
https://docs.vllm.ai/en/latest/contributing/overview.html
-->
### What this PR does / why we need it?
When we launch a PD-disaggregated process and send requests, an
additional processes appear on NPU 0, becasue when a thread has a
primary cuda context, the child thread it creates automatically doesn't
inherit the cuda context. See
https://forums.developer.nvidia.com/t/when-a-thread-has-a-primary-cuda-context-does-the-child-thread-it-creates-automatically-inherit-the-cuda-context/362810.
vLLM has fixed this issue in [pr-37449
](https://github.com/vllm-project/vllm/pull/37449), but version 0.18.0
does not include the fix. Therefore, we need to patch it.
<!--
- Please clarify what changes you are proposing. The purpose of this
section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster
reviews in your PR.
- Please clarify why the changes are needed. For instance, the use case
and bug description.
- Fixes #
-->
### Does this PR introduce _any_ user-facing change?
no
<!--
Note that it means *any* user-facing change including all aspects such
as API, interface or other behavior changes.
Documentation-only updates are not considered user-facing changes.
-->
### How was this patch tested?
<!--
CI passed with new added/existing test.
If it was tested in a way different from regular unit tests, please
clarify how you tested step by step, ideally copy and paste-able, so
that other reviewers can test and check, and descendants can verify in
the future.
If tests were not added, please describe why they were not added and/or
why it was difficult to add.
-->
---------
Signed-off-by: zouyida <zouyida@huawei.com>
Co-authored-by: zouyida <zouyida@huawei.com>
2026-04-08 23:35:52 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_multiproc_executor # noqa
|
2025-10-24 00:06:45 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_sched_yield # noqa
|
2026-03-18 09:24:43 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_torch_accelerator # noqa
|
2026-03-27 10:45:28 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_minimax_usage_accounting # noqa
|
2026-03-28 09:15:04 +08:00
|
|
|
import vllm_ascend.patch.platform.patch_glm_tool_call_parser # noqa
|
2025-10-21 20:19:46 +08:00
|
|
|
|
2026-03-25 08:57:06 +08:00
|
|
|
if envs.VLLM_ASCEND_BALANCE_SCHEDULING:
|
|
|
|
|
import vllm_ascend.patch.platform.patch_balance_schedule # noqa
|