Skip to content

Commit b5a0725

Browse files
authored
Merge branch 'main' into docs/add-testing-guide
2 parents e34860f + e0668db commit b5a0725

File tree

284 files changed

+8135
-1050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+8135
-1050
lines changed

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ jobs:
2424

2525
- name: Install dependencies
2626
run: |
27-
make setup-venv
28-
make setup-mkinit
27+
make first-time-setup PYTHON_VERSION=3.10
2928
3029
- uses: pre-commit/action@v3.0.1
3130
env:

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
repos:
4+
- repo: local
5+
hooks:
6+
- id: generate-cli-docs
7+
name: generate-cli-docs
8+
entry: make generate-cli-docs
9+
language: python
10+
types: [python]
11+
pass_filenames: false
12+
args: []
413
- repo: https://github.com/pre-commit/pre-commit-hooks
514
rev: v5.0.0 # Use the latest stable version
615
hooks:

ATTRIBUTIONS-Python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ SOFTWARE.
11991199
- `Issue tracker`: https://github.com/jawah/charset_normalizer/issues
12001200

12011201

1202-
## cyclopts (3.24.0)
1202+
## cyclopts (4.2.3)
12031203

12041204
### Licenses
12051205
License: `Apache-2.0`

ATTRIBUTIONS-container.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This document provides attribution information for third-party software componen
1717
- **Website**: https://ffmpeg.org/
1818
- **License**: LGPL v2.1+
1919
- **Usage**: Video and audio processing library (included in runtime container)
20-
- **Build Configuration**: Built without GPL components (`--disable-gpl --disable-nonfree`)
20+
- **Build Configuration**: Built without GPL components (`--disable-gpl --disable-nonfree --enable-libvpx`)
2121

2222
**License Text:**
2323

@@ -48,6 +48,65 @@ The FFmpeg source code used to build this container is available at:
4848
- Build configuration excludes GPL-licensed components
4949
- Apache 2.0 licensed code in this project remains separate from LGPL components
5050

51+
### libvpx
52+
53+
**Component Information:**
54+
- **Software**: libvpx (VP8/VP9 Codec SDK)
55+
- **Version**: 1.12.0 (from Debian Bookworm)
56+
- **Source**: Debian Bookworm
57+
- **Website**: https://www.webmproject.org/
58+
- **License**: BSD 3-Clause
59+
- **Usage**: VP9 video codec library (included in runtime container, used by FFmpeg)
60+
61+
**License Text:**
62+
63+
> Copyright (c) 2010, The WebM Project authors. All rights reserved.
64+
>
65+
> Redistribution and use in source and binary forms, with or without
66+
> modification, are permitted provided that the following conditions are
67+
> met:
68+
>
69+
> * Redistributions of source code must retain the above copyright
70+
> notice, this list of conditions and the following disclaimer.
71+
>
72+
> * Redistributions in binary form must reproduce the above copyright
73+
> notice, this list of conditions and the following disclaimer in
74+
> the documentation and/or other materials provided with the
75+
> distribution.
76+
>
77+
> * Neither the name of Google, nor the WebM Project, nor the names
78+
> of its contributors may be used to endorse or promote products
79+
> derived from this software without specific prior written
80+
> permission.
81+
>
82+
> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
83+
> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
84+
> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
85+
> A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
86+
> HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
87+
> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
88+
> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
89+
> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
90+
> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
91+
> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
92+
> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
93+
>
94+
> Full license text: https://chromium.googlesource.com/webm/libvpx/+/refs/heads/main/LICENSE
95+
96+
**Source Code Availability:**
97+
98+
The libvpx source code is available at:
99+
- Debian package: https://packages.debian.org/bookworm/libvpx-dev
100+
- Debian source package: `apt-get source libvpx` from Debian Bookworm repositories
101+
- Upstream WebM Project source: https://chromium.googlesource.com/webm/libvpx/
102+
103+
**Compliance Notes:**
104+
105+
- libvpx binary is copied from Debian Bookworm base image
106+
- No modifications were made to libvpx source code
107+
- libvpx is dynamically linked with FFmpeg
108+
- BSD license is compatible with Apache 2.0
109+
51110
### Bash
52111

53112
**Component Information:**
@@ -97,6 +156,12 @@ LGPL is compatible with Apache 2.0 when:
97156
- No modifications were made to FFmpeg source code
98157
- Proper attribution is provided (as above)
99158

159+
### libvpx (BSD 3-Clause)
160+
BSD 3-Clause is compatible with Apache 2.0:
161+
- BSD is a permissive license that allows redistribution with minimal restrictions
162+
- Attribution requirements are satisfied through this document
163+
- No conflict with Apache 2.0 terms
164+
100165
### Bash (GPL v3+)
101166
GPL is compatible with Apache 2.0 when:
102167
- Bash runs as a separate executable and is not linked with Apache 2.0 code

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,18 @@ FROM base AS env-builder
8282

8383
WORKDIR /workspace
8484

85-
# Build ffmpeg from source
85+
# Build ffmpeg from source with libvpx
8686
RUN apt-get update -y && \
8787
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
8888
build-essential \
8989
nasm \
9090
pkg-config \
9191
wget \
9292
yasm \
93+
libvpx-dev \
9394
&& rm -rf /var/lib/apt/lists/*
9495

95-
# Download and build ffmpeg
96+
# Download and build ffmpeg with libvpx (VP9 codec)
9697
RUN wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz \
9798
&& tar -xf ffmpeg-7.1.tar.xz \
9899
&& cd ffmpeg-7.1 \
@@ -102,6 +103,7 @@ RUN wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz \
102103
--disable-nonfree \
103104
--enable-shared \
104105
--disable-static \
106+
--enable-libvpx \
105107
--disable-doc \
106108
--disable-htmlpages \
107109
--disable-manpages \
@@ -110,7 +112,9 @@ RUN wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz \
110112
&& make -j$(nproc) \
111113
&& make install \
112114
&& cd .. \
113-
&& rm -rf ffmpeg-7.1 ffmpeg-7.1.tar.xz
115+
&& rm -rf ffmpeg-7.1 ffmpeg-7.1.tar.xz \
116+
&& cp -P /usr/lib/*/libvpx.so* /opt/ffmpeg/lib/ 2>/dev/null || \
117+
cp -P /usr/lib/libvpx.so* /opt/ffmpeg/lib/ 2>/dev/null || { echo "Error: libvpx.so not found"; exit 1; }
114118

115119
# Create directories for the nvs user (UID 1000 in NVIDIA distroless)
116120
RUN mkdir -p /app /app/artifacts /app/.cache \
@@ -137,7 +141,7 @@ COPY LICENSE ATTRIBUTIONS*.md /legal/
137141
# Copy bash with executable permissions preserved using --chmod
138142
COPY --from=env-builder --chown=1000:1000 --chmod=755 /bin/bash /bin/bash
139143

140-
# Copy ffmpeg binaries and libraries
144+
# Copy ffmpeg binaries and libraries (includes libvpx)
141145
COPY --from=env-builder --chown=1000:1000 /opt/ffmpeg /opt/ffmpeg
142146
ENV PATH="/opt/ffmpeg/bin:${PATH}" \
143147
LD_LIBRARY_PATH="/opt/ffmpeg/lib:${LD_LIBRARY_PATH}"
@@ -154,4 +158,4 @@ ENV VIRTUAL_ENV=/opt/aiperf/venv \
154158
PATH="/opt/aiperf/venv/bin:${PATH}"
155159

156160
# Set bash as entrypoint
157-
ENTRYPOINT ["/bin/bash", "-c"]
161+
ENTRYPOINT ["/bin/bash", "-c"]

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
.PHONY: ruff lint ruff-fix lint-fix format fmt check-format check-fmt \
1919
test coverage clean install install-app docker docker-run first-time-setup \
20-
test-verbose init-files setup-venv setup-mkinit install-mock-server \
20+
test-verbose init-files setup-venv install-mock-server \
2121
integration-tests integration-tests-ci integration-tests-verbose integration-tests-ci-macos \
2222
test-integration test-integration-ci test-integration-verbose test-integration-ci-macos \
23-
test-stress stress-tests internal-help help
23+
generate-cli-docs test-stress stress-tests internal-help help
2424

2525

2626
# Include user-defined environment variables
@@ -37,9 +37,9 @@ PYTHON_VERSION ?= 3.12
3737
# The command to activate the virtual environment
3838
activate_venv = . $(VENV_PATH)/bin/activate
3939

40-
# Try and get the app name and version from uv
41-
APP_NAME := $(shell $(activate_venv) 2>/dev/null && uv version 2>/dev/null | cut -d ' ' -f 1)
42-
APP_VERSION := $(shell $(activate_venv) 2>/dev/null && uv version 2>/dev/null | cut -d ' ' -f 2)
40+
# Try and get the app name and version from pyproject.toml
41+
APP_NAME := $(shell grep '^name = ' pyproject.toml 2>/dev/null | sed 's/name = "\(.*\)"/\1/')
42+
APP_VERSION := $(shell grep '^version = ' pyproject.toml 2>/dev/null | sed 's/version = "\(.*\)"/\1/')
4343

4444
# The folder where uv is installed
4545
UV_PATH ?= $(HOME)/.local/bin
@@ -108,13 +108,13 @@ check-format check-fmt: #? check the formatting of the project using ruff.
108108
$(activate_venv) && ruff format . --check $(args)
109109

110110
test: #? run the tests using pytest-xdist.
111-
$(activate_venv) && pytest -n auto -m 'not integration and not performance' $(args)
111+
$(activate_venv) && pytest tests/unit -n auto -m 'not integration and not performance' $(args)
112112

113113
test-verbose: #? run the tests using pytest-xdist with DEBUG logging.
114-
$(activate_venv) && pytest -n auto -v -s --log-cli-level=DEBUG -m 'not integration and not performance'
114+
$(activate_venv) && pytest tests/unit -n auto -v -s --log-cli-level=DEBUG -m 'not integration and not performance'
115115

116116
coverage: #? run the tests and generate an html coverage report.
117-
$(activate_venv) && pytest -n auto --cov=src/aiperf --cov-branch --cov-report=html --cov-report=xml --cov-report=term -m 'not integration and not performance' $(args)
117+
$(activate_venv) && pytest tests/unit -n auto --cov=src/aiperf --cov-branch --cov-report=html --cov-report=xml --cov-report=term -m 'not integration and not performance' $(args)
118118

119119
install: install-app install-mock-server #? install the project and mock server in editable mode.
120120

@@ -160,9 +160,6 @@ setup-venv: #? create the virtual environment.
160160
printf "$(bold)$(green)Virtual environment already exists$(reset)\n"; \
161161
fi
162162

163-
setup-mkinit: #? install the mkinit and ruff packages for pre-commit.
164-
$(activate_venv) && uv pip install mkinit ruff
165-
166163
first-time-setup: #? convenience command to setup the environment for the first time
167164
$(MAKE) setup-venv --no-print-directory
168165

@@ -206,3 +203,6 @@ integration-tests-verbose test-integration-verbose: #? run integration tests wit
206203
@printf "$(yellow)Note: Sequential mode shows real-time AIPerf output$(reset)\n"
207204
$(activate_venv) && pytest tests/integration/ -m 'integration and not stress and not performance' -vv -s --tb=short --log-cli-level=INFO --capture=no $(args)
208205
@printf "$(bold)$(green)AIPerf Mock Server integration tests passed!$(reset)\n"
206+
207+
generate-cli-docs: #? generate the CLI documentation.
208+
$(activate_venv) && tools/generate_cli_docs.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Features
6161
| **[Request Rate with Max Concurrency](docs/tutorials/request-rate-concurrency.md)** | Dual control of request timing and concurrent connection ceiling (Poisson or constant modes) | Testing API rate/concurrency limits, avoiding thundering herd, realistic client simulation |
6262
| **[GPU Telemetry](docs/tutorials/gpu-telemetry.md)** | Real-time GPU metrics collection via DCGM (power, utilization, memory, temperature, etc) | Performance optimization, resource monitoring, multi-node telemetry |
6363
| **[Template Endpoint](docs/tutorials/template-endpoint.md)** | Benchmark custom APIs with flexible Jinja2 request templates | Custom API formats, rapid prototyping, non-standard endpoints |
64+
| **[SGLang Image Generation](docs/tutorials/sglang-image-generation.md)** | Benchmark image generation APIs using SGLang with FLUX.1-dev model | Image generation testing, text-to-image benchmarking, extracting generated images |
6465

6566
### Working with Benchmark Data
6667
- **[Profile Exports](docs/tutorials/working-with-profile-exports.md)** - Parse and analyze `profile_export.jsonl` with Pydantic models, custom metrics, and async processing

0 commit comments

Comments
 (0)