From dffdfe1d96e7b29f9b33d55cd2527933d1a01210 Mon Sep 17 00:00:00 2001 From: fandaoyi Date: Tue, 30 Jul 2024 16:30:56 +0800 Subject: [PATCH] build sample (#923) * add dyn build temp * add mx ref * update diopi --- dipu/scripts/ci/muxi/ci_muxi_script.sh | 16 +++++++++++----- dipu/scripts/ci/nv/ci_nv_script.sh | 13 +++++++++++++ dipu/third_party/DIOPI | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/dipu/scripts/ci/muxi/ci_muxi_script.sh b/dipu/scripts/ci/muxi/ci_muxi_script.sh index 224917046..89b44e7ae 100644 --- a/dipu/scripts/ci/muxi/ci_muxi_script.sh +++ b/dipu/scripts/ci/muxi/ci_muxi_script.sh @@ -18,20 +18,26 @@ function build_dipu() { cmake_maca --build "$path" --parallel 20 2>&1 | tee "${path}/build.log" } -function build_diopi_lib() { +# for reference only +function build_diopi_lib_dyn() { + # export PYTHONPATH="${YOU_TORCH_FOR_DIOPI}:${PYTHONPATH}" cd third_party/DIOPI/impl sh scripts/build_impl.sh clean - sh scripts/build_impl.sh muxi || exit -1 + sh scripts/build_impl.sh muxi_dyload || exit -1 cd - } - case $1 in "build_dipu") - build_dipu # "-DWITH_DIOPI_LIBRARY=${DIOPI_ROOT}" + build_dipu + ;; + "build_diopi_dyn") + build_diopi_lib_dyn ;; "build_dipu_only") - builddipu "-DWITH_DIOPI_LIBRARY=DISABLE" ;; + # build_dipu "-DWITH_DIOPI_LIBRARY=DISABLE" + build_dipu "-DWITH_DIOPI_LIBRARY=${DIOPI_DYN_ROOT}" + ;; *) echo "[ERROR] Incorrect option: $1" && exit 1 ;; esac diff --git a/dipu/scripts/ci/nv/ci_nv_script.sh b/dipu/scripts/ci/nv/ci_nv_script.sh index e38369b64..dfd0515a3 100644 --- a/dipu/scripts/ci/nv/ci_nv_script.sh +++ b/dipu/scripts/ci/nv/ci_nv_script.sh @@ -23,6 +23,15 @@ function build() { cmake --build "$OUTPUT" --parallel 8 2>&1 | tee "${OUTPUT}/build.log" } +# for reference only +function build_diopi_lib_dyn() { + # export PYTHONPATH="${YOU_TORCH_FOR_DIOPI}:${PYTHONPATH}" + cd third_party/DIOPI/impl + sh scripts/build_impl.sh clean + sh scripts/build_impl.sh torch_dyload || exit -1 + cd - +} + case $1 in "build_dipu") clean @@ -31,9 +40,13 @@ case $1 in "build_dipu_dev") build "${@:2}" ;; +"build_diopi_dyn") + build_diopi_lib_dyn + ;; "build_dipu_only") clean build "-DWITH_DIOPI_LIBRARY=DISABLE" + # build "-DWITH_DIOPI_LIBRARY=${DIOPI_DYN_ROOT}" ;; *) echo "[ERROR] Incorrect option: $1" && exit 1 diff --git a/dipu/third_party/DIOPI b/dipu/third_party/DIOPI index abb56e204..aefa5b77e 160000 --- a/dipu/third_party/DIOPI +++ b/dipu/third_party/DIOPI @@ -1 +1 @@ -Subproject commit abb56e204aa379bddd7190846215e3fda0171c15 +Subproject commit aefa5b77e54463ddb10d7781aaf9c340d52921c0