代码拉取完成,页面将自动刷新
#!/bin/bash
EXEC_PATH=$(pwd)
export RANK_TABLE_FILE=${EXEC_PATH}/rank_table_8pcs.json
export RANK_SIZE=8
rm -rf device*
for ((i = 1; i < ${RANK_SIZE}; i++)); do
mkdir device$i
cp *.py ./device$i
cd ./device$i
export DEVICE_ID=$i
export RANK_ID=$i
echo "start inference for device $i"
pytest -sv ./distributed_inference.py::test_inference >inference.log$i 2>&1 &
cd ../
done
mkdir device0
cp *.py ./device0
cd ./device0
export DEVICE_ID=0
export RANK_ID=0
echo "start inference for device 0"
pytest -sv ./distributed_inference.py::test_inference >inference.log0 2>&1
if [ $? -eq 0 ]; then
echo "inference success"
else
echo "inference failed"
cat inference.log0
exit 2
fi
cd ../
ls device*/ -l
num=`ls device*/matmul.mindir -l | wc -l`
if [ ${num} -ne 8 ]
then
echo "export matmul mindir failed"
cat device0/inference.log0
exit 2
fi
output_dir=../model
rm -rf ${output_dir}/device*
for ((i = 0; i < ${RANK_SIZE}; i++)); do
mkdir -p ${output_dir}/device${i}
cp device${i}/*.mindir ${output_dir}/device${i}/
cp device${i}/*.pb ${output_dir}/device${i}/
done
echo "copy models success"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。