Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NeosZhang committed Mar 28, 2024
1 parent 45aeb86 commit 305d0db
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 38 deletions.
7 changes: 2 additions & 5 deletions dipu/scripts/autogen_diopi_wrapper/auto_gen_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ GENERATED_KERNELS_VENDOR=${DIPU_DIR}/third_party/DIOPI/impl/${UsedVendor}/conver

PYTHON_CMD="python3 ${GENERATED_KERNELS_SCRIPT} --out=${GENERATED_KERNELS} --config=${GENERATED_KERNELS_CONFIG} \
--autocompare=${USE_AUTOCOMPARE} --print_op_arg=True --use_diopi_adapter=False --print_func_call_info=True \
--fun_config_dict='{\"current_device\":\"${UsedVendor}\",\"current_torch_ver\":\"${Torch_VERSION}\"}'"

if [ -f "$GENERATED_KERNELS_VENDOR" ]; then
PYTHON_CMD="$PYTHON_CMD --convert_config=${GENERATED_KERNELS_VENDOR}"
fi
--fun_config_dict='{\"current_device\":\"${UsedVendor}\",\"current_torch_ver\":\"${Torch_VERSION}\"}' \
--convert_config=${GENERATED_KERNELS_VENDOR}"

eval "$PYTHON_CMD"
56 changes: 23 additions & 33 deletions dipu/scripts/ci/ascend/ci_ascend_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,51 @@ function build_diopi_lib() {

function config_dipu_ascend_cmake() {
mkdir -p build && cd ./build && rm -rf ./*
cmake_args="-DCMAKE_BUILD_TYPE=Release -DDEVICE=ascend -DWITH_DIOPI_LIBRARY=DISABLE"
if [ -n "$USE_AUTOCOMPARE" ]; then
cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DDEVICE=ascend \
-DUSE_AUTOCOMPARE=${USE_AUTOCOMPARE} \
-DWITH_DIOPI_LIBRARY=DISABLE
else
cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DDEVICE=ascend \
-DWITH_DIOPI_LIBRARY=DISABLE
cmake_args+=" -DUSE_AUTOCOMPARE=${USE_AUTOCOMPARE}"
fi
cd ../
}

function config_all_ascend_cmake() {
mkdir -p build && cd ./build && rm -rf ./*
cmake_args="-DCMAKE_BUILD_TYPE=Release -DDEVICE=ascend -DENABLE_COVERAGE=${USE_COVERAGE} -DWITH_DIOPI=INTERNAL"
if [ -n "$USE_AUTOCOMPARE" ]; then
cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DDEVICE=ascend \
-DENABLE_COVERAGE=${USE_COVERAGE} \
-DUSE_AUTOCOMPARE=${USE_AUTOCOMPARE} \
-DWITH_DIOPI=INTERNAL
else
cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DDEVICE=ascend \
-DENABLE_COVERAGE=${USE_COVERAGE} \
-DWITH_DIOPI=INTERNAL
cmake_args+=" -DUSE_AUTOCOMPARE=${USE_AUTOCOMPARE}"
fi
cmake ../ $cmake_args
cd ../
}

function build_dipu_without_diopi() {
echo "building dipu_lib without diopi:$(pwd)"
config_dipu_ascend_cmake 2>&1 | tee ./build1.log
cd build && make -j8 2>&1 | tee ./build1.log && cd ..
cd build && make -j8 2>&1 | tee ./build1.log && cd ..
}

function build_all() {
echo "building dipu_lib:$(pwd)"
echo "DIOPI_ROOT:${DIOPI_ROOT}"
echo "DIOPI_ROOT:${DIOPI_ROOT}"
config_all_ascend_cmake 2>&1 | tee ./build1.log
cd build && make -j8 2>&1 | tee ./build1.log && cd ..
cd build && make -j8 2>&1 | tee ./build1.log && cd ..
}

case $1 in
build_dipu)
(
build_all
) \
|| exit -1;;
build_dipu_without_diopi)
(
build_dipu_without_diopi
) \
|| exit -1;;
*)
echo -e "[ERROR] Incorrect option:" $1;
build_dipu)
(
build_all
) ||
exit -1
;;
build_dipu_without_diopi)
(
build_dipu_without_diopi
) ||
exit -1
;;
*)
echo -e "[ERROR] Incorrect option:" $1
;;
esac
exit 0

0 comments on commit 305d0db

Please sign in to comment.