-
Notifications
You must be signed in to change notification settings - Fork 512
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
feat: load customized OP library in the C++ interface #4073
Conversation
Fix deepmodeling#4041. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
WalkthroughWalkthroughThe changes enhance the documentation and functionality related to loading customized C++ operations (OPs) in both PyTorch and TensorFlow. New sections provide clear guidance on creating and loading OP libraries, improving usability for model developers. Additionally, the C++ library loading mechanism has been modularized, facilitating dynamic loading of additional libraries via the Changes
Assessment against linked issues
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional context usedGitHub Check: codecov/patch
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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
Outside diff range, codebase verification and nitpick comments (1)
source/api_cc/src/common.cc (1)
Line range hint
380-388
: Improve error message for platform-specific guidance.The error message in
_load_library_path
suggests settingLD_LIBRARY_PATH
, which is specific to Unix-like systems. Consider adding platform-specific guidance for Windows as well.Apply this diff to improve the error message:
if (!dso_handle) { #if defined(_WIN32) throw deepmd::deepmd_exception( dso_path + " is not found! You can add the library directory to PATH"); #else throw deepmd::deepmd_exception( dso_path + " is not found! You can add the library directory to LD_LIBRARY_PATH"); #endif }
Not sure what's wrong here
|
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #4073 +/- ##
==========================================
- Coverage 82.95% 82.93% -0.03%
==========================================
Files 522 522
Lines 51044 51054 +10
Branches 3028 3030 +2
==========================================
- Hits 42343 42341 -2
- Misses 7756 7764 +8
- Partials 945 949 +4 ☔ View full report in Codecov by Sentry. |
I've tested it and it works. |
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: 1
Fix #4041. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added documentation for integrating customized C++ operations (OPs) in both PyTorch and TensorFlow models. - Introduced guidelines on using the `DP_PLUGIN_PATH` environment variable for loading custom OP libraries. - Clarified the usage of environment variables in the context of a C++ interface, improving usability for third-party programs. - **Documentation** - Enhanced documentation to provide clearer instructions for model development with custom C++ functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
) Fix deepmodeling#4041. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added documentation for integrating customized C++ operations (OPs) in both PyTorch and TensorFlow models. - Introduced guidelines on using the `DP_PLUGIN_PATH` environment variable for loading custom OP libraries. - Clarified the usage of environment variables in the context of a C++ interface, improving usability for third-party programs. - **Documentation** - Enhanced documentation to provide clearer instructions for model development with custom C++ functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Fix #4041.
Summary by CodeRabbit
New Features
DP_PLUGIN_PATH
environment variable for loading custom OP libraries.Documentation