diff --git a/PyTorch/built-in/cv/classification/ResNet50_for_PyTorch/requirements.txt b/PyTorch/built-in/cv/classification/ResNet50_for_PyTorch/requirements.txt index fbefb37521789025484a96ad28dc194561590cfe..f5f431ac5b9c83bc32048524a218dd6d86225423 100644 --- a/PyTorch/built-in/cv/classification/ResNet50_for_PyTorch/requirements.txt +++ b/PyTorch/built-in/cv/classification/ResNet50_for_PyTorch/requirements.txt @@ -1,3 +1,5 @@ apex torchvision -opencv-python \ No newline at end of file +opencv-python + + diff --git a/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_full_8p.sh b/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_full_8p.sh index e80116c3416e1f49037188137f67d33f194ae069..1c846c057643290ac5ade7122cba33b0c1ed6d92 100644 --- a/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_full_8p.sh +++ b/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_full_8p.sh @@ -66,29 +66,60 @@ if [ x"${etp_flag}" != x"true" ];then source ${test_path_dir}/env_npu.sh fi -python3 ./main-8p.py \ - -a inception_v3 \ - --amp \ - --loss-scale 128 \ - --data ${data_path} \ - --addr=$(hostname -I |awk '{print $1}') \ - --seed=49 \ - --workers=128 \ - --learning-rate=${learning_rate} \ - --mom=0.9 \ - --weight-decay=1.0e-04 \ - --print-freq=30 \ - --dist-url='tcp://127.0.0.1:50000' \ - --dist-backend='hccl' \ - --multiprocessing-distributed \ - --world-size=1 \ - --rank=0 \ - --device='npu' \ - --epochs=${train_epochs} \ - --checkpoint-freq=-1 \ - --label-smoothing=0.1 \ - --batch-size=${batch_size} > ${test_path_dir}/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log 2>&1 & - +KERNEL_NUM=$(($(nproc)/8)) +for i in $(seq 0 7) +do + if [ $(uname -m) = "aarch64" ] + then + PID_START=$((KERNEL_NUM*i)) + PID_END=$((PID_START + KERNEL_NUM - 1)) + taskset -c $PID_START-$PID_END python3 ./main-8p.py \ + -a inception_v3 \ + --amp \ + --loss-scale 128 \ + --data ${data_path} \ + --addr=$(hostname -I |awk '{print $1}') \ + --seed=49 \ + --workers=128 \ + --learning-rate=${learning_rate} \ + --mom=0.9 \ + --weight-decay=1.0e-04 \ + --print-freq=30 \ + --dist-url='tcp://127.0.0.1:50000' \ + --dist-backend='hccl' \ + --multiprocessing-distributed \ + --world-size=1 \ + --rank=0 \ + --device='npu' \ + --epochs=${train_epochs} \ + --checkpoint-freq=-1 \ + --label-smoothing=0.1 \ + --batch-size=${batch_size} > ${test_path_dir}/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log 2>&1 & + else + python3 ./main-8p.py \ + -a inception_v3 \ + --amp \ + --loss-scale 128 \ + --data ${data_path} \ + --addr=$(hostname -I |awk '{print $1}') \ + --seed=49 \ + --workers=128 \ + --learning-rate=${learning_rate} \ + --mom=0.9 \ + --weight-decay=1.0e-04 \ + --print-freq=30 \ + --dist-url='tcp://127.0.0.1:50000' \ + --dist-backend='hccl' \ + --multiprocessing-distributed \ + --world-size=1 \ + --rank=0 \ + --device='npu' \ + --epochs=${train_epochs} \ + --checkpoint-freq=-1 \ + --label-smoothing=0.1 \ + --batch-size=${batch_size} > ${test_path_dir}/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log 2>&1 & + fi +done wait # 训练结束时间,不需要修改 diff --git a/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_performance_8p.sh b/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_performance_8p.sh index 3d1080d971bbaf6a3cc97a6cedf4aee96fd611a9..b59f64220449fbf5440c14cd112f01b947d2e451 100644 --- a/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_performance_8p.sh +++ b/PyTorch/contrib/cv/classification/InceptionV3_ID1596_for_PyTorch/test/train_performance_8p.sh @@ -66,27 +66,58 @@ if [ x"${etp_flag}" != x"true" ];then source ${test_path_dir}/env_npu.sh fi -python3 ./main-8p.py \ - -a inception_v3 \ - --amp \ - --loss-scale 128 \ - --data ${data_path} \ - --addr=$(hostname -I |awk '{print $1}') \ - --seed=49 \ - --workers=128 \ - --learning-rate=${learning_rate} \ - --mom=0.9 \ - --weight-decay=1.0e-04 \ - --print-freq=30 \ - --dist-url='tcp://127.0.0.1:50000' \ - --dist-backend='hccl' \ - --multiprocessing-distributed \ - --world-size=1 \ - --rank=0 \ - --device='npu' \ - --epochs=${train_epochs} \ - --label-smoothing=0.1 \ - --batch-size=${batch_size} > ${test_path_dir}/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log 2>&1 & +KERNEL_NUM=$(($(nproc)/8)) +for i in $(seq 0 7) +do + if [ $(uname -m) = "aarch64" ] + then + PID_START=$((KERNEL_NUM*i)) + PID_END=$((PID_START + KERNEL_NUM - 1)) + taskset -c $PID_START-$PID_END python3 ./main-8p.py \ + -a inception_v3 \ + --amp \ + --loss-scale 128 \ + --data ${data_path} \ + --addr=$(hostname -I |awk '{print $1}') \ + --seed=49 \ + --workers=128 \ + --learning-rate=${learning_rate} \ + --mom=0.9 \ + --weight-decay=1.0e-04 \ + --print-freq=30 \ + --dist-url='tcp://127.0.0.1:50000' \ + --dist-backend='hccl' \ + --multiprocessing-distributed \ + --world-size=1 \ + --rank=0 \ + --device='npu' \ + --epochs=${train_epochs} \ + --label-smoothing=0.1 \ + --batch-size=${batch_size} > ${test_path_dir}/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log 2>&1 & + else + python3 ./main-8p.py \ + -a inception_v3 \ + --amp \ + --loss-scale 128 \ + --data ${data_path} \ + --addr=$(hostname -I |awk '{print $1}') \ + --seed=49 \ + --workers=128 \ + --learning-rate=${learning_rate} \ + --mom=0.9 \ + --weight-decay=1.0e-04 \ + --print-freq=30 \ + --dist-url='tcp://127.0.0.1:50000' \ + --dist-backend='hccl' \ + --multiprocessing-distributed \ + --world-size=1 \ + --rank=0 \ + --device='npu' \ + --epochs=${train_epochs} \ + --label-smoothing=0.1 \ + --batch-size=${batch_size} > ${test_path_dir}/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log 2>&1 & + fi +done wait # 训练结束时间,不需要修改 diff --git a/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_full_8p.sh b/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_full_8p.sh index 4a924972ff9a77cce7a89868d612d4c7330becb8..bc86be9a2362f12945cd3a1a80adbae4a4d399b3 100644 --- a/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_full_8p.sh +++ b/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_full_8p.sh @@ -81,6 +81,7 @@ echo "end_time: ${end_time}" e2e_time=$(( $end_time - $start_time )) FPS=`grep -a 'fps: ' $cur_path/output/${Network}/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log|awk -F "fps: " '{print $NF}'|awk -F "," '{print $1}'|awk 'NR==1{max=$1;next}{max=max>$1?max:$1}END{print max}'` +FPS='${FPS}'*8 echo "Final Performance images/sec : $FPS" #输出训练精度,需要模型审视修改 diff --git a/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_performance_8p.sh b/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_performance_8p.sh index 900e7652b8e8e647876d3cb29392b1de98dbea4d..ee843b84b7e8b7eed9fbdcc927f0efe90eebfb72 100644 --- a/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_performance_8p.sh +++ b/PyTorch/contrib/cv/semantic_segmentation/FCN8s/test/train_performance_8p.sh @@ -81,6 +81,7 @@ echo "end_time: ${end_time}" e2e_time=$(( $end_time - $start_time )) FPS=`grep -a 'fps: ' $cur_path/output/${Network}/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log|awk -F "fps: " '{print $NF}'|awk -F "," '{print $1}'|awk 'NR==1{max=$1;next}{max=max>$1?max:$1}END{print max}'` +FPS='${FPS}'*8 echo "Final Performance images/sec : $FPS" #输出训练精度,需要模型审视修改