Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

[docker] polish lauch docker scripts #119

Merged
merged 1 commit into from
Aug 23, 2022
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ $ pip install -r requirements.txt
$ pip install .
```

### Launch an http service using docker
``` bash
bash ./docker/launch.sh
```


### Huggingface GPT2 Generation Task Case

``` bash
Expand Down
3 changes: 1 addition & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM hpcaitech/colossalai:0.1.8
# FROM energonai:lastest

WORKDIR /workspace

RUN mkdir -p /workspace && cd /workspace && git clone https://github.com/hpcaitech/EnergonAI.git --recursive && cd EnergonAI && pip --no-cache-dir install -r requirements.txt && pip install .

CMD ["bash", "/workspace/EnergonAI/server.sh"]
CMD ["bash", "/config/server.sh"]
6 changes: 6 additions & 0 deletions docker/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# the directory contains the checkpoint
export CHECKPOINT_DIR="/data/user/lclhx/opt-30B"
# the ${CONFIG_DIR} must contain a server.sh file as the entry of service
export CONFIG_DIR="/home/lcfjr/codes/EnergonAI/examples/opt"

docker run --gpus all --rm -it -p 8090:8020 -v ${CHECKPOINT_DIR}:/model_checkpoint -v ${CONFIG_DIR}:/config --ipc=host energonai:lastest
4 changes: 3 additions & 1 deletion examples/opt/opt_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
port = 29402
half = True
# checkpoint = "/data/user/djs_model_checkpoint/opt_metaseq_125m/model/restored.pt"
checkpoint = '/data/user/lclhx/opt-30B'

# If serving using a docker, map your own checkpoint directory to /model_checkpoint
checkpoint = '/model_checkpoint/'
# "/data/user/djs_model_checkpoint/opt-30B-singleton/opt_metaseq_30000m/model/restored.pt"
backend = "nccl"

Expand Down
2 changes: 1 addition & 1 deletion server.sh → examples/opt/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -xe
cd $(dirname $0)

export BASE=./examples/opt
export BASE=${PWD}

export PYTHONPATH=${BASE}
energonai service init --config_file=${BASE}/opt_config.py