Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Isaac De Vlugt <[email protected]>
  • Loading branch information
erick-xanadu and isaacdevlugt authored Jan 3, 2025
1 parent 0a5638c commit a278b77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/dev/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ If you have followed all the steps in this tutorial and inspect the MLIR sources
Take a look into the ``standalone_plugin_wheel`` make rule to see how we test shipping a plugin.
For more information, please consult our `dialect guide <../dev/dialects.html>`_, our `compiler passes guide <../dev/transforms.html>`_, and the `MLIR documentation <https://mlir.llvm.org/>`_.

You can also register your pass with Catalyst via Python's `entry_ponts <https://packaging.python.org/en/latest/specifications/entry-points/>`_ (for reference, we have an `example in the Catalyst Github repository <https://github.com/PennyLaneAI/catalyst/tree/main/standalone_plugin_wheel/standalone_plugin>`_
You can also register your pass with Catalyst via Python's `entry_points <https://packaging.python.org/en/latest/specifications/entry-points/>`_ (for reference, we have an `example in the Catalyst Github repository <https://github.com/PennyLaneAI/catalyst/tree/main/standalone_plugin_wheel/standalone_plugin>`_
that implements the standalone plugin as a Python package).
To do this, you only need to define a function named ``name2pass``—it must be named ``name2pass``—that takes a string with the name of the pass (from the user perspective) and returns the absolute path to the plugin stored in your package and the name of the MLIR pass.
For the `standalone plugin python <https://github.com/PennyLaneAI/catalyst/tree/main/standalone_plugin_wheel/standalone_plugin>`_ package we defined:
Expand Down Expand Up @@ -404,7 +404,7 @@ After this, the user will be able to use your pass with the :func:`~.passes.appl
print(module.mlir)
Of course, you can also define your own decorators similar to :func:`~.passes.apply_pass` to check parameters, do some other validation or perhaps just to improve the user interface.
E.g.,:
For example:


.. code-block:: python
Expand Down
4 changes: 2 additions & 2 deletions frontend/catalyst/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def apply_pass(pass_name: str, *flags, **valued_options):
**valued_options: options with values
Returns:
function that can be used as a decorator to a qnode.
Function that can be used as a decorator to a QNode.
"""

def decorator(qnode):
Expand Down Expand Up @@ -378,7 +378,7 @@ def apply_pass_plugin(path_to_plugin: Path, pass_name: str, *flags, **valued_opt
**valued_options: options with values
Returns:
function that can be used as a decorator to a qnode.
Function that can be used as a decorator to a QNode.
"""

def decorator(qnode):
Expand Down

0 comments on commit a278b77

Please sign in to comment.