Skip to content

Conversation

@maltanar
Copy link
Collaborator

@maltanar maltanar commented Oct 21, 2025

Merge after #217
Incorporates/supersedes #170

Uses the custom op versioning system in #217 to introduce versioned Trunc ops, namelyTrunc_v1 and Trunc_v2 (which itself is introduced by #170). Also updates the documentation for the custom ops to specify the version number and adds an overview table from which the different versions are indexed.

nickfraser and others added 30 commits February 11, 2025 16:54
grabs CustomOp instance with the right opset version from protobuf
imported opsets
@maltanar maltanar marked this pull request as draft October 21, 2025 12:34
maltanar and others added 4 commits October 23, 2025 11:31
Replace manual dict registration with automatic class discovery and version resolution.
CustomOps now declare op_version attribute and are auto-registered via module imports.

- Add op_version attribute to all CustomOp base and subclasses
- Implement nested registry structure (domain->op_type->version)
- Support "since version" semantics for automatic version resolution
- Replace is_finn_op() with is_custom_op() from registry
- Add registry API (add_op_to_domain, get_supported_versions, is_custom_op)
- Simplify domain __init__.py files to use __all__ exports
- Use lazy loading via __all__ for performance
…e inference

CustomOp version is now determined solely by _vN class name suffix:
- No suffix defaults to version 1
- _vN suffix indicates version N
- Removes redundant op_version class attribute across all CustomOp implementations
- Updates registry to extract version from class names only
- Adds backward compatibility for legacy custom_op dict pattern
- Simplifies version discovery logic with custom_op dict fallback
@nickfraser
Copy link
Contributor

FYI, the Trunc / AvgPool tests in Brevitas are currently disabled. Prior to merging this, we may want to run these tests locally on the Brevitas side to check we don't have any regressions.

@maltanar maltanar marked this pull request as ready for review November 19, 2025 10:31
@maltanar maltanar merged commit d72fb8c into main Nov 20, 2025
3 checks passed
@maltanar maltanar deleted the feature/opversion_and_trunc_v2 branch November 20, 2025 12:57
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.

5 participants