Skip to content

Commit 68fb634

Browse files
authored
[CI] Patch torch.library.infer_schema for fused moe ops to fix CI (#854)
make sure pytorch infer_schema check is patched before some case which using fused moe ops: 1. model register 2. quantization loading 3. fused moe ut Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent 5082424 commit 68fb634

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

tests/ops/test_fused_moe.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
2020
Run `pytest tests/ops/test_fused_moe.py`.
2121
"""
22+
# fused moe ops test will hit the infer_schema error, we need add the patch
23+
# here to make the test pass.
24+
import vllm_ascend.patch.worker.patch_common.patch_utils # type: ignore[import] # isort: skip # noqa
2225

2326
import pytest
2427
import torch

vllm_ascend/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ def register():
2323

2424

2525
def register_model():
26+
# fix pytorch schema check error, remove this line after pytorch
27+
# is upgraded to 2.7.0
28+
import vllm_ascend.patch.worker.patch_common.patch_utils # noqa: F401
29+
2630
from .models import register_model
2731
register_model()

vllm_ascend/quantization/quant_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
# limitations under the License.
1616
# This file is a part of the vllm-ascend project.
1717
#
18+
# By using quantization case, this file is called before worker patch achieve,
19+
# we need to import patch_utils here first to make sure the patch is applied.
20+
import vllm_ascend.patch.worker.patch_common.patch_utils # type: ignore[import] # isort: skip # noqa
21+
1822
from types import MappingProxyType
1923
from typing import Any, Callable, Dict, List, Mapping, Optional
2024

0 commit comments

Comments
 (0)