mindspore.graph.register_custom_pass
- mindspore.graph.register_custom_pass(pass_name, plugin_so_path, device='all', stage='')[source]
Register a custom pass to modify graph structure for default
"ms_backend"backend.Warning
This is an experimental API that is subject to change or deletion.
- Parameters
pass_name (str) – Name of the pass expected to be provided by the plugin.
plugin_so_path (str) – Absolute path to the plugin shared library (.so file).
device (str, optional) – Target device for the pass. Supported values:
"cpu","gpu","ascend", or"all". Default:"all".stage (str, optional) – Pass stage. Reserved field for future use. Default:
"".
- Returns
bool. Returns
Trueif the custom pass is registered successfully, otherwise returnsFalse.
Examples
>>> import mindspore.graph as graph >>> # Register a custom optimization pass >>> success = graph.register_custom_pass( ... pass_name="my_fusion_pass", ... plugin_so_path="/path/to/my_plugin.so", ... device="ascend" ... ) >>> print(f"Registration successful: {success}")