Run FMBench as a Docker container¶
You can now run FMBench on any platform where you can run a Docker container, for example on an EC2 VM, SageMaker Notebook etc. The advantage is that you do not have to install anything locally, so no conda installs needed anymore. Here are the steps to do that.
-
Create local directory structure needed for
FMBenchand copy all publicly available dependencies from the AWS S3 bucket forFMBench. This is done by running thecopy_s3_content.shscript available as part of theFMBenchrepo. You can place model specific tokenizers and any new configuration files you create in the/tmp/fmbench-readdirectory that is created after running the following command. -
That's it! You are now ready to run the container.
# set the config file path to point to the config file of interest CONFIG_FILE=https://raw.githubusercontent.com/aws-samples/foundation-model-benchmarking-tool/main/fmbench/configs/llama2/7b/config-llama2-7b-g5-quick.yml docker run -v $(pwd)/fmbench:/app \ -v /tmp/fmbench-read:/tmp/fmbench-read \ -v /tmp/fmbench-write:/tmp/fmbench-write \ aarora79/fmbench:v1.0.47 \ "fmbench --config-file ${CONFIG_FILE} --local-mode yes --write-bucket placeholder > fmbench.log 2>&1" -
The above command will create a
fmbenchdirectory inside the current working directory. This directory contains thefmbench.logand theresults-*folder that is created once the run finished.