@@ -14,15 +14,33 @@ namespace impl {
14
14
class TRTorchPluginRegistry {
15
15
public:
16
16
TRTorchPluginRegistry () {
17
- auto trtorch_logger = util::logging::TRTorchLogger (
18
- " [TRTorch Plugins Context] - " ,
19
- util::logging::get_logger ().get_reportable_severity (),
20
- util::logging::get_logger ().get_is_colored_output_on ());
17
+ trtorch_logger.log (util::logging::LogLevel::kINFO , " Instatiated the TRTorch plugin registry class" );
21
18
// register libNvInferPlugins and TRTorch plugins
19
+ // trtorch_logger logging level is set to kERROR and reset back to kDEBUG.
20
+ // This is because initLibNvInferPlugins initializes only a subset of plugins and logs them.
21
+ // Plugins outside this subset in TensorRT are not being logged in this. So temporarily we disable this to prevent multiple logging of same plugins.
22
+ // To provide a clear list of all plugins, we iterate through getPluginRegistry() where it prints the
23
+ // list of all the plugins registered in TensorRT with their namespaces.
24
+ trtorch_logger.set_reportable_log_level (util::logging::LogLevel::kERROR );
22
25
initLibNvInferPlugins (&trtorch_logger, " " );
23
- REGISTER_TRTORCH_PLUGIN (InterpolatePluginCreator);
24
- REGISTER_TRTORCH_PLUGIN (NormalizePluginCreator);
26
+ trtorch_logger.set_reportable_log_level (util::logging::LogLevel::kDEBUG );
27
+
28
+ int numCreators = 0 ;
29
+ auto pluginsList = getPluginRegistry ()->getPluginCreatorList (&numCreators);
30
+ for (int k = 0 ; k < numCreators; ++k) {
31
+ if (!pluginsList[k]) {
32
+ trtorch_logger.log (util::logging::LogLevel::kDEBUG , " Plugin creator for plugin " + str (k) + " is a nullptr" );
33
+ continue ;
34
+ }
35
+ std::string pluginNamespace = pluginsList[k]->getPluginNamespace ();
36
+ trtorch_logger.log (util::logging::LogLevel::kDEBUG , " Registered plugin creator - " + std::string (pluginsList[k]->getPluginName ()) + " , Namespace: " + pluginNamespace);
37
+ }
38
+ trtorch_logger.log (util::logging::LogLevel::kDEBUG , " Total number of plugins registered: " + str (numCreators));
25
39
}
40
+ public:
41
+ util::logging::TRTorchLogger trtorch_logger = util::logging::TRTorchLogger(" [TRTorch Plugins Context] - " ,
42
+ util::logging::LogLevel::kDEBUG ,
43
+ true );
26
44
};
27
45
28
46
namespace {
0 commit comments