feat: add multiple _core*.so detection in sanity_check.py#3803
Conversation
WalkthroughA path constant centralizing the runtime directory reference was introduced, an internal helper method for detecting multiple core shared objects was added to DynamoRuntimeInfo, and this detection is now invoked during initialization to surface warnings about conflicting files in the runtime source directory. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
deploy/sanity_check.py (1)
1817-1856: Good implementation with clear documentation. Consider logging exceptions.The method correctly detects multiple
_core*.sofiles and provides helpful context. The comprehensive docstring explains why this is problematic.Minor improvement: The
try-except-passblock at line 1853 silently swallows exceptions, which could hide unexpected errors. While acceptable in a diagnostic tool, consider adding basic logging or at least a comment explaining why exceptions are ignored.Based on static analysis hints.
Example enhancement:
try: # Find all _core*.so files so_files = glob.glob(os.path.join(core_dir, "_core*.so")) if len(so_files) > 1: # Multiple .so files found - create warning so_file_names = [os.path.basename(f) for f in so_files] warning_desc = ( f"Found {len(so_files)} files: {', '.join(so_file_names)}" ) return NodeInfo( label="Multiple _core*.so files detected", desc=warning_desc, status=NodeStatus.WARNING, ) except Exception: - pass + # Silently ignore errors during .so detection as this is non-critical diagnostic info + pass
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
deploy/sanity_check.py(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
deploy/sanity_check.py (1)
deploy/dynamo_check.py (3)
add_child(140-143)NodeInfo(123-279)NodeStatus(111-119)
🪛 Ruff (0.14.1)
deploy/sanity_check.py
1853-1854: try-except-pass detected, consider logging the exception
(S110)
1853-1853: Do not catch blind exception: Exception
(BLE001)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: trtllm (amd64)
- GitHub Check: trtllm (arm64)
- GitHub Check: sglang
- GitHub Check: operator (amd64)
- GitHub Check: vllm (amd64)
- GitHub Check: Build and Test - dynamo
🔇 Additional comments (4)
deploy/sanity_check.py (4)
99-100: LGTM! Good refactoring to centralize the path constant.This improves maintainability by having a single source of truth for the runtime source path.
1751-1754: LGTM! Clean integration of the multiple .so file check.The conditional logic correctly adds the warning node only when multiple files are detected.
1834-1834: LGTM! Consistent use of the new path constant.
1866-1874: LGTM! Path constant properly utilized and documented.The comment at line 1866 correctly references the constant name, and line 1874 uses it consistently with the refactoring.
|
sglang check failing here: https://github.com/ai-dynamo/dynamo/actions/runs/18704711963/job/53340577769?pr=3803 should be fixed by this pr here: #3779 Hitting the "Update Branch" button to include the fix and retrigger the jobs |
Detect and warn when multiple _core*.so files exist in lib/bindings/python/src/dynamo. Multiple .so files are problematic because Python's import system may load the wrong binary module, causing confusing import errors. This typically occurs when switching between maturin build modes or Python versions. Also refactor hardcoded path into DYNAMO_RUNTIME_SRC_PATH constant for maintainability. Signed-off-by: Keiven Chang <keivenchang@users.noreply.github.com>
Enhanced sanity_check.py to provide specific guidance when multiple _core*.so files are detected, explaining the problem and suggesting solutions: remove old *.so files and/or rebuild via maturin develop. Signed-off-by: Keiven Chang <keivenchang@users.noreply.github.com>
4347239 to
581bb63
Compare
…3803) Signed-off-by: Keiven Chang <keivenchang@users.noreply.github.com>
Overview:
Adds detection and warning for multiple _core*.so files in sanity_check.py. Multiple .so files cause Python's import system to load the wrong binary module, leading to confusing import errors when switching between maturin build modes or Python versions.
Details:
_check_multiple_core_so()method to detect multiple _core*.so files in lib/bindings/python/src/dynamoDYNAMO_RUNTIME_SRC_PATHconstantWhere should the reviewer start?
deploy/sanity_check.py - focus on the new
_check_multiple_core_so()method (lines ~1818-1855) and how it integrates into the Runtime components sectionRelated Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
/coderabbit profile chill
Summary by CodeRabbit