Skip to content

Comments

[https://nvbugs/5630196] [fix] Prevent flaky failures in C++ test_e2e.py by using local cached datasets for benchmarking#10638

Merged
DomBrown merged 8 commits intoNVIDIA:mainfrom
DomBrown:nvbug/5630196
Jan 15, 2026
Merged

[https://nvbugs/5630196] [fix] Prevent flaky failures in C++ test_e2e.py by using local cached datasets for benchmarking#10638
DomBrown merged 8 commits intoNVIDIA:mainfrom
DomBrown:nvbug/5630196

Conversation

@DomBrown
Copy link
Collaborator

@DomBrown DomBrown commented Jan 13, 2026

Summary by CodeRabbit

  • New Features

    • Local dataset loading from files (JSON, JSONL, CSV, Parquet formats)
    • New --dataset-local-path CLI option for offline and local data sources
    • --dataset-name is now optional when using local paths
    • Offline dataset access capability
  • Bug Fixes

    • Improved error messages with clearer configuration guidance
  • Tests

    • Re-enabled benchmark and model tests

✏️ Tip: You can customize this high-level summary in your review settings.

Description

Tests were failing due to refused connections from HuggingFace. This PR switches the relevant tests to use a locally cached dataset instead.

Test Coverage

tests/integration/defs/cpp/test_e2e.py::test_benchmarks[t5-90]

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

  • 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

/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.

Details

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 the stage-list parameter 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.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip 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-pipeline

Reuse 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.

@DomBrown DomBrown self-assigned this Jan 13, 2026
…st_e2e.py

Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
…dataset name

Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
@DomBrown DomBrown marked this pull request as ready for review January 14, 2026 11:14
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

These changes introduce local dataset loading support alongside existing HuggingFace integration in the prepare_real_data utility, with a new DatasetConfig class providing unified metadata handling. The test integration file adopts a configuration-driven approach for benchmark dataset management with per-dataset metadata.

Changes

Cohort / File(s) Summary
Dataset Loading Enhancement
benchmarks/cpp/utils/prepare_real_data.py
Added local_path field to DatasetConfig (making name optional); new display_name property for error messages. Introduced load_dataset dispatcher function that routes to load_dataset_from_local or load_dataset_from_hf based on config. Implemented local loading supporting directory, JSON, JSONL, CSV, and Parquet formats. New _create_dataset_load_error helper for enhanced error messages. Updated CLI: --dataset-name now optional, --dataset-local-path added. Import changes: added Path and changed datasets to module-level import.
Test Integration Refactor
tests/integration/defs/cpp/test_e2e.py
Added immutable DatasetConfig data class with fields for name, paths, keys, and optional config/prompt metadata. New token_file property and get_dataset_args() method to build CLI arguments. New get_benchmark_dataset_configs() function to load configs from datasets directory. Refactored test logic to iterate over dataset configs instead of hard-coded arguments; replaced static values with per-dataset max_input_len and num_requests. Updated HF_DATASETS_OFFLINE from '0' to '1'. Fixed conditional check: batching_typebatching_types. Removed test skip annotations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.42% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: preventing flaky test failures by switching C++ benchmarks to use local cached datasets instead of HuggingFace.
Description check ✅ Passed The PR description includes all required sections: explanation of the issue (HF connection failures), solution (using local cache), and test coverage. The PR checklist is completed.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
benchmarks/cpp/utils/prepare_real_data.py (1)

1-15: Add NVIDIA copyright header to this file

The file is missing the required NVIDIA copyright header with the year of latest meaningful modification. Add a header at the top:

# SPDX-License-Identifier: Apache-2.0
#
# NVIDIA TensorRT-LLM
# Copyright (c) 2026 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# ...
🤖 Fix all issues with AI agents
In `@benchmarks/cpp/utils/prepare_real_data.py`:
- Around line 253-255: The Click option help strings use unnecessary f-string
prefixes (e.g., in the click.option calls like click.option("--dataset-name",
type=str, help=f"...") and click.option("--dataset-config-name", ...)), causing
ruff F541; replace those help arguments with plain string literals (remove the
leading f) for all Click option help parameters in this file (including the
other occurrences around lines 274-280) so they read help="..." instead of
help=f"...".
- Around line 138-152: The wrapper _create_dataset_load_error currently builds
and returns a new ValueError which loses the original traceback; change it to
raise the new ValueError using exception chaining (raise ValueError(error_msg)
from e) so the original exception context is preserved, and apply the same
change to the other dataset-loading error wrappers in the same file (the similar
blocks around the other dataset-load error handlers) so each re-raised error
uses "from e" to chain the original exception.

In `@tests/integration/defs/cpp/test_e2e.py`:
- Around line 191-196: The subprocess call to _cpp.run_command currently
replaces the entire environment by passing env={'HF_DATASETS_OFFLINE': '1'},
which drops critical variables; change it to merge the current environment with
the override (e.g., base_env = os.environ.copy();
base_env.update({'HF_DATASETS_OFFLINE': '1'})) and pass that merged dict as the
env argument to _cpp.run_command when running prepare_dataset so
PATH/LD_LIBRARY_PATH and other variables are preserved.
🧹 Nitpick comments (1)
tests/integration/defs/cpp/test_e2e.py (1)

15-24: Use int for max_input_len / num_requests to prevent accidental misuse
These are numeric values but stored as strings, which makes later arithmetic/validation easier to get wrong.

Proposed fix
 class DatasetConfig:
@@
-    max_input_len: str
-    num_requests: str
+    max_input_len: int
+    num_requests: int
@@
         DatasetConfig(
@@
-            max_input_len="256",
-            num_requests="50",
+            max_input_len=256,
+            num_requests=50,
         ),
@@
-            max_input_len="20",
-            num_requests="10",
+            max_input_len=20,
+            num_requests=10,
         ),
@@
         prepare_dataset = [
@@
-            str(data_dir / config.token_file), "dataset", "--max-input-len",
-            config.max_input_len, "--num-requests", config.num_requests
+            str(data_dir / config.token_file), "dataset", "--max-input-len",
+            str(config.max_input_len), "--num-requests", str(config.num_requests)
         ]

Also applies to: 63-76, 185-187

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25148d3 and 09bdcc8.

📒 Files selected for processing (2)
  • benchmarks/cpp/utils/prepare_real_data.py
  • tests/integration/defs/cpp/test_e2e.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: The code developed for TensorRT-LLM should conform to Python 3.8+
Indent Python code with 4 spaces. Do not use tabs
Always maintain the namespace when importing Python modules, even if only one class or function from a module is used
Python filenames should use snake_case (e.g., some_file.py)
Python classes should use PascalCase (e.g., class SomeClass)
Python functions and methods should use snake_case (e.g., def my_awesome_function():)
Python local variables should use snake_case, with prefix k for variable names that start with a number (e.g., k_99th_percentile)
Python global variables should use upper snake_case with prefix G (e.g., G_MY_GLOBAL)
Python constants should use upper snake_case (e.g., MY_CONSTANT)
Avoid shadowing variables declared in an outer scope in Python
Initialize all externally visible members of a Python class in the constructor
For Python interfaces that may be used outside a file, prefer docstrings over comments
Use comments in Python for code within a function, or interfaces that are local to a file
Use Google-style docstrings for Python classes and functions, which can be parsed by Sphinx
Python attributes and variables can be documented inline with the format """<type>: Description"""
Avoid using reflection in Python when functionality can be easily achieved without reflection
When using try-except blocks in Python, limit the except clause to the smallest set of errors possible
When using try-except blocks in Python to handle multiple possible variable types (duck-typing), keep the body of the try as small as possible and use the else block for the main logic

Files:

  • tests/integration/defs/cpp/test_e2e.py
  • benchmarks/cpp/utils/prepare_real_data.py
**/*.{cpp,cc,cxx,h,hpp,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

All TensorRT-LLM source files (.cpp, .h, .cu, .py, and other source files) should contain an NVIDIA copyright header with the year of latest meaningful modification

Files:

  • tests/integration/defs/cpp/test_e2e.py
  • benchmarks/cpp/utils/prepare_real_data.py
🧬 Code graph analysis (2)
tests/integration/defs/cpp/test_e2e.py (2)
benchmarks/cpp/utils/prepare_real_data.py (1)
  • DatasetConfig (30-135)
tests/integration/defs/test_e2e.py (1)
  • prepare_dataset (496-518)
benchmarks/cpp/utils/prepare_real_data.py (2)
tensorrt_llm/executor/request.py (1)
  • local_path (81-82)
tests/integration/defs/cpp/test_e2e.py (1)
  • DatasetConfig (13-44)
🪛 Ruff (0.14.11)
benchmarks/cpp/utils/prepare_real_data.py

63-65: Avoid specifying long messages outside the exception class

(TRY003)


67-68: Avoid specifying long messages outside the exception class

(TRY003)


190-190: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


212-213: Avoid specifying long messages outside the exception class

(TRY003)


226-226: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


239-239: Avoid specifying long messages outside the exception class

(TRY003)


246-246: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


254-254: f-string without any placeholders

Remove extraneous f prefix

(F541)


279-279: f-string without any placeholders

Remove extraneous f prefix

(F541)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (2)
tests/integration/defs/cpp/test_e2e.py (1)

223-230: Conditional fix looks correct
if "IFB" in batching_types and "executor" in api_types: matches the intent (list membership) and avoids the previous single-value check pitfall.

benchmarks/cpp/utils/prepare_real_data.py (1)

74-80: The code correctly uses datasets.load_dataset() with local paths and config_name. The HuggingFace Datasets library supports passing config_name as the second positional argument for both HF Hub datasets and local dataset scripts. When query is unpacked as *dataset_config.query, it properly expands to load_dataset(path_or_name, config_name, split=...), which is the documented API pattern.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
@DomBrown DomBrown added the bug Something isn't working label Jan 14, 2026
@DomBrown
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #31972 [ run ] triggered by Bot. Commit: d480513

Copy link
Collaborator

@Funatiq Funatiq left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
@tensorrt-cicd
Copy link
Collaborator

PR_Github #31972 [ run ] completed with state SUCCESS. Commit: d480513
/LLM/main/L0_MergeRequest_PR pipeline #24769 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@DomBrown
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #31982 [ run ] triggered by Bot. Commit: b7c61ea

@DomBrown DomBrown enabled auto-merge (squash) January 14, 2026 15:30
@tensorrt-cicd
Copy link
Collaborator

PR_Github #31982 [ run ] completed with state SUCCESS. Commit: b7c61ea
/LLM/main/L0_MergeRequest_PR pipeline #24776 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@DomBrown
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32001 [ run ] triggered by Bot. Commit: b7c61ea

@DomBrown
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32001 [ run ] completed with state SUCCESS. Commit: b7c61ea
/LLM/main/L0_MergeRequest_PR pipeline #24794 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32011 [ run ] triggered by Bot. Commit: b7c61ea

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32011 [ run ] completed with state SUCCESS. Commit: b7c61ea
/LLM/main/L0_MergeRequest_PR pipeline #24803 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@DomBrown
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32025 [ run ] triggered by Bot. Commit: b7c61ea

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32025 [ run ] completed with state SUCCESS. Commit: b7c61ea
/LLM/main/L0_MergeRequest_PR pipeline #24817 completed with status: 'SUCCESS'

@DomBrown DomBrown merged commit 94c7b69 into NVIDIA:main Jan 15, 2026
5 checks passed
greg-kwasniewski1 pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request Jan 15, 2026
….py by using local cached datasets for benchmarking (NVIDIA#10638)

Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
@DomBrown DomBrown deleted the nvbug/5630196 branch February 3, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants