[CI] Add Triton Ascend in CI (#4921)

Add triton-ascend in UT and e2e

- vLLM version: v0.12.0
- vLLM main:
ad32e3e19c
---------
Signed-off-by: Meihan-chen <jcccx.cmh@gmail.com>
This commit is contained in:
meihanc
2025-12-23 12:47:35 +08:00
committed by GitHub
parent 2e010e12dd
commit 592cfb6a6f
8 changed files with 85 additions and 36 deletions

View File

@@ -15,10 +15,23 @@
# limitations under the License.
# This file is a part of the vllm-ascend project.
#
import sys
from unittest.mock import MagicMock
from vllm_ascend.utils import adapt_patch # noqa E402
from vllm_ascend.utils import register_ascend_customop
# triton and torch_npu is not available in the environment, so we need to mock them
sys.modules['torch_npu'].npu.current_device = MagicMock(return_value=0)
sys.modules['torch_npu._inductor'] = MagicMock()
triton_runtime = MagicMock()
triton_runtime.driver.active.utils.get_device_properties.return_value = {
'num_aic': 8,
'num_vectorcore': 8,
}
sys.modules['triton.runtime'] = triton_runtime
adapt_patch()
adapt_patch(True)