-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Draft - DO NOT REVIEW - feat(autodeploy): Add TRT-LLM attention backend with CUDA graph support #11283
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
Open
MrGeva
wants to merge
3
commits into
NVIDIA:main
Choose a base branch
from
nv-auto-deploy:eg/trtllm_attn_v2_squashed
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.
+1,965
−141
Open
Draft - DO NOT REVIEW - feat(autodeploy): Add TRT-LLM attention backend with CUDA graph support #11283
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🌐 Web query:
Pydantic v2 field validator assert vs ValueError validation error handling💡 Result:
In Pydantic v2 field validators (
@field_validator/BeforeValidator/AfterValidator), you should signal “this input is invalid” by raisingValueErrororAssertionError(including viaassert ...). Pydantic catches those and aggregates them into a singleValidationError. You generally should not raiseValidationErroryourself inside validation code. [1][2]assert/AssertionErrorassertion_error). [1][3]assertstatements are skipped when Python runs with-O(optimize), meaning your validator checks can silently stop running. [4][1]ValueError-O). [1][2]value_error) that’s collected into the finalValidationError. [1][2]What not to do (common gotcha)
TypeError,IndexError, etc.), they are not treated as validation errors and can bubble up directly rather than being wrapped into aValidationError. [5]When you need richer error codes/messages
pydantic_core.PydanticCustomErrorfor structured/custom error types and templated messages. [1]Practical rule: use
ValueErrorfor user/data validation, reserveassertfor developer invariants/tests (or only when you’re sure-Owon’t be used). [4][2]Sources: [1] https://docs.pydantic.dev/latest/concepts/validators/ , [2] https://docs.pydantic.dev/latest/errors/errors/ , [3] https://docs.pydantic.dev/2.0/usage/validation_errors/ , [4] https://docs.pydantic.dev/2.5/concepts/validators/ , [5] https://docs.pydantic.dev/2.3/usage/validators/
🏁 Script executed:
Repository: NVIDIA/TensorRT-LLM
Length of output: 135
🏁 Script executed:
Repository: NVIDIA/TensorRT-LLM
Length of output: 2134
🏁 Script executed:
Repository: NVIDIA/TensorRT-LLM
Length of output: 453
🏁 Script executed:
Repository: NVIDIA/TensorRT-LLM
Length of output: 1739
🏁 Script executed:
# Check for the presence of copyright header in the file head -20 ./tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.pyRepository: NVIDIA/TensorRT-LLM
Length of output: 1066
Use
ValueErrorinstead ofassertfor dtype validation in Pydantic field validator.assertstatements are optimized away when Python runs with the-Oflag, causing the validation check to silently skip. Pydantic v2 field validators should raiseValueError(orAssertionErrordirectly, butValueErroris preferred) to ensure invalid inputs are always rejected.Suggested change
🤖 Prompt for AI Agents