Skip to content

fix(config): restore profile image source CLI flag#975

Merged
ajcasagrande merged 5 commits into
mainfrom
ajc/fix-image-source-cli
May 22, 2026
Merged

fix(config): restore profile image source CLI flag#975
ajcasagrande merged 5 commits into
mainfrom
ajc/fix-image-source-cli

Conversation

@ajcasagrande

@ajcasagrande ajcasagrande commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restore --image-source to the flat profile CLI config schema with the current default-noise behavior.
  • Route CLI image source values into benchmark.dataset.images.source and include them in input field tracking.
  • Regenerate CLI docs and add regression coverage for noise and custom directory sources.

Test plan

  • uv run pytest -n auto tests/unit/config/test_cli_image_source.py
  • uv run ruff format src/aiperf/config/flags/cli_config.py src/aiperf/config/flags/_converter_dataset.py src/aiperf/config/flags/_section_fields.py tests/unit/config/test_cli_image_source.py && uv run ruff check --fix src/aiperf/config/flags/cli_config.py src/aiperf/config/flags/_converter_dataset.py src/aiperf/config/flags/_section_fields.py tests/unit/config/test_cli_image_source.py
  • uv run pytest -n auto tests/unit/

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added --image-source CLI option to configure how images are sourced during benchmarking: on-the-fly noise generation, built-in assets, or a custom directory. Defaults to noise.
  • Tests

    • Added unit tests to verify image source configuration propagates correctly through CLI config processing.

Review Change Stack

Restore the flat CLIConfig wiring for --image-source so multimodal profile runs can select noise, bundled assets, or a custom image directory again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Anthony Casagrande <acasagrande@nvidia.com>
@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown

Try out this PR

Quick install:

pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@dfbd4d2c295bc4381cd09ad3122d8f4f4ce6beb9

Recommended with virtual environment (using uv):

uv venv --python 3.12 && source .venv/bin/activate
uv pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@dfbd4d2c295bc4381cd09ad3122d8f4f4ce6beb9

Last updated for commit: dfbd4d2Browse code

@github-actions github-actions Bot added the fix label May 21, 2026
@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@ajcasagrande has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 20 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6dcc7855-2b76-4e7d-b867-6ed06201900c

📥 Commits

Reviewing files that changed from the base of the PR and between 4b6b397 and dfbd4d2.

📒 Files selected for processing (4)
  • src/aiperf/config/flags/_converter_dataset.py
  • tests/component_integration/timing/test_invariants.py
  • tests/unit/config/test_cli_image_source.py
  • tests/unit/config/test_loader_adversarial.py

Walkthrough

This PR introduces a new --image-source CLI option that allows users to specify how generated images are sourced: from on-the-fly noise, built-in assets, or a custom directory. The option is defined in CLIConfig, registered in field classification, wired through config-to-dataset conversion, documented, and tested.

Changes

Image Source CLI Option

Layer / File(s) Summary
CLI flag definition and import
src/aiperf/config/flags/cli_config.py
CLIConfig imports ImageSource and adds a new image_source field (ImageSource | Path, default ImageSource.NOISE) wired to the --image-source CLI parameter under the IMAGE_INPUT group.
Input field registration
src/aiperf/config/flags/_section_fields.py
INPUT_FIELDS constant extended to include "image_source" so CLI config resolvers recognize it as an input-section field.
Config-to-dataset conversion
src/aiperf/config/flags/_converter_dataset.py
_build_images propagates image_source into the dataset images dict as source, and _apply_implicit_media_batch includes image_source in image triggers to set batch_size default to 1 when unspecified.
CLI option documentation
docs/cli-options.md
Two "Image Input" sections (lines 622–626 and 1941–1945) document --image-source, its supported modes (noise, built-in assets, user directory), and default value.
Validation tests
tests/unit/config/test_cli_image_source.py
Test helper and two test functions verify image_source propagates correctly through dataset building and AIPerf config conversion for both "noise" and directory Path inputs.

🎯 2 (Simple) | ⏱️ ~10 minutes


🐰 A new source blooms with grace,
Images gather from their place,
Noise or paths, the user's choice,
Config speaks with rabbity voice!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(config): restore profile image source CLI flag' directly and clearly summarizes the main change: restoring the image source CLI flag to the config system. It is concise, specific, and accurately reflects the primary purpose of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread src/aiperf/config/flags/_converter_dataset.py
@ajcasagrande ajcasagrande added the qa-bugfix Important fix for QA bugs for release label May 21, 2026
ajcasagrande and others added 4 commits May 21, 2026 21:38
Reject --image-source alongside --input-file so synthetic image generation options cannot be silently ignored on file-backed datasets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Anthony Casagrande <acasagrande@nvidia.com>
Keep adversarial YAML nesting above AIPerf's depth guard without forcing PyYAML into interpreter recursion warnings, and make the rate-limiting invariant assert overshoot instead of CI runner throughput.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Anthony Casagrande <acasagrande@nvidia.com>
@ajcasagrande ajcasagrande merged commit c364765 into main May 22, 2026
31 checks passed
@ajcasagrande ajcasagrande deleted the ajc/fix-image-source-cli branch May 22, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix qa-bugfix Important fix for QA bugs for release

3 participants