Files
xc-llm-ascend/tests/e2e/nightly/single_node/ops/conftest.py

51 lines
1.3 KiB
Python
Raw Permalink Normal View History

[CI] Repair custom op nightly (#8707) <!-- 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? <!-- - 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 # --> #### Fixed: 1. The function name in test_moe_init_routing_custom.py is incorrect; it is not named as a test case function starting with 'test'. 2.In Night ops singlecard_ops add the printing of timestamps for use cases, making it easier to quickly locate issues after a timeout occurs. #### To be repaired: 1. The test_penality.py test case partially fails. It takes one hour. The owner has been notified to fix the case after the 5.1 holiday. ——Yang Cheng 3. The csrc/copy_and_expand_eagle_inputs operator invoked by test_copy_and_expand_eagle_inputs.py supports only 910b.——HF001 4. The test_causal_conv1d.py test case is incorrect. The triton operator `causal_conv1d_fn` invoked by the test_causal_conv1d.py test case uses `get_forward_context`, but the operator case does not use `set_forward_context` (which is normal in the model). ——Zeng Tian 5. The test_causal_conv1d.py case is incorrect. In this scenario, uboverflow occurs when the triton invoked ——Zeng Tian ### Does this PR introduce _any_ user-facing change? <!-- 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. --> no ### 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. --> nightly Signed-off-by: ZT-AIA <1028681969@qq.com>
2026-04-25 19:05:33 +08:00
import time
from datetime import datetime
import pytest
DURATION_THRESHOLD = 120
SLOW_COUNT_LIMIT = 5
_per_file_slow_cases = {}
_current_file = None
def pytest_runtest_setup(item):
item.start_time = time.time()
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
global _current_file
if report.when != 'call':
return
if not hasattr(item, 'start_time'):
return
time_stamp = datetime.now().strftime("[%H:%M:%S]")
print(f"{time_stamp}")
file_path = item.fspath
duration = time.time() - item.start_time
if file_path not in _per_file_slow_cases:
_per_file_slow_cases[file_path] = 0
if duration > DURATION_THRESHOLD:
_per_file_slow_cases[file_path] += 1
cnt = _per_file_slow_cases[file_path]
print(f" Detected slow case ({cnt}/{SLOW_COUNT_LIMIT}): {duration:.2f}s | {item.nodeid}")
if cnt >= SLOW_COUNT_LIMIT:
print(f"\n Timeout cases in {file_path}{SLOW_COUNT_LIMIT}\n")
_current_file = file_path
def pytest_runtest_call(item):
if _current_file == item.fspath:
print(f"CASE SKIP: {item.nodeid}")
pytest.skip("The use case takes too long.")