-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add bench example for machine learning images
Signed-off-by: Bin Tang <[email protected]>
- Loading branch information
Showing
7 changed files
with
187 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
CMD_ARG: | ||
- bench_args: | ||
envs: | ||
- key: NVIDIA_VISIBLE_DEVICES | ||
value: 'all' | ||
arg: ./test.sh | ||
stdin_sh: sh | ||
mount: | ||
- container_path: /pytorch | ||
host_path: misc/mount/pytorch | ||
runtime: nvidia-container-runtime | ||
shm_size: 8gb | ||
work_dir: /pytorch | ||
category: machine-learning | ||
image: pytorch | ||
repo: ml_platform | ||
- bench_args: | ||
envs: | ||
- key: NVIDIA_VISIBLE_DEVICES | ||
value: 'all' | ||
arg: python tf_cnn_benchmarks.py --batch_size=32 --model=resnet152_v2 --variable_update=parameter_server | ||
stdin_sh: sh | ||
mount: | ||
- container_path: /tf_cnn_benchmarks | ||
host_path: misc/mount/tf_cnn_benchmarks | ||
runtime: nvidia-container-runtime | ||
shm_size: 8gb | ||
work_dir: /tf_cnn_benchmarks | ||
category: machine-learning | ||
image: tensorflow | ||
repo: ml_platform | ||
- bench_args: | ||
envs: | ||
- key: NVIDIA_VISIBLE_DEVICES | ||
value: 'all' | ||
runtime: nvidia-container-runtime | ||
shm_size: 8gb | ||
category: machine-learning | ||
image: chat-bench | ||
repo: ml_platform | ||
|
||
CMD_URL_WAIT: | ||
- bench_args: | ||
envs: | ||
- key: NVIDIA_VISIBLE_DEVICES | ||
value: 'all' | ||
arg: tritonserver --model-repository=/models | ||
stdin_sh: sh | ||
mount: | ||
- container_path: /models | ||
host_path: misc/mount/model_repository | ||
runtime: nvidia-container-runtime | ||
shm_size: 8gb | ||
wait_url: http://127.0.0.1:8000/v2/health/ready | ||
category: machine-learning | ||
image: tritonserver | ||
repo: ml_platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel | ||
|
||
ADD applications/Chat /application/chat | ||
ADD transformers /application/transformers | ||
WORKDIR /application | ||
|
||
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | ||
RUN cd /application/chat && pip install . | ||
RUN cd /application/transformers && pip install . | ||
|
||
ENTRYPOINT [ "/application/chat/benchmarks/benchmark_gpt_dummy.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
DIR=$(dirname "$0") | ||
|
||
# clone ColossalAI | ||
git clone github.com/hpcaitech/ColossalAI.git | ||
|
||
# build chat-bench | ||
sudo docker build -t ml_platform/chat-bench:2.0_cu117 ${DIR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tritonserver:23.02-py3 | ||
pytorch:1.11_cu115 | ||
pytorch:1.11_cu113 | ||
tensorflow:2.4 | ||
chat-bench:2.0_cu117 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
function download_pytorch_benchmark() { | ||
target=$(pwd)/misc/mount/pytorch | ||
if [[ -d ${target} ]];then | ||
echo "${target} already exists" | ||
return | ||
fi | ||
git clone https://github.com/JunhongXu/pytorch-benchmark-volta.git $(pwd)/misc/mount/pytorch-benchmark-volta | ||
rm -rf $(pwd)/misc/mount/pytorch-benchmark-volta/.git | ||
mv $(pwd)/misc/mount/pytorch-benchmark-volta ${target} | ||
} | ||
|
||
function download_tf_benchmark() { | ||
target=$(pwd)/misc/mount/tf_cnn_benchmarks | ||
if [[ -d ${target} ]];then | ||
echo "${target} already exists" | ||
return | ||
fi | ||
git clone https://github.com/tensorflow/benchmarks.git $(pwd)/misc/mount/benchmarks | ||
mv $(pwd)/misc/mount/benchmarks/scripts/tf_cnn_benchmarks ${target} | ||
rm -rf $(pwd)/misc/mount/benchmarks | ||
} | ||
|
||
function download_model_repository() { | ||
target=$(pwd)/misc/mount/model_repository | ||
if [[ -d ${target} ]];then | ||
echo "${target} already exists" | ||
return | ||
fi | ||
mkdir -p ${target}/inception_graphdef/1 | ||
wget -O /tmp/inception_v3_2016_08_28_frozen.pb.tar.gz \ | ||
https://storage.googleapis.com/download.tensorflow.org/models/inception_v3_2016_08_28_frozen.pb.tar.gz | ||
(cd /tmp && tar xzf inception_v3_2016_08_28_frozen.pb.tar.gz) | ||
mv /tmp/inception_v3_2016_08_28_frozen.pb ${target}/inception_graphdef/1/model.graphdef | ||
|
||
mkdir -p ${target}/densenet_onnx/1 | ||
wget -O ${target}/densenet_onnx/1/model.onnx \ | ||
https://contentmamluswest001.blob.core.windows.net/content/14b2744cf8d6418c87ffddc3f3127242/9502630827244d60a1214f250e3bbca7/08aed7327d694b8dbaee2c97b8d0fcba/densenet121-1.2.onnx | ||
} | ||
|
||
download_pytorch_benchmark | ||
download_tf_benchmark | ||
download_model_repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters