vLLM 프레임워크를 기반으로 GPU 성능을 측정하고 결과를 Teams, Slack 등으로 전송할 수 있는 파이썬 도구입니다.
- 벤치마크 모듈: vLLM을 통한 GPU 성능 측정
- 리포트 모듈: Teams, Slack, 이메일을 통한 결과 전송 (전략 패턴 활용)
- 데이터 저장: pandas DataFrame, Excel, CSV 형태로 결과 저장
- CLI 인터페이스: 명령행에서 쉽게 사용 가능
- 설정 파일 지원: JSON/YAML 설정 파일로 복잡한 테스트 구성
# 저장소 클론
git clone <repository-url>
cd vllm-benchmark-tools
# 패키지 설치
pip install -e .
# 또는 uv 사용
uv syncpython -m vllm_benchmark.cli --model meta-llama/Llama-2-7b-hf --verbosepython -m vllm_benchmark.cli \
--model meta-llama/Llama-2-7b-hf \
--teams-webhook https://your-teams-webhook-url \
--verbosepython -m vllm_benchmark.cli --config config.jsonfrom vllm_benchmark import (
BenchmarkRunner, BenchmarkConfig, ModelConfig, TestConfig,
ReportManager, ReportConfig, TeamsConfig
)
# 모델 설정
models = [
ModelConfig(
name="meta-llama/Llama-2-7b-hf",
tensor_parallel_size=1
)
]
# 테스트 설정
test_config = TestConfig(
input_token_lengths=[1, 128, 512],
output_token_lengths=[128, 256, 512],
batch_sizes=[1, 16, 64, 128],
warmup_iterations=3,
test_iterations=5,
)
# 벤치마크 설정
benchmark_config = BenchmarkConfig(
models=models,
test_config=test_config,
output_dir="./benchmark_results",
verbose=True,
)
# 벤치마크 실행
runner = BenchmarkRunner(benchmark_config)
result = runner.run_benchmark()
# Teams 리포트 전송
teams_config = TeamsConfig(
webhook_url="https://your-teams-webhook-url",
title="vLLM 벤치마크 결과"
)
report_config = ReportConfig(
enabled_notifiers=["teams"],
teams=teams_config
)
report_manager = ReportManager(report_config)
report_manager.send_report(result)python -m vllm_benchmark.cli --help주요 옵션:
--model: 테스트할 모델 이름들--tensor-parallel-size: 텐서 병렬 크기--input-tokens: 입력 토큰 길이들--output-tokens: 출력 토큰 길이들--batch-sizes: 배치 크기들--teams-webhook: Teams 웹훅 URL--slack-webhook: Slack 웹훅 URL--email-*: 이메일 설정 옵션들
{
"models": [
{
"name": "meta-llama/Llama-2-7b-hf",
"tensor_parallel_size": 1,
"gpu_memory_utilization": 0.9
}
],
"test_config": {
"input_token_lengths": [1, 128, 512],
"output_token_lengths": [128, 256, 512],
"batch_sizes": [1, 16, 64, 128],
"warmup_iterations": 3,
"test_iterations": 5
},
"report_config": {
"enabled_notifiers": ["teams"],
"teams": {
"webhook_url": "https://your-teams-webhook-url",
"title": "vLLM 벤치마크 결과"
}
}
}- Teams 채널에서 웹훅 URL 생성
- CLI에서
--teams-webhook옵션 사용 - 또는 설정 파일에서
teams.webhook_url설정
- Slack 앱에서 웹훅 URL 생성
- CLI에서
--slack-webhook옵션 사용 - 또는 설정 파일에서
slack.webhook_url설정
- SMTP 서버 정보 설정
- CLI에서
--email-*옵션들 사용 - 또는 설정 파일에서
email섹션 설정
벤치마크 결과는 다음 형태로 저장됩니다:
- Excel:
benchmark_results_YYYYMMDD_HHMMSS.xlsx - CSV:
benchmark_results_YYYYMMDD_HHMMSS.csv - 리포트:
benchmark_report_YYYYMMDD_HHMMSS.md/html/txt
examples/ 디렉토리에서 다양한 사용 예제를 확인할 수 있습니다:
basic_usage.py: 기본 사용법config_examples.py: 설정 파일 예제들