-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
[NIXL] make nixl_connector compatible with old nixl version for non-cuda platform #25911
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
[NIXL] make nixl_connector compatible with old nixl version for non-cuda platform #25911
Conversation
Signed-off-by: Chendi Xue <Chendi.Xue@intel.com>
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.
Code Review
This pull request aims to add backward compatibility for older versions of the nixl package by conditionally adding the num_threads argument. However, the implementation has a critical flaw in how it compares version strings, which can lead to incorrect behavior. My review provides a fix for this version comparison logic.
| ucx_args = { | ||
| 'num_threads': 8, | ||
| } if get_nixl_version() >= '0.5.1' else {} |
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.
Comparing versions as strings is error-prone because it uses lexicographical ordering. For example, '0.10.0' would be considered less than '0.5.1'. To ensure correct version comparison, you should parse the version string into a comparable format, like a tuple of integers. This approach is more robust than string comparison for simple version numbers. For full compliance with PEP 440 versioning, consider using the packaging library if nixl adopts more complex versioning schemes in the future.
| ucx_args = { | |
| 'num_threads': 8, | |
| } if get_nixl_version() >= '0.5.1' else {} | |
| ucx_args = { | |
| 'num_threads': 8, | |
| } if tuple(map(int, get_nixl_version().split('.'))) >= (0, 5, 1) else {} |
|
offline discussion: Robert Shaw 7:19 Chendi Xue Robert Shaw Chendi Xue Robert Shaw Chendi Xue Robert Shaw Chendi Xue |
|
Resolve this issue by providing a build_from_source script instead, close |
Purpose
With num_threads added from PR#25844, nixl requirememt will be >= 0.5.1
However, if do pip install nixl>=0.5.1, libcuda.so will be hard-dependency.
For CPU offloading path in nixl, libcuda.so is not must to have
This PR is to provide a version check to make nixl_connector compatible with early nixl version
Alternative solution:
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.