[None][fix] Use prefer_pinned() in pard.py#11762
Conversation
Signed-off-by: Mike Iovine <6158008+mikeiovine@users.noreply.github.com>
|
/bot run |
📝 WalkthroughWalkthroughReplaces hard-coded Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tensorrt_llm/_torch/speculative/pard.py (1)
7-7: Use module import to preserve namespace in Python imports.Line 7 imports a function directly; project guidelines require importing the module and calling through its namespace.
Proposed change
-from tensorrt_llm._utils import prefer_pinned +from tensorrt_llm import _utils @@ - num_seqs, dtype=torch.int, device="cpu", pin_memory=prefer_pinned() + num_seqs, dtype=torch.int, device="cpu", pin_memory=_utils.prefer_pinned()As per coding guidelines: "When importing in Python, always maintain the namespace. Import the module, not individual classes or functions."
Also applies to: 39-39
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tensorrt_llm/_torch/speculative/pard.py` at line 7, Replace the direct import of the function with a module import to preserve namespace: change "from tensorrt_llm._utils import prefer_pinned" to import the module (e.g., "import tensorrt_llm._utils as _utils") and update all calls to prefer_pinned to use the module namespace (e.g., _utils.prefer_pinned); apply the same change for the other direct import referenced at line 39 so every usage references tensorrt_llm._utils.<function_name> instead of the bare function name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tensorrt_llm/_torch/speculative/pard.py`:
- Line 7: Replace the direct import of the function with a module import to
preserve namespace: change "from tensorrt_llm._utils import prefer_pinned" to
import the module (e.g., "import tensorrt_llm._utils as _utils") and update all
calls to prefer_pinned to use the module namespace (e.g., _utils.prefer_pinned);
apply the same change for the other direct import referenced at line 39 so every
usage references tensorrt_llm._utils.<function_name> instead of the bare
function name.
|
/bot skip --comment "Pre-commit pipeline is fixed" |
|
PR_Github #36975 [ skip ] triggered by Bot. Commit: |
|
PR_Github #36975 [ skip ] completed with state |
Signed-off-by: Mike Iovine <6158008+mikeiovine@users.noreply.github.com>
Signed-off-by: Mike Iovine <6158008+mikeiovine@users.noreply.github.com>
Description
Use
prefer_pinned()inpard.pyto unblock pre-commit pipeline.Test Coverage
Existing tests.
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.Summary by CodeRabbit