Skip to content
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

Op Registry upgrade #144

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jurevreca12
Copy link

This PR makes it possible to add QONNX Ops from outside the brevitas/finn/qonnx repositories. It adds a function register_custom_domain .

This is an example of usage of this functionality in chisel4ml:
- https://github.com/cs-jsi/chisel4ml/blob/auto_parameters/chisel4ml/preprocess/fft_torch_op.py
- https://github.com/cs-jsi/chisel4ml/blob/auto_parameters/chisel4ml/preprocess/fft_qonnx_op.py

It defines a custom pytorch op, that then gets mapped to a (Q)ONNX op.

This PR should not affect other peoples code.

@jurevreca12
Copy link
Author

I just realized I forgot to add the example code where register_custom_domain function is used. The examples above define the ops. However, first the register_custom_domain is called https://github.com/cs-jsi/chisel4ml/blob/auto_parameters/chisel4ml/transform.py#L87, and the ops are imported into the "chisel4ml" namespace inside chise4ml/__init__.py (because QONNX equates the domain name with the python namespace).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant