Skip to content

Commit ad1a1b1

Browse files
Add dcu paddlex (#68448)
* Add DCU PaddleX * fix * fix * fix paddlex * disable resnet50 inference * Fix device * Test * update
1 parent 68db778 commit ad1a1b1

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

paddle/scripts/paddle_build.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,6 +2720,55 @@ set -x
27202720
fi
27212721
}
27222722

2723+
2724+
function hybrid_paddlex() {
2725+
# PaddleX test
2726+
export DEVICE=($(echo $HIP_VISIBLE_DEVICES | tr "," "\n"))
2727+
git clone --depth=1000 https://gitee.com/paddlepaddle/PaddleX.git
2728+
cd PaddleX
2729+
pip install -e .
2730+
paddlex --install PaddleClas
2731+
paddlex --install PaddleSeg
2732+
wget -q https://paddle-model-ecology.bj.bcebos.com/paddlex/data/cls_flowers_examples.tar -P ./dataset
2733+
tar -xf ./dataset/cls_flowers_examples.tar -C ./dataset/
2734+
wget https://paddle-model-ecology.bj.bcebos.com/paddlex/data/seg_optic_examples.tar -P ./dataset
2735+
tar -xf ./dataset/seg_optic_examples.tar -C ./dataset/
2736+
2737+
# train Reset50
2738+
echo "Start Reset50"
2739+
python main.py -c paddlex/configs/image_classification/ResNet50.yaml \
2740+
-o Global.mode=train \
2741+
-o Global.dataset_dir=./dataset/cls_flowers_examples \
2742+
-o Global.output=resnet50_output \
2743+
-o Global.device="gpu:${HIP_VISIBLE_DEVICES}" \
2744+
-o Train.epochs_iters=2
2745+
2746+
# inference Reset50
2747+
python main.py -c paddlex/configs/image_classification/ResNet50.yaml \
2748+
-o Global.mode=predict \
2749+
-o Predict.model_dir="./resnet50_output/best_model/inference" \
2750+
-o Global.device="gpu:${DEVICE[0]}"
2751+
echo "End Reset50"
2752+
2753+
echo "Start DeepLabv3+"
2754+
# train DeepLabv3+
2755+
python main.py -c paddlex/configs/semantic_segmentation/Deeplabv3_Plus-R50.yaml \
2756+
-o Global.mode=train \
2757+
-o Global.dataset_dir=./dataset/seg_optic_examples \
2758+
-o Global.output=deeplabv3p_output \
2759+
-o Global.device="gpu:${HIP_VISIBLE_DEVICES}" \
2760+
-o Train.epochs_iters=2
2761+
2762+
# inference DeepLabv3+
2763+
python main.py -c paddlex/configs/semantic_segmentation/Deeplabv3_Plus-R50.yaml \
2764+
-o Global.mode=predict \
2765+
-o Predict.model_dir="./deeplabv3p_output/best_model/inference" \
2766+
-o Global.device="gpu:${DEVICE[0]}"
2767+
echo "End DeepLabv3+"
2768+
2769+
}
2770+
2771+
27232772
function parallel_fa_unit() {
27242773
if [ ${WITH_TESTING:-ON} == "ON" ] ; then
27252774
cat <<EOF
@@ -4674,6 +4723,7 @@ function main() {
46744723
;;
46754724
hyg_dcu_test)
46764725
parallel_test
4726+
hybrid_paddlex
46774727
;;
46784728
nv_cicheck_coverage)
46794729
parallel_test

0 commit comments

Comments
 (0)