-
Notifications
You must be signed in to change notification settings - Fork 703
fix: Improve dynamo.connect Error Reporting #1524
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
Conversation
This change adds checking for remote vs. local descriptors for count and size of each. An error is generated from the Python side which contains useful information for developers to self-resolve with.
|
👋 Hi whoisj! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
WalkthroughThe change updates the internal validation logic in the Changes
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
examples/multimodal/connect/__init__.py (3)
211-213: Boolean-comparison trick slightly harms readability
isinstance(local_descriptors, list) != isinstance(remote_descriptors, list)is compact but forces the reader to mentally parse a boolean XOR.
An explicit formulation communicates intent faster:if (isinstance(local_descriptors, list) and not isinstance(remote_descriptors, list)) or \ (isinstance(remote_descriptors, list) and not isinstance(local_descriptors, list)): raise ValueError(...)Not a blocker, but consider the explicit form for long-term maintainability.
214-219: Usezipto avoid redundant indexing & repeatedlen()callsIterating with indices adds noise and performs an unnecessary
len()on every loop:-for i in range(len(local_descriptors)): - if local_descriptors[i].size != remote_descriptors[i].size: - raise ValueError( - f"Descriptor length mismatch: `local_descriptors` and `remote_descriptors` " - f"descriptor at {i} must have the same size. " - f"{local_descriptors[i].size} != {remote_descriptors[i].size}." - ) +for i, (l_desc, r_desc) in enumerate(zip(local_descriptors, remote_descriptors)): + if l_desc.size != r_desc.size: + raise ValueError( + f"Descriptor size mismatch at index {i}: {l_desc.size} != {r_desc.size}." + )Cleaner, slightly faster, and less error-prone.
220-221: Indentation appears deeper than requiredThe
raiseinside theelifblock is indented two levels instead of one.
Although Python doesn’t mind the extra spaces, uneven indentation can trip diff tools and future reviewers.- elif (...) and local_descriptors.size != remote_descriptors.size: - raise ValueError(...) + elif (...) and local_descriptors.size != remote_descriptors.size: + raise ValueError(...)Quick tidy-up keeps the style consistent with the surrounding blocks.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
examples/multimodal/connect/__init__.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and Test - vllm
This change adds checking for remote vs. local descriptors for count and size of each. An error is generated from the Python side which contains useful information for developers to self-resolve with.
DIS-168
Summary by CodeRabbit