Hardware Custom Op Registry Refactoring and Brainsmith Integration #1462
+613
−409
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactors hardware custom operator retrieval across FINN to support kernel schema transformations, and adds Brainsmith plugin integration for external tooling.
Changes
1. Unified
getHWCustomOp()wrapper (src/finn/util/basic.py)Replaces direct
getCustomOp(node)calls withgetHWCustomOp(node, model)to support operators with kernel schemas. When a custom op has akernel_schemaattribute, the wrapper automatically callsbuild_design_space(model)to populate kernel-specific parameters before returning the instance. Updated 85+ callsites across transformations, analysis passes, tests, and notebooks.2. Brainsmith plugin integration (
src/finn/util/brainsmith_integration.py)Adds setuptools plugin entrypoint that auto-discovers FINN components (build steps, hardware kernels, backend implementations) with zero runtime dependencies. Registered via
brainsmith.pluginsentry point insetup.cfg. Excludes non-synthesizable kernels without infer transformations.