Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PaddleV3] 修改 Dockerfile 为 Paddle 3.0.0beta 并添加 CI 测试的 blacklist #1061

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
FROM paddlepaddle/paddle:latest-dev-cuda11.2-cudnn8-gcc82

RUN wget https://paddle-qa.bj.bcebos.com/PaddleX2paddle/torch-1.7.0-cp37-cp37m-linux_x86_64.whl --no-proxy && \
wget https://paddle-qa.bj.bcebos.com/PaddleX2paddle/torchvision-0.8.1-cp37-cp37m-linux_x86_64.whl --no-proxy && \
wget https://paddle-wheel.bj.bcebos.com/2.4.2/linux/linux-gpu-cuda11.2-cudnn8-mkl-gcc8.2-avx/paddlepaddle_gpu-2.4.2.post112-cp37-cp37m-linux_x86_64.whl --no-proxy

RUN python --version && unlink /usr/bin/python && ln -s /usr/bin/python3.7 /usr/bin/python
FROM paddlepaddle/paddle:latest-dev-cuda11.2-cudnn8.2-trt8.0-gcc82

ENV HTTP_PROXY <HTTP_PROXY>
ENV HTTPS_PROXY <HTTPS_PROXY>
RUN export http_proxy=$HTTP_PROXY
RUN export https_proxy=$HTTPS_PROXY

RUN python -m pip install --upgrade pip && \
python -m pip install wget timm transformers==3.1.0 ./*.whl pandas nose pytest opencv-python==4.6.0.66 allure-pytest && \
python -m pip install pynvml psutil GPUtil sympy treelib tensorflow==1.14.0 onnx==1.10.0 onnxruntime==1.10.0 easyocr==1.2.1 && \
python -m pip install torchmetrics==0.10.2 pytorch_lightning==1.5.3 kornia==0.5.11 hypothesis pre-commit==2.17.0 && \
python -m pip install wget timm transformers pandas nose pytest opencv-python==4.6.0.66 allure-pytest && \
python -m pip install torch==2.4.1 torchvision torchaudio tensorflow==2.16.1 onnx==1.17.0 onnxruntime && \
python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.paddlepaddle.org.cn/packages/stable/cu118/

11.2的镜像可以装3.0.0b1么?

python -m pip install pynvml psutil GPUtil sympy treelib easyocr && \
python -m pip install torchmetrics pytorch_lightning kornia==0.5.11 hypothesis pre-commit==2.17.0 protobuf==3.20.2 && \
python -m pip install --upgrade virtualenv
4 changes: 2 additions & 2 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#生成镜像
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t paddlepaddle/x2paddle:latest-dev-cuda11.2-cudnn8-gcc82 .
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t paddlepaddle/x2paddle:latest-dev-cuda11.2-cudnn8.2-trt8.0-gcc82 .

#进入镜像
nvidia-docker run -it --cpu-shares=20000 --name=user-x2paddle --rm -v /usr/bin/nvidia-smi:/usr/bin/nvidia-smi -v $(pwd):/workspace paddlepaddle/x2paddle:latest-dev-cuda11.2-cudnn8-gcc82 /bin/bash
nvidia-docker run -it --cpu-shares=20000 --name=user-x2paddle --rm -v /usr/bin/nvidia-smi:/usr/bin/nvidia-smi -v $(pwd):/workspace paddlepaddle/x2paddle:latest-dev-cuda11.2-cudnn8.2-trt8.0-gcc82 /bin/bash
16 changes: 6 additions & 10 deletions test_benchmark/Caffe/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ find . -name "pd_model_static" | xargs rm -rf
find . -name "pd_model_dygraph" | xargs rm -rf
find . -name "run.log" | xargs rm -rf

num_of_models=$(ls -d */ | grep "[A-Z0-9]" | wc -l)
num_of_caffe_files=$(find . -name "*.caffemodel" | wc -l)

if [ $num_of_caffe_files -ne $num_of_models ]
then
echo "[ERROR] num_of_caffe_files != num_of_models"
exit -1
fi
# use black.list to control CI tests
filename="black.list"
models=$(ls -d */ | grep -v -F -f "$filename")
num_of_models=$(ls -d */ | grep -v -F -f "$filename" | wc -l)

counter=1
for model in $(ls -d */ | grep "[A-Z0-9]")
for model in $models
do
echo "[X2Paddle-Caffe] ${counter}/${num_of_models} $model ..."
if [ $model != "FaceDetction/" -a $model != "SSD/" ]
Expand All @@ -35,7 +31,7 @@ wait

rm -rf result.txt
touch result.txt
for model in $(ls -d */ | grep "[A-Z0-9]")
for model in $models
do
if [ $model != "FaceDetction/" -a $model != "SSD/" ]
then
Expand Down
23 changes: 23 additions & 0 deletions test_benchmark/Caffe/black.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
3class
AlexNet
FaceDetction
MNasNet
MTCNN1
MTCNN2
MTCNN3
MobileNetV1
MobileNetV2
ResNet18
ResNet50
SSD
SegFlow
ShuffleNet
SqueezeNet
TSM
UNet
VGG16
VGG19
caffemodel1
tools
output
dataset
16 changes: 6 additions & 10 deletions test_benchmark/Caffe/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ find . -name "pd_model_static" | xargs rm -rf
find . -name "pd_model_dygraph" | xargs rm -rf
find . -name "run.log" | xargs rm -rf

num_of_models=$(ls -d */ | grep "[A-Z0-9]" | wc -l)
num_of_caffe_files=$(find . -name "*.caffemodel" | wc -l)

if [ $num_of_caffe_files -ne $num_of_models ]
then
echo "[ERROR] num_of_caffe_files != num_of_models"
exit -1
fi
# use black.list to control CI tests
filename="black.list"
models=$(ls -d */ | grep -v -F -f "$filename")
num_of_models=$(ls -d */ | grep -v -F -f "$filename" | wc -l)

counter=1
for model in $(ls -d */ | grep "[A-Z0-9]")
for model in $models
do
echo "[X2Paddle-Caffe] ${counter}/${num_of_models} $model ..."
cd $model
Expand All @@ -36,7 +32,7 @@ wait

rm -rf result.txt
touch result.txt
for model in $(ls -d */ | grep "[A-Z0-9]")
for model in $models
do
cat ${model}/result.txt >> ./result.txt
done
Expand Down
18 changes: 6 additions & 12 deletions test_benchmark/ONNX/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ find . -name "pd_model_dygraph" | xargs rm -rf
find . -name "run.log" | xargs rm -rf
find . -name "run.err" | xargs rm -rf

num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | wc -l)
num_of_onnx_files=$(find . -name "*.onnx" | wc -l)

#if [ $num_of_onnx_files -ne $num_of_models ]
#then
# echo $num_of_onnx_files
# echo $num_of_models
# echo "[ERROR] num_of_onnx_files != num_of_models"
# exit -1
#fi
# use black.list to control CI tests
filename="black.list"
models=$(ls -d */ | grep -v -F -f "$filename")
num_of_models=$(ls -d */ | grep -v -F -f "$filename" | wc -l)

counter=1
for model in $(ls -d */ | grep -v 'tools' | grep -v 'output')
for model in $models
do
echo "[X2Paddle-ONNX] ${counter}/${num_of_models} $model ..."
cd $model
Expand All @@ -34,7 +28,7 @@ wait

rm -rf result.txt
touch result.txt
for model in $(ls -d */ | grep -v 'tools' | grep -v 'output')
for model in $models
do
cat ${model}/result.txt >> ./result.txt
done
Expand Down
60 changes: 60 additions & 0 deletions test_benchmark/ONNX/black.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FaceNet
GPEN
IDG_detection_registration_p1
IDG_detection_registration_p2
IDG_keypoint_selection
IDG_local_vis
IDG_multi_modal_crop_cnn_model
IDG_multi_modal_fully_cnn_model
IDG_multi_modal_sequential_model
IDG_test_process
IDG_test_sim_feat_new
MLPerf_ResNet50
Poselandmarks
Seg
SwinTransformer
VIT_online
alexnet
basnet
bert6
best_float32
cifarnet
circledet
crnn_lstm
densenet121
efficientnet_b0
face_cyclegan_34
facedetector
hand_landmark_ar
inceptionv1
inceptionv2
mmdetection_fasterrcnn
mmdetection_fcos
mmdetection_fsaf
mmdetection_retina
mmdetection_ssd
mmdetection_yolov3
mnasnet_a1
mobilefacenet
mobilenet_v2
modelGen
pnasnet_mobile
resnet101
resnet152
resnet18
resnet34
resnet50
ronin_2d_cp9
shufflenet
squeezenet
transformer
vgg11
vgg11_bn
vgg16_bn
vgg19
vgg19_bn
yolov5s
yolov5s_fix_resize
dataset
tools
output
18 changes: 6 additions & 12 deletions test_benchmark/ONNX/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ find . -name "pd_model_dygraph" | xargs rm -rf
find . -name "run.log" | xargs rm -rf
find . -name "run.err" | xargs rm -rf

num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | wc -l)
num_of_onnx_files=$(find . -name "*.onnx" | wc -l)

#if [ $num_of_onnx_files -ne $num_of_models ]
#then
# echo $num_of_onnx_files
# echo $num_of_models
# echo "[ERROR] num_of_onnx_files != num_of_models"
# exit -1
#fi
# use black.list to control CI tests
filename="black.list"
models=$(ls -d */ | grep -v -F -f "$filename")
num_of_models=$(ls -d */ | grep -v -F -f "$filename" | wc -l)

counter=1
for model in $(ls -d */ | grep -v 'tools' | grep -v 'output')
for model in $models
do
echo "[X2Paddle-ONNX] ${counter}/${num_of_models} $model ..."
cd $model
Expand All @@ -38,7 +32,7 @@ wait

rm -rf result.txt
touch result.txt
for model in $(ls -d */ | grep -v 'tools' | grep -v 'output')
for model in $models
do
cat ${model}/result.txt >> ./result.txt
done
Expand Down
13 changes: 4 additions & 9 deletions test_benchmark/PyTorch/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ find . -name "pd_model_script" | xargs rm -rf
find . -name "run.log" | xargs rm -rf
find . -name "run.err" | xargs rm -rf

models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird')
num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird' | wc -l)
num_of_pb_files=`expr $(find . -name "convert.py" | wc -l) + $(find . -name "convert_trace.py" | grep -v 'MockingBird' | wc -l)`

if [ $num_of_pb_files -ne $num_of_models ]
then
echo "[ERROR] num_of_pb_files != num_of_models"
exit -1
fi
# use black.list to control CI tests
filename="black.list"
models=$(ls -d */ | grep -v -F -f "$filename")
num_of_models=$(ls -d */ | grep -v -F -f "$filename" | wc -l)

counter=1
for model in $models
Expand Down
36 changes: 36 additions & 0 deletions test_benchmark/PyTorch/black.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ACG_UnitTest
AlexNet
BASNet
BertForMaskedLM_dccuchile
BertModel_SpanBert
CamembertForQuestionAnswering
DBFace
DPRContextEncoder
DeepLabv3_ResNet50
EDSR
EasyOCR_detector
EasyOCR_recognizer
ElectraModel
FCN_ResNet50
FlaubertModel
GRU
InceptionV3
MNasNet
MiniFasNet
MobileNetV2
Mobilestereonet
MockingBird
ResNet18
ResNet18_2
Roberta
Saicinpainting_LaMa
ShuffleNetV2
SqueezeNet
SwinTransformer
VGG16
XLMRobertaForTokenClassification
mobilenetv3
opadd
dataset
tools
output
13 changes: 4 additions & 9 deletions test_benchmark/PyTorch/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ find . -name "pd_model_script" | xargs rm -rf
find . -name "run.log" | xargs rm -rf
find . -name "run.err" | xargs rm -rf

models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird')
num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird' | wc -l)
num_of_pb_files=`expr $(find . -name "convert.py" | wc -l) + $(find . -name "convert_trace.py" | grep -v 'MockingBird' | wc -l)`

if [ $num_of_pb_files -ne $num_of_models ]
then
echo "[ERROR] num_of_pb_files != num_of_models"
exit -1
fi
# use black.list to control CI tests
filename="black.list"
models=$(ls -d */ | grep -v -F -f "$filename")
num_of_models=$(ls -d */ | grep -v -F -f "$filename" | wc -l)

counter=1
for model in $models
Expand Down
16 changes: 6 additions & 10 deletions test_benchmark/TensorFlow/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ find . -name "pd_model_dygraph" | xargs rm -rf
find . -name "run.log" | xargs rm -rf
find . -name "run.err" | xargs rm -rf

num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | wc -l)
num_of_pb_files=$(find . -name "*.pb" | wc -l)

if [ $num_of_pb_files -ne $num_of_models ]
then
echo "[ERROR] num_of_pb_files != num_of_models"
exit -1
fi
# use black.list to control CI tests
filename="black.list"
models=$(ls -d */ | grep -v -F -f "$filename")
num_of_models=$(ls -d */ | grep -v -F -f "$filename" | wc -l)

counter=1
for model in $(ls -d */ | grep -v 'tools' | grep -v 'output')
for model in $models
do
echo "[X2Paddle-TensorFlow] ${counter}/${num_of_models} $model ..."
cd $model
Expand All @@ -32,7 +28,7 @@ wait

rm -rf result.txt
touch result.txt
for model in $(ls -d */ | grep -v 'tools' | grep -v 'output')
for model in $models
do
cat ${model}/result.txt >> ./result.txt
done
Expand Down
31 changes: 31 additions & 0 deletions test_benchmark/TensorFlow/black.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
AlBert
EfficientNet
InceptionResNetV2
InceptionV3
InceptionV4
KerasBert
MNASNetA1
MTCNN-ONet
MTCNN-PNet
MTCNN-RNet
MobileNetV1
MobileNetV2
MobileNetV3_large
ResNetV1
ResNetV2
RetinaFace
ShuffleNet
SqueezeNet
ToyUNet-ToyUnet
ToyUNet-UNet
UNet-GanUNet
UNet-UNet
VGG16
YOLOv3
YOLOv3_darknet
frozen
frozen_MobileNetV1
pix2pix
dataset
tools
output
Loading