Last active
February 28, 2025 16:34
-
-
Save w32zhong/f8f2070f0ec5b817dd3e977472e63210 to your computer and use it in GitHub Desktop.
Example dockerfile
This file contains hidden or 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
| function build() { | |
| module=$1 | |
| set -x | |
| docker build -f ./$module/Dockerfile -t $module . | |
| docker image tag $module ghcr.io/w32zhong/$module:latest | |
| set +x | |
| } | |
| function push() { | |
| module=$1 | |
| set -x | |
| docker push ghcr.io/w32zhong/$module:latest | |
| set +x | |
| } | |
| function build_and_push() { | |
| module=$1 | |
| build $module | |
| push $module | |
| } | |
| function build_and_push_all() { | |
| build_and_push s3d | |
| build_and_push medusa | |
| build_and_push eagle | |
| build_and_push sequoia | |
| build_and_push cllm | |
| build_and_push mcsd | |
| build_and_push selfspec | |
| build_and_push ouroboros | |
| } | |
| function cleanup() { | |
| docker container prune -f | |
| docker rmi $(docker images -f "dangling=true" -q) | |
| docker images | |
| } | |
| function docker_run() { | |
| set -x | |
| docker run \ | |
| --gpus 'device=0' --ipc=host --ulimit memlock=-1 \ | |
| -v $HOME/.cache:/root/.cache \ | |
| -v `pwd`/output:/workspace/s3d/output \ | |
| -v `pwd`/logs:/workspace/s3d/logs \ | |
| -it $DOCKER_IMG python $@ | |
| set +x | |
| } | |
| function test_s3d() { | |
| export DOCKER_IMG=s3d | |
| docker_run eval.py s3d \ | |
| --train_config_section full_finetune_layer526 \ | |
| --decode_config_section baseline \ | |
| --dataset human-eval --max_length 1900 \ | |
| --model_path w32zhong/s3d-full_finetune_layer526 \ | |
| --sample_range 0,1 --log_endpoint '/tmp' | |
| } | |
| function test_any() { | |
| method=$1 | |
| export DOCKER_IMG=$1 | |
| docker_run eval.py $method \ | |
| --dataset human-eval --max_length 1900 \ | |
| --sample_range 0,1 --log_endpoint '/tmp' | |
| } |
This file contains hidden or 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
| FROM nvcr.io/nvidia/pytorch:23.11-py3 | |
| WORKDIR /workspace | |
| RUN pip install -r r1.txt | |
| ADD requirements.txt r2.txt | |
| # FlashAttention-2 compatibility copied from https://github.com/Dao-AILab/flash-attention/issues/836#issuecomment-1951433985 | |
| RUN pip install flash-attn==2.5.1.post1 | |
| RUN apt update && apt install -y tmux git-lfs | |
| RUN pip install nvitop | |
| ADD . myproject | |
| WORKDIR /workspace/myproject | |
| CMD /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment