已合并
fix: 修复告警代码 #4781
why you创建于 9 天前
fix: 修复告警代码 #4781
已合并
why you创建于 9 天前
11 个文件变更+26-16
@@ -1,4 +1,5 @@
1# Copyright (c) 2026 Huawei Technologies Co., Ltd.1# Copyright (c) 2026 Huawei Technologies Co., Ltd.
2+# -*- coding: utf-8 -*-
2# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
3# CANN Open Software License Agreement Version 2.0 (the "License").4# CANN Open Software License Agreement Version 2.0 (the "License").
4# Please refer to the License for details. You may not use this file except in compliance with the License.5# Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -12,9 +12,8 @@
12set -euo pipefail12set -euo pipefail
13 13 
14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15-PROJECT_DIR="${SCRIPT_DIR}"15+BUILD_DIR="${SCRIPT_DIR}/build"
16-BUILD_DIR="${PROJECT_DIR}/build"16+OUTPUT_DIR="${SCRIPT_DIR}/output"
17-OUTPUT_DIR="${PROJECT_DIR}/output"
18 17 
19info() {18info() {
20 echo "[INFO] $*"19 echo "[INFO] $*"
@@ -45,10 +44,10 @@ mkdir -p "${BUILD_DIR}" "${OUTPUT_DIR}"
45# Step 1: 编译 TileLang kernel,产出 .so44# Step 1: 编译 TileLang kernel,产出 .so
46info "Step 1/4: compile TileLang kernel"45info "Step 1/4: compile TileLang kernel"
47(46(
48- cd "${PROJECT_DIR}/add_custom_kernel"47+ cd "${SCRIPT_DIR}/add_custom_kernel"
49 python3 add_custom_kernel.py48 python3 add_custom_kernel.py
50)49)
51-if [[ ! -f "${PROJECT_DIR}/add_custom_kernel/add_kernel.so" ]]; then50+if [[ ! -f "${SCRIPT_DIR}/add_custom_kernel/add_kernel.so" ]]; then
52 error "TileLang kernel .so not found: add_custom_kernel/add_kernel.so"51 error "TileLang kernel .so not found: add_custom_kernel/add_kernel.so"
53 error "Please check TileLang installation and kernel compilation output."52 error "Please check TileLang installation and kernel compilation output."
54 exit 153 exit 1
@@ -57,7 +56,7 @@ info "TileLang kernel .so generated."
57 56 
58# Step 2: 构建 libcust_opapi.so + session_run(含将 add_kernel.so 安装到 OPP 包)57# Step 2: 构建 libcust_opapi.so + session_run(含将 add_kernel.so 安装到 OPP 包)
59info "Step 2/4: build custom op library and session_run"58info "Step 2/4: build custom op library and session_run"
60-cmake -S "${PROJECT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE=Release59+cmake -S "${SCRIPT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE=Release
61cmake --build "${BUILD_DIR}" -j"$(nproc 2>/dev/null || echo 8)"60cmake --build "${BUILD_DIR}" -j"$(nproc 2>/dev/null || echo 8)"
62cmake --install "${BUILD_DIR}"61cmake --install "${BUILD_DIR}"
63 62 
@@ -1,4 +1,5 @@
1# Copyright (c) 2026 Huawei Technologies Co., Ltd.1# Copyright (c) 2026 Huawei Technologies Co., Ltd.
2+# -*- coding: utf-8 -*-
2# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
3# CANN Open Software License Agreement Version 2.0 (the "License").4# CANN Open Software License Agreement Version 2.0 (the "License").
4# Please refer to the License for details. You may not use this file except in compliance with the License.5# Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -12,9 +12,8 @@
12set -euo pipefail12set -euo pipefail
13 13 
14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15-PROJECT_DIR="${SCRIPT_DIR}"15+BUILD_DIR="${SCRIPT_DIR}/build"
16-BUILD_DIR="${PROJECT_DIR}/build"16+OUTPUT_DIR="${SCRIPT_DIR}/output"
17-OUTPUT_DIR="${PROJECT_DIR}/output"
18AIR_PATH="${BUILD_DIR}/tilelang_add_offline.air"17AIR_PATH="${BUILD_DIR}/tilelang_add_offline.air"
19OM_PATH="${BUILD_DIR}/tilelang_add_offline"18OM_PATH="${BUILD_DIR}/tilelang_add_offline"
20 19 
@@ -47,7 +46,7 @@ SOC_VERSION="${SOC_VERSION:-Ascend910_9362}"
47mkdir -p "${BUILD_DIR}" "${OUTPUT_DIR}"46mkdir -p "${BUILD_DIR}" "${OUTPUT_DIR}"
48 47 
49info "Step 1/4: build custom op library, graph_build and model_exec"48info "Step 1/4: build custom op library, graph_build and model_exec"
50-cmake -S "${PROJECT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE=Release49+cmake -S "${SCRIPT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE=Release
51cmake --build "${BUILD_DIR}" -j"$(nproc 2>/dev/null || echo 8)"50cmake --build "${BUILD_DIR}" -j"$(nproc 2>/dev/null || echo 8)"
52cmake --install "${BUILD_DIR}"51cmake --install "${BUILD_DIR}"
53 52 
@@ -82,7 +81,7 @@ atc --framework=1 --model="${AIR_PATH}" --output="${OM_PATH}" --soc_version="${S
82 exit 181 exit 1
83}82}
84 83 
85-OM_FILE="${OM_PATH}.om"84+OM_FILE="${BUILD_DIR}/tilelang_add_offline.om"
86if [[ ! -f "${OM_FILE}" ]]; then85if [[ ! -f "${OM_FILE}" ]]; then
87 error "OM model not generated: ${OM_FILE}"86 error "OM model not generated: ${OM_FILE}"
88 exit 187 exit 1
@@ -1,4 +1,5 @@
1# Copyright (c) 2026 Huawei Technologies Co., Ltd.1# Copyright (c) 2026 Huawei Technologies Co., Ltd.
2+# -*- coding: utf-8 -*-
2# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
3# CANN Open Software License Agreement Version 2.0 (the "License").4# CANN Open Software License Agreement Version 2.0 (the "License").
4# Please refer to the License for details. You may not use this file except in compliance with the License.5# Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -12,9 +12,8 @@
12set -euo pipefail12set -euo pipefail
13 13 
14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15-PROJECT_DIR="${SCRIPT_DIR}"15+BUILD_DIR="${SCRIPT_DIR}/build"
16-BUILD_DIR="${PROJECT_DIR}/build"16+OUTPUT_DIR="${SCRIPT_DIR}/output"
17-OUTPUT_DIR="${PROJECT_DIR}/output"
18 17 
19info() {18info() {
20 echo "[INFO] $*"19 echo "[INFO] $*"
@@ -43,7 +42,7 @@ fi
43mkdir -p "${BUILD_DIR}" "${OUTPUT_DIR}"42mkdir -p "${BUILD_DIR}" "${OUTPUT_DIR}"
44 43 
45info "Step 1/3: build custom op library and session_run"44info "Step 1/3: build custom op library and session_run"
46-cmake -S "${PROJECT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE=Release45+cmake -S "${SCRIPT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE=Release
47cmake --build "${BUILD_DIR}" -j"$(nproc 2>/dev/null || echo 8)"46cmake --build "${BUILD_DIR}" -j"$(nproc 2>/dev/null || echo 8)"
48cmake --install "${BUILD_DIR}"47cmake --install "${BUILD_DIR}"
49 48 
@@ -1,4 +1,6 @@
1#!/bin/bash1#!/bin/bash
2+set -e
3+ 
2# ----------------------------------------------------------------------------4# ----------------------------------------------------------------------------
3# Copyright (c) 2026 Huawei Technologies Co., Ltd.5# Copyright (c) 2026 Huawei Technologies Co., Ltd.
4# This program is free software, you can redistribute it and/or modify it under the terms and conditions of6# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
@@ -1,4 +1,6 @@
1#!/bin/bash1#!/bin/bash
2+set -e
3+ 
2# ----------------------------------------------------------------------------4# ----------------------------------------------------------------------------
3# Copyright (c) 2026 Huawei Technologies Co., Ltd.5# Copyright (c) 2026 Huawei Technologies Co., Ltd.
4# This program is free software, you can redistribute it and/or modify it under the terms and conditions of6# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
@@ -1,4 +1,6 @@
1#!/bin/bash1#!/bin/bash
2+set -e
3+ 
2# ----------------------------------------------------------------------------4# ----------------------------------------------------------------------------
3# Copyright (c) 2026 Huawei Technologies Co., Ltd.5# Copyright (c) 2026 Huawei Technologies Co., Ltd.
4# This program is free software, you can redistribute it and/or modify it under the terms and conditions of6# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
@@ -251,7 +253,7 @@ for round in $(seq 1 $TEST_ROUNDS); do
251 echo "【第${round}轮测试】"253 echo "【第${round}轮测试】"
252 254 
253 bench_output=$(./benchmark_model 1000 50 2>&1)255 bench_output=$(./benchmark_model 1000 50 2>&1)
254- echo "$bench_output" | grep -E "Average time|Total time|Throughput"256+ echo "$bench_output" | grep -E "Average time|Total time|Throughput" || true
255 257 
256 avg_ms=$(echo "$bench_output" | grep "Average time per iteration" | awk -F'[ :]' '{for(i=1;i<=NF;i++) if($i ~ /^[0-9]/) print $i; exit}')258 avg_ms=$(echo "$bench_output" | grep "Average time per iteration" | awk -F'[ :]' '{for(i=1;i<=NF;i++) if($i ~ /^[0-9]/) print $i; exit}')
257 259 
@@ -1,4 +1,6 @@
1#!/bin/bash1#!/bin/bash
2+set -e
3+ 
2# ----------------------------------------------------------------------------4# ----------------------------------------------------------------------------
3# Copyright (c) 2026 Huawei Technologies Co., Ltd.5# Copyright (c) 2026 Huawei Technologies Co., Ltd.
4# This program is free software, you can redistribute it and/or modify it under the terms and conditions of6# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
@@ -1,4 +1,6 @@
1#!/bin/bash1#!/bin/bash
2+set -e
3+ 
2# ----------------------------------------------------------------------------4# ----------------------------------------------------------------------------
3# Copyright (c) 2026 Huawei Technologies Co., Ltd.5# Copyright (c) 2026 Huawei Technologies Co., Ltd.
4# This program is free software, you can redistribute it and/or modify it under the terms and conditions of6# This program is free software, you can redistribute it and/or modify it under the terms and conditions of