| 295 | _no_serialize_attr = {"_current_stream", "_workspace"} |
| 296 | |
| 297 | def __init__(self): |
| 298 | cls = type(self) |
| 299 | # Runtime check for plugin decorator |
| 300 | assert cls._plugin_creator is not None, ( |
| 301 | "Please make sure the plugin is registered through `@trtllm_plugin`" |
| 302 | ) |
| 303 | assert cls != PluginBase |
| 304 | |
| 305 | trt.IPluginV3.__init__(self) |
| 306 | trt.IPluginV3OneCore.__init__(self) |
| 307 | trt.IPluginV3OneBuild.__init__(self) |
| 308 | trt.IPluginV3OneRuntime.__init__(self) |
| 309 | |
| 310 | self.plugin_phase = trt.TensorRTPhase.BUILD |
| 311 | self.num_outputs = self._num_outputs |
| 312 | self.plugin_namespace = self._plugin_namespace |
| 313 | self.plugin_name = self._plugin_name |
| 314 | self.plugin_version = self._plugin_version |
| 315 | self.current_stream = -1 |
| 316 | self.workspace = 0 # nullptr |
| 317 | |
| 318 | @property |
| 319 | def current_stream(self): |