Skip to content

Commit 589fc04

Browse files
author
zhangyue
committed
refactor(test): remove duplicate rms_norm test files and unify kernel loading
- Delete `test_rms_norm_precision.py` (duplicate of `tests/test_rms_norm.py`) - Delete `run_rms_norm_precision_report.py` (another copy with hardcoded path) - Unify `test_add_rms_norm.py` to use `import ascend_kernel` instead of ctypes manual loading
1 parent ae05b0b commit 589fc04

File tree

3 files changed

+2
-368
lines changed

3 files changed

+2
-368
lines changed

src/ascend/custom_kernel/csrc/ops/rms_norm/test/run_rms_norm_precision_report.py

Lines changed: 0 additions & 205 deletions
This file was deleted.

src/ascend/custom_kernel/csrc/ops/rms_norm/test/test_rms_norm_precision.py

Lines changed: 0 additions & 147 deletions
This file was deleted.

src/ascend/custom_kernel/tests/test_add_rms_norm.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
"""Correctness tests for custom AscendC add_rms_norm kernel."""
22

3+
import pytest
34
import torch
45
import torch_npu # noqa: F401 Registers NPU device.
5-
import pytest
6-
7-
8-
def _load_custom_kernel():
9-
"""Load the custom kernel shared library."""
10-
import ctypes
11-
import glob
12-
import os
13-
14-
lib_dir = os.path.join(os.path.dirname(__file__), "..", "output")
15-
libs = glob.glob(os.path.join(lib_dir, "libascend_kernel.so"))
16-
assert libs, f"No libascend_kernel.so found in {lib_dir}"
17-
ctypes.CDLL(libs[0])
18-
19-
20-
_load_custom_kernel()
6+
import ascend_kernel # noqa: F401 Loads `libascend_kernel.so` into `torch.ops.npu`.
217

228

239
def _ref_add_rms_norm(x1, x2, weight, eps):

0 commit comments

Comments
 (0)