-
Notifications
You must be signed in to change notification settings - Fork 629
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
Introduce DALI_PRELOAD_PLUGINS #5457
Conversation
!build |
c9ae231
to
6aa365b
Compare
CI MESSAGE: [14816252]: BUILD STARTED |
CI MESSAGE: [14816252]: BUILD FAILED |
Signed-off-by: Joaquin Anton <janton@nvidia.com>
6aa365b
to
6385970
Compare
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
CI MESSAGE: [14816954]: BUILD STARTED |
Signed-off-by: Joaquin Anton <janton@nvidia.com>
6385970
to
353f81a
Compare
CI MESSAGE: [14816986]: BUILD STARTED |
CI MESSAGE: [14816986]: BUILD FAILED |
CI MESSAGE: [14817292]: BUILD STARTED |
CI MESSAGE: [14817292]: BUILD FAILED |
CI MESSAGE: [14838996]: BUILD STARTED |
Signed-off-by: Joaquin Anton <janton@nvidia.com>
f650505
to
6760609
Compare
|
||
void TestPlugin(const std::string &backend) { | ||
LoadDummyPlugin(); | ||
void TestPlugin(const std::string& backend) { |
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 removed the test fixture because it was completely unnecessary
TEST(DummyTest, TestPluginCPU) { | ||
GTEST_FLAG_SET(death_test_style, "threadsafe"); | ||
LoadDummyPlugin(); | ||
EXPECT_EXIT(TestPlugin("cpu"), testing::ExitedWithCode(0), ""); |
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.
This is crucial. Before this change it was enough that the first testcase loads the plugin, as it was run in the same process. This change makes sure that each test case has to load the plugin
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.
Maybe it would be good to add a comment here to explain this
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.
Done
CI MESSAGE: [14838996]: BUILD FAILED |
Signed-off-by: Joaquin Anton <janton@nvidia.com>
@@ -43,47 +43,47 @@ | |||
"name": "stdout", |
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.
!build |
CI MESSAGE: [14875217]: BUILD STARTED |
CI MESSAGE: [14875217]: BUILD FAILED |
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.
Minor nitpicks, otherwise ok.
"[ 66%] \u001b[32mBuilding CUDA object CMakeFiles/customdummy.dir/dummy.cu.o\u001b[0m\n", | ||
"[100%] \u001b[32m\u001b[1mLinking CXX shared library libcustomdummy.so\u001b[0m\n", | ||
"[100%] Built target customdummy\n" | ||
"-- Build files have been written to: /home/janton/git/dali/docs/examples/custom_operations/custom_operator/customdummy/build\n", |
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 remove user-specific paths.
dali/plugin/plugin_manager.cc
Outdated
while (index != string::npos) { | ||
auto plugin_path = dali_preload_plugins.substr(previous, index - previous); | ||
if (fs::is_directory(plugin_path)) { | ||
PluginManager::LoadDirectory(plugin_path); | ||
} else { | ||
PluginManager::LoadLibrary(plugin_path); | ||
} | ||
previous = index + 1; | ||
index = dali_preload_plugins.find(delimiter, previous); | ||
} | ||
auto plugin_path = dali_preload_plugins.substr(previous); | ||
if (fs::is_directory(plugin_path)) { | ||
PluginManager::LoadDirectory(plugin_path); | ||
} else { | ||
PluginManager::LoadLibrary(plugin_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.
Nitpick: You can probably handle this with a do/while
dali/plugin/plugin_manager.cc
Outdated
size_t previous = 0; | ||
std::string preload(dali_preload_plugins); | ||
size_t index = dali_preload_plugins.find(delimiter); | ||
std::vector<std::string> plugins; |
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.
Seems unused, you just push to it once at the end.
Signed-off-by: Joaquin Anton <janton@nvidia.com>
5277cec
to
6913856
Compare
Signed-off-by: Joaquin Anton <janton@nvidia.com>
6913856
to
495b4b0
Compare
CI MESSAGE: [14880642]: BUILD STARTED |
CI MESSAGE: [14880642]: BUILD FAILED |
This reverts commit dfc7d95. Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
Category:
New feature
Description:
Introduces a new environment variable that allows the user to preload some DALI plugins:
Additional information:
Affected modules and functionalities:
Plugin manager
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A