Skip to content

[TRTLLM-13446][test] Add FLUX infer() num_images_per_prompt forwardin…#15745

Merged
yingguo-trt merged 1 commit into
NVIDIA:mainfrom
yingguo-trt:yiguo/TRTLLM-13446-flux2-infer-coverage
Jul 3, 2026
Merged

[TRTLLM-13446][test] Add FLUX infer() num_images_per_prompt forwardin…#15745
yingguo-trt merged 1 commit into
NVIDIA:mainfrom
yingguo-trt:yiguo/TRTLLM-13446-flux2-infer-coverage

Conversation

@yingguo-trt

@yingguo-trt yingguo-trt commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

…g test

The existing GPU tests call forward() directly, so a regression where infer() drops num_images_per_prompt (the original TRTLLM-12870 failure mode) would still pass. Add a CPU-only stubbed test that asserts infer() forwards the parameter to forward(), parametrized over FluxPipeline and Flux2Pipeline. Register in l0_a10.

Summary by CodeRabbit

  • Tests
    • Added coverage for image-generation request handling across multiple pipeline variants.
    • Verified that inference returns the pipeline’s direct output and correctly passes through the number of images requested per prompt.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@yingguo-trt yingguo-trt requested a review from a team as a code owner June 30, 2026 01:44
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A new unit test file tests/unittest/_torch/visual_gen/test_flux_infer.py is added, containing a parametrized test for FluxPipeline and Flux2Pipeline that verifies infer returns the forward mock value and passes num_images_per_prompt as a keyword argument. The test is registered in tests/integration/test_lists/test-db/l0_a10.yml.

Changes

FLUX Pipeline Infer Unit Test

Layer / File(s) Summary
FluxPipeline infer test and CI registration
tests/unittest/_torch/visual_gen/test_flux_infer.py, tests/integration/test_lists/test-db/l0_a10.yml
Adds parametrized test asserting infer returns forward's value and forwards num_images_per_prompt; registers the test in the l0_a10 CI list.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the fix, but the required Test Coverage and PR Checklist sections are left unfilled. Add a Test Coverage section and complete the PR Checklist with the required confirmations before merging.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change and includes a valid ticket prefix, with the truncation still leaving the FLUX infer() test intent clear.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/unittest/_torch/visual_gen/test_flux_infer.py`:
- Around line 1-2: The new test file currently has only the SPDX header, but new
Python source files must include the repository-mandated NVIDIA copyright block.
Update the header in the test file to use the standard NVIDIA source copyright
header required for all new .py files, keeping the SPDX license line if needed,
and ensure the file begins with the full NVIDIA copyright notice used elsewhere
in the repo.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 56f02e74-ea75-406d-a28b-b06415d5c97c

📥 Commits

Reviewing files that changed from the base of the PR and between a9f5fc7 and fdc2006.

📒 Files selected for processing (2)
  • tests/integration/test_lists/test-db/l0_a10.yml
  • tests/unittest/_torch/visual_gen/test_flux_infer.py

Comment thread tests/unittest/_torch/visual_gen/test_flux_infer.py
@yingguo-trt

Copy link
Copy Markdown
Collaborator Author

/bot run

2 similar comments
@yingguo-trt

Copy link
Copy Markdown
Collaborator Author

/bot run

@yingguo-trt

Copy link
Copy Markdown
Collaborator Author

/bot run

…g test

The existing GPU tests call forward() directly, so a regression where infer()
drops num_images_per_prompt (the original TRTLLM-12870 failure mode) would still
pass. Add a CPU-only stubbed test that asserts infer() forwards the parameter to
forward(), parametrized over FluxPipeline and Flux2Pipeline. Register in l0_a10.

Signed-off-by: Ying Guo <244492186+yingguo-trt@users.noreply.github.com>
@yingguo-trt yingguo-trt force-pushed the yiguo/TRTLLM-13446-flux2-infer-coverage branch from fdc2006 to 379fed7 Compare July 2, 2026 02:22
@yingguo-trt yingguo-trt enabled auto-merge (squash) July 2, 2026 09:57
@yingguo-trt

Copy link
Copy Markdown
Collaborator Author

/bot run

@yingguo-trt

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57376 [ run ] triggered by Bot. Commit: 379fed7 Link to invocation

@yingguo-trt

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57379 [ run ] triggered by Bot. Commit: 379fed7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57376 [ run ] completed with state ABORTED. Commit: 379fed7

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57379 [ run ] completed with state SUCCESS. Commit: 379fed7
/LLM/main/L0_MergeRequest_PR pipeline #46128 completed with status: 'SUCCESS'

CI Report

Link to invocation

@yingguo-trt yingguo-trt merged commit 8fc918b into NVIDIA:main Jul 3, 2026
8 checks passed
BrianLi23 pushed a commit to BrianLi23/TensorRT-LLM that referenced this pull request Jul 9, 2026
NVIDIA#15745)

Signed-off-by: Ying Guo <244492186+yingguo-trt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants