[TRTLLM-11517][feat] Add TLLM_PROFILE_LOG_RANKS env var to control per-rank step logging#12263
Conversation
📝 WalkthroughWalkthroughAdded configurable profiling log output control via environment variable Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can use your project's `pylint` configuration to improve the quality of Python code reviews.Add a pylint configuration file to your project to customize how CodeRabbit runs |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tensorrt_llm/_torch/pyexecutor/py_executor.py`:
- Around line 867-869: The CI formatting failure is due to YAPF style issues
around the logging conditional in py_executor.py (the block using start_time,
self.print_log, log_all_ranks, and self.dist.rank in log_ranks). Fix by running
the repository pre-commit hooks or YAPF formatter on
tensorrt_llm/_torch/pyexecutor/py_executor.py (or run `yapf -i` / your
configured formatter) so the conditional and surrounding lines are reformatted
to match project style, then commit the formatted file.
- Around line 843-850: The parsing of PROFILE_LOG_RANKS_ENV_VAR_NAME into
log_ranks (using variables log_ranks_str, log_all_ranks, log_ranks) is brittle
and will throw on empty/malformed tokens; update the parsing to trim whitespace,
filter out empty tokens, and validate each remaining token as an integer
(raising a clear ValueError that includes the env var name and the offending
token(s) if any token is not a valid integer), treat the special "all" case
case-insensitively as before, and ensure inputs like "", "0,", or "0,,2" do not
crash silently but either produce a sanitized set of ranks or a descriptive
error tied to PROFILE_LOG_RANKS_ENV_VAR_NAME.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 985f24c4-fb2c-4959-a165-f6a2c19e48e5
📒 Files selected for processing (1)
tensorrt_llm/_torch/pyexecutor/py_executor.py
|
/bot run |
|
PR_Github #39156 [ run ] triggered by Bot. Commit: |
|
PR_Github #39156 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #39173 [ run ] triggered by Bot. Commit: |
|
PR_Github #39173 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #39238 [ run ] triggered by Bot. Commit: |
|
PR_Github #39238 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
1 similar comment
|
/bot run --disable-fail-fast |
|
PR_Github #39326 [ run ] triggered by Bot. Commit: |
|
PR_Github #39326 [ run ] completed with state
|
…tep logging Allow step logging in profile_step() to print on ranks other than rank 0 for debugging multi-rank issues. The env var TLLM_PROFILE_LOG_RANKS accepts comma-separated rank IDs (e.g. "0,1,3") or "all". Defaults to "0" to preserve existing behavior. Signed-off-by: Jonas Li <6110159+longlee0622@users.noreply.github.com>
8cd1abf to
d424849
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #39366 [ run ] triggered by Bot. Commit: |
|
PR_Github #39366 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #39438 [ run ] triggered by Bot. Commit: |
|
PR_Github #39438 [ run ] completed with state |
…r-rank step logging (NVIDIA#12263) Signed-off-by: Jonas Li <6110159+longlee0622@users.noreply.github.com>
Allow step logging in profile_step() to print on ranks other than rank 0 for debugging multi-rank issues. The env var TLLM_PROFILE_LOG_RANKS accepts comma-separated rank IDs (e.g. "0,1,3") or "all". Defaults to "0" to preserve existing behavior.
Summary by CodeRabbit
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
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.