-
Notifications
You must be signed in to change notification settings - Fork 40
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?
Changes from 2 commits
29aaf7b
9ca1e8f
2fd8c0c
5abf27a
661e8e4
4ae2bae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,36 @@ | ||||||||||
FROM python:3.11-slim | ||||||||||
|
||||||||||
LABEL org.opencontainers.image.source="https://github.com/neuralmagic/guidellm" | ||||||||||
LABEL org.opencontainers.image.description="GuideLLM Benchmark Container" | ||||||||||
|
||||||||||
# Install system dependencies | ||||||||||
RUN apt-get update && apt-get install -y \ | ||||||||||
git \ | ||||||||||
curl \ | ||||||||||
&& rm -rf /var/lib/apt/lists/* | ||||||||||
|
||||||||||
# Create non-root user | ||||||||||
RUN useradd -m -u 1000 guidellm | ||||||||||
|
||||||||||
# Set working directory | ||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Rather than installing main, install our current HEAD. Also
Suggested change
|
||||||||||
|
||||||||||
# Copy and set up the benchmark script | ||||||||||
COPY run_benchmark.sh /app/ | ||||||||||
RUN chmod +x /app/run_benchmark.sh | ||||||||||
wangchen615 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
# Set ownership to non-root user | ||||||||||
RUN chown -R guidellm:guidellm /app | ||||||||||
|
||||||||||
# Switch to non-root user | ||||||||||
USER guidellm | ||||||||||
|
||||||||||
# 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 commentThe 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.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I remove this in the new build/Dockerfile. |
||||||||||
# Set the entrypoint | ||||||||||
ENTRYPOINT ["/app/run_benchmark.sh"] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I allow it to add extra arguments. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
wangchen615 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Required environment variables | ||
TARGET=${TARGET:-"http://localhost:8000"} | ||
MODEL=${MODEL:-"neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16"} | ||
RATE_TYPE=${RATE_TYPE:-"sweep"} | ||
DATA=${DATA:-"prompt_tokens=256,output_tokens=128"} | ||
MAX_REQUESTS=${MAX_REQUESTS:-"100"} | ||
MAX_SECONDS=${MAX_SECONDS:-""} | ||
|
||
# Output configuration | ||
OUTPUT_PATH=${OUTPUT_PATH:-"/results/guidellm_benchmark_results"} | ||
OUTPUT_FORMAT=${OUTPUT_FORMAT:-"json"} # Can be json, yaml, or yml | ||
|
||
# Build the command | ||
CMD="guidellm benchmark --target \"${TARGET}\" --model \"${MODEL}\" --rate-type \"${RATE_TYPE}\" --data \"${DATA}\"" | ||
|
||
# Add optional parameters | ||
if [ ! -z "${MAX_REQUESTS}" ]; then | ||
CMD="${CMD} --max-requests ${MAX_REQUESTS}" | ||
fi | ||
|
||
if [ ! -z "${MAX_SECONDS}" ]; then | ||
CMD="${CMD} --max-seconds ${MAX_SECONDS}" | ||
fi | ||
|
||
# Add output path with appropriate extension | ||
if [ ! -z "${OUTPUT_PATH}" ]; then | ||
CMD="${CMD} --output-path \"${OUTPUT_PATH}.${OUTPUT_FORMAT}\"" | ||
fi | ||
|
||
# Execute the command | ||
echo "Running command: ${CMD}" | ||
eval "${CMD}" |
Uh oh!
There was an error while loading. Please reload this page.