-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[TRTLLM-8679][feat] Scenario UX bulk refactor #8925
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
Draft
venkywonka
wants to merge
9
commits into
NVIDIA:main
Choose a base branch
from
venkywonka:venky/scenario-ux-bulk-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[TRTLLM-8679][feat] Scenario UX bulk refactor #8925
venkywonka
wants to merge
9
commits into
NVIDIA:main
from
venkywonka:venky/scenario-ux-bulk-refactor
+1,793
−5
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ested) Enables generating optimized TensorRT-LLM configurations from scenario constraints using profile-based logic. Supports dsr1-fp4, dsr1-fp8, and gptoss-fp4 profiles with validated example recipes. Note: This implementation has not been tested yet. Signed-off-by: Venky Ganesh <[email protected]>
Signed-off-by: Venky Ganesh <[email protected]>
- Simplify configure.py by removing redundant recipe loading logic - Fix recipe database initialization in db/__init__.py - Update matcher and profiles for improved recipe handling - Integrate recipe system with performance test infrastructure Signed-off-by: Venky Ganesh <[email protected]>
The README documented a non-existent --recipe flag and used outdated examples showing config.yaml output. Updated to reflect actual CLI behavior: trtllm-configure generates recipe files (scenario + env + config) from scenario parameters only, not from existing recipes. Signed-off-by: Venky Ganesh <[email protected]>
…trtllm-configure This commit enforces a standardized recipe schema and simplifies trtllm-configure to perform exact matching only, removing dynamic recipe generation. Schema Changes: - Rename 'config' → 'llm_api_config' in all recipe YAML files - Update recipe detection in trtllm-serve and trtllm-bench to use 'llm_api_config' - Update README examples to use new key name trtllm-configure Simplification: - Remove dynamic recipe generation using profiles - Implement exact matching only against tensorrt_llm/recipes/db/ - Add find_all_matching_recipes() to detect multiple matches - Return clear errors for no match or ambiguous (multiple) matches - Remove --profile CLI option (no longer needed) - Update help text and examples to reflect exact matching behavior Validation Changes: - Remove validate_llm_api_config() calls from configure/serve/bench - Comment out validation function pending PR NVIDIA#8331 - PR NVIDIA#8331 standardizes LlmArgs with Pydantic, after which validation will happen automatically when LlmArgs(**kwargs) is instantiated - Add TODO comments referencing PR NVIDIA#8331 Documentation Updates: - Remove "Profiles" section from README (no longer auto-generated) - Remove "Adding Custom Profiles" section - Update "Quick Start" to reflect exact matching behavior - Clarify that trtllm-configure retrieves (not generates) recipes Signed-off-by: Venky Ganesh <[email protected]>
This commit enables trtllm-bench to parse and apply recipe YAML files
that contain scenario parameters, environment variables, and LLM API
configuration in a unified format.
Key changes:
- Add scenario.py utility to extract and merge scenario parameters
- Modify throughput.py to detect recipe format and create temp YAML
with only llm_api_config section to pass to LLM constructor
- Fix dataset field name from output_len to output_tokens in scenario.py
- Add tinyllama-simple.yaml test recipe demonstrating recipe usage
Recipe format structure:
- scenario: test parameters (ISL/OSL/concurrency/num_requests)
- env: environment variables to set
- llm_api_config: LLM constructor arguments (KV cache, CUDA graphs, etc)
With this change, users can now run:
trtllm-bench --model <model> throughput \
--extra_llm_api_options <recipe.yaml>
Instead of specifying multiple CLI flags for ISL/OSL/concurrency/etc.
The recipe format simplifies configuration and enables reusable test
configurations.
Signed-off-by: Venky Ganesh <[email protected]>
…cation Add recipe system support to low_latency benchmark command and extract common llm_api_config processing logic to reduce code duplication. Changes: - Add prepare_llm_api_config_for_recipe() utility to scenario.py that extracts llm_api_config section from recipe YAML and creates temp file - Update low_latency.py to use shared utility for recipe processing - Refactor throughput.py to use shared utility instead of inline tempfile logic - Eliminates ~30 lines of duplicated code between benchmark files Both throughput and latency commands now support recipe format with auto-generated datasets and unified behavior. Signed-off-by: Venky Ganesh <[email protected]>
- Updated `merge_params_with_priority` function to reflect new parameter names in examples. - Modified `generate_bench_command` to include model name and provide detailed command templates for throughput, latency, and build benchmarks. - Renamed validation exceptions for clarity, changing `ValidationError` to `ScenarioValidationError` and `ValidationWarning` to `ScenarioValidationWarning`. - Added a new TinyLlama test recipe for streamlined testing and dataset generation. - Removed outdated recipe files for DeepSeek and GPT-OSS to clean up the repository. These changes enhance usability and maintainability of the benchmarking and recipe systems. Signed-off-by: Venky Ganesh <[email protected]>
…commands Added process_recipe_scenario() helper in scenario.py to eliminate code duplication between throughput.py and low_latency.py. This consolidates recipe scenario extraction, parameter merging, and dataset auto-generation into a single reusable function. Changes: - Added process_recipe_scenario() to tensorrt_llm/bench/utils/scenario.py - Refactored throughput.py to use new helper (40 lines -> 15 lines) - Refactored low_latency.py to use new helper (40 lines -> 15 lines) - Eliminated ~80 lines of duplicated code - Maintained 100% backward compatibility Tested with e2e recipe perf tests - all passing. Signed-off-by: Venky Ganesh <[email protected]>
venkywonka
commented
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outdated code. will need refactor.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@coderabbitai summary
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)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
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
/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...Provide a user friendly way for developers to interact with a Jenkins server.
Run
/bot [-h|--help]to print this help message.See details below for each supported subcommand.
run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]Launch build/test pipelines. All previously running jobs will be killed.
--reuse-test (optional)pipeline-id(OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.--disable-reuse-test(OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.--disable-fail-fast(OPTIONAL) : Disable fail fast on build/tests/infra failures.--skip-test(OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.--stage-list "A10-PyTorch-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.--gpu-type "A30, H100_PCIe"(OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.--test-backend "pytorch, cpp"(OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.--only-multi-gpu-test(OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.--add-multi-gpu-test(OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.--post-merge(OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".--detailed-log(OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.--debug(OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in thestage-listparameter to access the appropriate container environment. Note: Does NOT update GitHub check status.For guidance on mapping tests to stage names, see
docs/source/reference/ci-overview.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip testing for latest commit on pull request.
--comment "Reason for skipping build/test"is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.reuse-pipeline
reuse-pipelineReuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.