-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add file descriptor support for weightless model loading #32572
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
base: master
Are you sure you want to change the base?
Conversation
|
NPUW part looks good |
|
build_jenkins |
| * This is useful for scenarios where file access needs to be controlled externally. | ||
| * @ingroup ov_runtime_cpp_prop_api | ||
| */ | ||
| using FdGetterType = std::function<int(const std::string&)>; |
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.
We should not add as public property as this some internal NPU handling
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.
It could be dev_api nested trait, if needed elsewhere.
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.
I have added a new commit(ffb6519) which moves the property under npuw_private_properties.hpp.
But, one challenge here is that the type definition FdGetterType won't be visible to the caller.
I verified that it works when the type is defined and used by the caller :
using FdGetterType = std::function<int(const std::string&)>;
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.
7d8abfb to
414d179
Compare
| * Function that takes a file path string and returns a file descriptor as int. | ||
| * This is useful for scenarios where file access needs to be controlled externally. | ||
| */ | ||
| using FdGetterType = std::function<int(const std::string&)>; |
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.
Please move it below under npuw namespace
|
|
||
| namespace npuw { | ||
| /** | ||
| * @brief This key identifies callback function to get file descriptor for a given file path. |
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.
Please align the comment with other npuw properties' comments below
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.
Also you can mention that this property is used during weightless import only
Changes: - Add ov::FdGetterType and ov::hint::fd_getter property - Extend load_mmap_object() with fd-based overload (Linux only) - Integrate fd_getter through NPUW deserialization flow - Windows implementation throws unsupported exception Signed-off-by: Anoob Anto Kodankandath <[email protected]>
Signed-off-by: Anoob Anto Kodankandath <[email protected]>
Changes:
Details:
Tickets: