Skip to content

Commit be0d213

Browse files
committed
fix(ascend): use image-provided ATB runtime
1 parent 44fd247 commit be0d213

6 files changed

Lines changed: 23 additions & 4 deletions

File tree

.github/configs/ascend.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ container_volumes:
3333
- /public-ks3/cicd/baai_tokenizers:/home/gitlab-runner/tokenizers
3434
- /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro
3535
- /usr/local/Ascend/add-ons:/usr/local/Ascend/add-ons:ro
36-
- /usr/local/Ascend/nnal:/usr/local/Ascend/nnal:ro
3736
- /usr/local/sbin/npu-smi:/usr/local/sbin/npu-smi:ro
3837

3938
# Image build contract consumed by the generic build workflow.

.github/workflows/functional_tests_inference.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ jobs:
230230
;;
231231
pip)
232232
echo "ℹ️ Running tests with pip/system Python"
233+
PLATFORM_ENV_SCRIPT="./tools/install/$PLATFORM/env.sh"
234+
if [ -f "$PLATFORM_ENV_SCRIPT" ]; then
235+
source "$PLATFORM_ENV_SCRIPT"
236+
fi
233237
;;
234238
esac
235239

.github/workflows/functional_tests_serve.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ jobs:
233233
;;
234234
pip)
235235
echo "Running tests with pip/system Python"
236+
PLATFORM_ENV_SCRIPT="./tools/install/$PLATFORM/env.sh"
237+
if [ -f "$PLATFORM_ENV_SCRIPT" ]; then
238+
source "$PLATFORM_ENV_SCRIPT"
239+
fi
236240
;;
237241
esac
238242

tools/install/ascend/activate_runtime.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ export ASCEND_OPP_PATH="$toolkit_home/opp"
3535
# inference image's Python/CANN libraries (or vice versa).
3636
export PATH="$python_home/bin:$toolkit_home/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
3737
nnal_library_paths=""
38-
for library_path in "$ascend_home"/nnal/atb/*/lib "$ascend_home"/nnal/asdsip/*/lib; do
38+
for library_path in \
39+
"$ascend_home"/nnal/atb/*/atb/cxx_abi_*/lib \
40+
"$ascend_home"/nnal/atb/*/lib \
41+
"$ascend_home"/nnal/asdsip/*/lib; do
3942
[ -d "$library_path" ] || continue
4043
nnal_library_paths="$nnal_library_paths:$library_path"
4144
done

tools/install/ascend/env.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,21 @@
6666
# -----------------------------------------------------------------------------
6767
export FLAGSCALE_HOME FLAGSCALE_CONDA FLAGSCALE_DEPS FLAGSCALE_DOWNLOADS
6868
export UV_PROJECT_ENVIRONMENT MPI_HOME ASCEND_HOME ASCEND_TOOLKIT_HOME
69+
export ASCEND_HOME_PATH="$ASCEND_TOOLKIT_HOME"
70+
export ASCEND_OPP_PATH="$ASCEND_TOOLKIT_HOME/opp"
6971
export UV_HTTP_TIMEOUT UV_INDEX_STRATEGY UV_LINK_MODE
7072
export VIRTUAL_ENV="$UV_PROJECT_ENVIRONMENT"
7173

7274
# -----------------------------------------------------------------------------
7375
# PATH Configuration
7476
# -----------------------------------------------------------------------------
7577
export PATH="$UV_PROJECT_ENVIRONMENT/bin:$FLAGSCALE_CONDA/bin:$HOME/.local/bin:$MPI_HOME/bin:$ASCEND_TOOLKIT_HOME/bin:$PATH"
76-
export LD_LIBRARY_PATH="$ASCEND_TOOLKIT_HOME/lib64:$ASCEND_HOME/driver/lib64:$MPI_HOME/lib64:$MPI_HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
78+
nnal_library_paths=""
79+
for library_path in \
80+
"$ASCEND_HOME"/nnal/atb/*/atb/cxx_abi_*/lib \
81+
"$ASCEND_HOME"/nnal/atb/*/lib \
82+
"$ASCEND_HOME"/nnal/asdsip/*/lib; do
83+
[ -d "$library_path" ] || continue
84+
nnal_library_paths="$nnal_library_paths:$library_path"
85+
done
86+
export LD_LIBRARY_PATH="$ASCEND_TOOLKIT_HOME/lib64$nnal_library_paths:$ASCEND_HOME/driver/lib64:$MPI_HOME/lib64:$MPI_HOME/lib:/usr/local/lib:${LD_LIBRARY_PATH:-}"

tools/install/ascend/validate_image_build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ docker_args=(
2222
--device /dev/hisi_hdc
2323
--volume /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro
2424
--volume /usr/local/Ascend/add-ons:/usr/local/Ascend/add-ons:ro
25-
--volume /usr/local/Ascend/nnal:/usr/local/Ascend/nnal:ro
2625
--volume /usr/local/sbin/npu-smi:/usr/local/sbin/npu-smi:ro
2726
--privileged
2827
)

0 commit comments

Comments
 (0)