Merged
fix: 修复TileLang-Ascend构建命令中不支持的-v参数及默认安装下CATLASS单元测试失败的问题 #166
fix: 修复TileLang-Ascend构建命令中不支持的-v参数及默认安装下CATLASS单元测试失败的问题 #166
Merged
xmzAdd on Sep 14
Total: 4 files changed+11-3
@@ -138,7 +138,7 @@ cd tilelang-ascend
138source /usr/local/Ascend/ascend-toolkit/latest/set_env.sh138source /usr/local/Ascend/ascend-toolkit/latest/set_env.sh
139export ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest139export ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest
140 140 
141-./build_wheel_ascend.sh --enable-llvm -v141+./build_wheel_ascend.sh --enable-llvm
142pip install -U dist/tilelang-*.whl142pip install -U dist/tilelang-*.whl
143```143```
144 144 
@@ -181,7 +181,7 @@ cd tilelang-ascend
181source /usr/local/Ascend/ascend-toolkit/latest/set_env.sh181source /usr/local/Ascend/ascend-toolkit/latest/set_env.sh
182export ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest182export ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest
183 183 
184-./build_wheel_ascend.sh --enable-llvm -v184+./build_wheel_ascend.sh --enable-llvm
185pip install -U dist/tilelang-*.whl185pip install -U dist/tilelang-*.whl
186```186```
187 187 
@@ -154,6 +154,8 @@ pytest tests/unit_tests
154>154>
155> - 运行单个算子的测试可使用`pytest tests/unit_tests/triton/test_fused_cross_entropy_loss.py`。155> - 运行单个算子的测试可使用`pytest tests/unit_tests/triton/test_fused_cross_entropy_loss.py`。
156> - 单元测试以CPU高精度实现与PyTorch小算子实现为双标杆进行精度校验。156> - 单元测试以CPU高精度实现与PyTorch小算子实现为双标杆进行精度校验。
157+> - CATLASS算子的单元测试依赖可选的CATLASS组件:安装时需设置环境变量`MINDSPEED_BUILD_CATLASS=1`(详见[README](../../README.md)中"可选:编译并运行 CATLASS 算子"章节);未启用编译时,相关用例将自动跳过。
158+> - TileLang算子的单元测试依赖可选的TileLang-Ascend组件(详见[软件安装](install_guide.md#可选安装tilelang-ascend以使用tilelang算子));未安装时,相关用例将自动跳过。
157 159 
158## 更多算子160## 更多算子
159 161 
@@ -9,7 +9,13 @@ import torch.nn.functional as F
9from mindspeed_ops.api.catlass import chunk_loss_forward9from mindspeed_ops.api.catlass import chunk_loss_forward
10 10 
11 11 
12-pytestmark = pytest.mark.skipif(not hasattr(torch, "npu"), reason="torch_npu is required")12+pytestmark = [
13+ pytest.mark.skipif(not hasattr(torch, "npu"), reason="torch_npu is required"),
14+ pytest.mark.skipif(
15+ not hasattr(torch.ops.mindspeed_ops, "catlass_chunk_loss"),
16+ reason="CATLASS ops not built; install with MINDSPEED_BUILD_CATLASS=1 (see README)",
17+ ),
18+]
13 19 
14 20 
15def _device():21def _device():