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

zixiao:add resnet50 inference configs && results #256

Merged
merged 4 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 19 additions & 0 deletions inference/benchmarks/resnet50/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@ find ./val -name "*JPEG" | wc -l

- IXRT: ixrt-0.4.0+corex.3.2.0

#### 2.5 腾讯紫霄 C100

- ##### 硬件环境
- 机器、加速卡型号: C100

- ##### 软件环境
- OS版本:Ubuntu 20.04
- OS kernel版本: 5.15.0-78-generic
- 加速卡驱动版本:2.4.12
- Docker 版本:24.0.4
- 依赖软件版本:
- pytorch: 1.13.0+cpu
- onnx: 1.14.0

- 推理工具包

- zxrt 2.4.12

### 3. 运行情况

* 指标列表
Expand All @@ -122,4 +140,5 @@ find ./val -name "*JPEG" | wc -l
| torchtrt | fp16 | 256 | 716.4 | 1370.4 | 4282.6 | 1320.0 | 4723.0 | 6.3% | 76.2/76.2 | 9.42/40.0 |
| ixrt | fp16 | 256 | 136.4 | / | / | 1146.6 | 2679.9 | 11.5% | 76.2 | 4.3/32.0 |
| kunlunxin_xtcl | fp32 | 128 | 311.215 | / | / | 837.507 | 1234.727 | / | 76.2/76.2 | / |
| zixiao | fp16 | 192 | 380 | / | / | 1528.373 | 5853.771 | / | 76.2/76.2 | / |

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
compiler: zxrt
no_validation: true
batch_size: 192
exist_onnx_path: onnxs/resnet50_pytorch.onnx
85 changes: 85 additions & 0 deletions inference/docker_images/zixiao/pytorch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
FROM amd64/ubuntu:20.04

LABEL VERSION="1.1.9"

ARG DEBIAN_FRONTEND=noninteractive
USER root
WORKDIR /tmp
ARG MOFED_VER=5.4-3.1.0.0
RUN if [ $MOFED_VER ]; then echo "MOFED_VER=$MOFED_VER" & exit 0;else echo "no MOFED_VER, please check" & sleep 1 & exit 1; fi


ARG WHICH_MIRROR=mirrors.cloud.tencent.com/repo

# change source to tencent cloud
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#http://mirrors.cloud.tencent.com/ubuntu/#g' /etc/apt/sources.list && \
sed -i 's#http://security.ubuntu.com/ubuntu/#http://mirrors.cloud.tencent.com/ubuntu/#g' /etc/apt/sources.list && \
apt update && apt -yq install apt-transport-https wget
RUN wget -O /etc/apt/sources.list http://${WHICH_MIRROR}/ubuntu20_sources.list && apt update -yq
RUN mkdir /root/.pip && echo "[global]\nindex- url = https://mirrors.cloud.tencent.com/pypi/simple\ntrusted-host = mirrors.cloud.tencent.com" > /root/.pip/pip.conf

################################ BASIC LIBRARY #################################
# install packages
RUN apt-get update && apt-get install -yq apt-utils sudo vim curl \
autoconf automake dialog libtool pkg-config libffi-dev \
libexpat1-dev libpciaccess-dev libxml2-dev \
bison flex xutils-dev zlib1g-dev ninja-build git locate \
zip unzip g++ \
# install ssh
openssh-server openssh-client \
# fix hexdump missing issue
bsdmainutils \
# fix header missing for tensorflow verbs support
libibverbs-dev \
#install default python3.8
python3 python3-pip python3-dev python3-tk libjpeg-dev \
# RMA dependency library
graphviz dpatch swig gfortran chrpath tk tcl libnl-3-200 libnl-route-3-dev lsof \
libnl-3-dev libgfortran5 libnl-route-3-200 ethtool libnuma1 libnuma-dev udev \
# ECCL dependency library
libncurses5-dev hwloc libhwloc-dev libhwloc-common libboost-all-dev libevent-dev python2-dev && \
apt-get clean


# Set timezone
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

# Install miniconda
# Manually invoke bash on miniconda script per https://github.com/conda/conda/issues/10431
# RUN curl -fsSL -v -o ~/miniconda.sh -O "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" && \
RUN wget -O ~/miniconda.sh "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" && \
chmod +x ~/miniconda.sh && \
bash ~/miniconda.sh -b -p /root/miniconda && \
rm ~/miniconda.sh && \
/root/miniconda/bin/conda config --set show_channel_urls yes && \
/root/miniconda/bin/conda create --name python38 python=3.8 -y && \
/root/miniconda/bin/conda clean -ya

# hyperparamer, typing_extensions, numpy requests
RUN /root/miniconda/envs/python38/bin/pip install \
--no-cache-dir \
-i https://pypi.tuna.tsinghua.edu.cn/simple \
hyperparameter \
typing_extensions \
numpy \
requests \
onnx \
onnxruntime \
attrs \
regex \
decorator \
loguru \
schedule \
munch \
pyyaml \
tqdm \
scipy

RUN /root/miniconda/envs/python38/bin/pip install torch==1.13.0+cpu torchvision==0.14.0+cpu torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cpu

ENV PATH /root/miniconda/envs/python38/bin:$PATH
ENV PATH=/usr/local/zx-smi/zx-smi-1.20.0:$PATH



5 changes: 5 additions & 0 deletions inference/docker_images/zixiao/pytorch/packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 以下软件包需联系腾讯蓬莱实验室获取

>联系邮箱: feldmanshan@tencent.com

TopsInference-2.4.12-py3.8-none-any.wh
6 changes: 6 additions & 0 deletions inference/docker_images/zixiao/pytorch/pytorch_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
pip3 install ./packages/TopsInference-2.4.12-py3.8-none-any.whl

dpkg -i ./sdk_installers/topsruntime_2.4.12-1_amd64.deb
dpkg -i ./sdk_installers/tops-sdk_2.4.12-1_amd64.deb

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 以下软件包需联系腾讯蓬莱实验室获取

>联系邮箱: feldmanshan@tencent.com

zixiao-x86_64-gcc-2.4.12.run

topsruntime_2.4.12-1_amd64.deb
tops-sdk_2.4.12-1_amd64.deb
16 changes: 16 additions & 0 deletions inference/docker_images/zixiao/zixiao_analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def analysis_log(logpath):
logfile = open(logpath)

max_usage = 0.0 ## usage_mem
max_mem = 16.0
for line in logfile.readlines():
'''
zx-smi pwr DTemp MUsed Mem
'''
if "zx-smi" in line:
line = line[:-1]
usage = line.split(" ")[3]
usage = float(usage)*16/100
max_usage = max(max_usage, usage)
return round(max_usage, 2), max_mem, eval("30e12"), eval("120e12")

Loading