[TRTLLM-12807][test] Guard thop attention kwarg aliases#15335
Conversation
Signed-off-by: Yuxian Qiu <142763828+yuxianq@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR extends the attention backend synchronization test with infrastructure to validate that attribute-derived kwargs match their source leaf attributes. It introduces an allowlist for known exceptions, a helper function to parse getattr expressions, and integrates this into kwarg classification to enable a new validation test. ChangesAttribute kwarg validation
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #54038 [ run ] triggered by Bot. Commit: |
|
PR_Github #54038 [ run ] completed with state |
Summary by CodeRabbit
Description
Adds a static sync-test guard for the
thop.attention(...)call site so kwargs sourced fromself/metadata/forward_argsmust match the source leaf attribute name by default.Existing intentional aliases are listed explicitly in the test allowlist, including:
The test helper also recognizes
getattr(source, "attr", ...)as a source attribute path so the currentspec_decoding_target_max_draft_tokensmapping is checked instead of classified as an arbitrary expression.Test Coverage
pytest -q tests/unittest/_torch/attention_backend/test_attention_op_sync.pypre-commit run --files tests/unittest/_torch/attention_backend/test_attention_op_sync.pypre-commit run --from-ref origin/main --to-ref HEADPR 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)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.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.