-
Notifications
You must be signed in to change notification settings - Fork 32
Add Containerized Benchmarking Support for GuideLLM #123
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
base: main
Are you sure you want to change the base?
Conversation
Could you put these files under a |
Dockerfile
Outdated
# Healthcheck | ||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | ||
CMD curl -f http://localhost:8000/health || exit 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this was an accidental inclusion since GuideLLM does not provide a web server.
# Healthcheck | |
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
CMD curl -f http://localhost:8000/health || exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I remove this in the new build/Dockerfile.
Dockerfile
Outdated
WORKDIR /app | ||
|
||
# Install GuideLLM | ||
RUN pip install git+https://github.com/neuralmagic/guidellm.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than installing main, install our current HEAD. Also cp
from within the container to avoid having two COPY layers.
RUN pip install git+https://github.com/neuralmagic/guidellm.git | |
COPY . /source | |
RUN pip install /source && \ | |
cp /source/build/run_benchmark.sh /app/ |
run_benchmark.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this script is going to be the ENTRYPOINT and not the CMD than it needs to be more flexible. Either add an extra arguments variable or append command line arguments to the command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I allow it to add extra arguments.
…arking fix pre-commit issue? Add Docker build files and update .gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let some comments throughout. Additionally, I know we had a request to move it to build/, but this is a commonly named folder that python and potential future builds will use.
I've generally seen the parent folder be docker/ at the root and then different python versions could be either nested folders under that with a Dockerfile or multiple Dockerfiles a the root with extensions of the python version such as Dockerfile.py39
@@ -0,0 +1,32 @@ | |||
FROM python:3.12-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to have this at one of the extremes for the supported versions rather than somewhere in the middle, especially since the max and min version are tested much more; ie 3.9 or 3.13
FROM python:3.12-slim | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/neuralmagic/guidellm" | ||
LABEL org.opencontainers.image.description="GuideLLM Benchmark Container" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: can we remove the benchmark from this so we keep it flexible towards future goals of evals and things like that?
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
curl \ | ||
&& pip install git+https://github.com/neuralmagic/guidellm.git \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned that this is too restrictive in that it always builds from the latest main, so it will be tough to specify what should be built here other than from the latest main either with the build system for a specific release or for a user.
Can we expand this with a build-arg for the package version to build? Which we can set as default to build from the latest main, but otherwise can utilize it to specify the release tag/branch to build from.
CMD curl -f http://localhost:8000/health || exit 1 | ||
|
||
# Set the entrypoint | ||
ENTRYPOINT ["/app/run_benchmark.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this out so that we are setting the entrypoint to "guidellm" or "guidellm benchmark"? We can then set the CMD after to include any specific args we need passed in / surface from the settings or set it to --help for users to get started with. This way we can enable and passthrough and remove duplication of arguments we need to pass through and another script to maintain and add functionality to.
@@ -0,0 +1,35 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See note on the entrypoint for the Dockerfile, I'd like to see if we can remove this script fully or make it optional to package in
@@ -0,0 +1,32 @@ | |||
FROM python:3.12-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what are our plans for supporting the range of python versions? Anything we should do here to create specific Dockerfiles for each supported python version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I would recommend handling this either though build args or postfixes on the Containerfile name. E.g.
FROM python:3.12-slim | |
ARG python_version=3.13 | |
FROM python:${python_version}-slim |
Or name this file something like Containerfile.python-3.13
Add Containerized Benchmarking Support for GuideLLM
Description
This PR adds containerization support for GuideLLM benchmarking, making it easier to run benchmarks in containerized environments. The changes include:
A new
Dockerfile
that:A new
run_benchmark.sh
script that:Testing
The container can be built and tested using:
Configuration Options
The container supports the following environment variables:
TARGET
: The target endpoint for benchmarking (default: http://localhost:8000)MODEL
: The model to benchmark (default: neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16)RATE_TYPE
: The rate type for benchmarking (default: sweep)DATA
: The data configuration (default: prompt_tokens=256,output_tokens=128)MAX_REQUESTS
: Maximum number of requests (default: 100)MAX_SECONDS
: Maximum duration in secondsOUTPUT_PATH
: Path for output files (default: /results/guidellm_benchmark_results)OUTPUT_FORMAT
: Output format (json, yaml, or yml)Security Considerations
Related Issues
Checklist