Skip to content

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).

@jmitrevs
Copy link
Contributor

jmitrevs commented Sep 4, 2025

Can maybe more documentation be added?

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.

2 participants