Skip to content

Lazy Load Custom Ops #855

Closed
Closed
@seanpmorgan

Description

@seanpmorgan

A major issue we have with Addons is that it is compatible with PyPi TensorFlow, but has ABI incompatibilities with TF that was built from source or installed with conda depending on the compiler and settings:
#676
#753
#574

The ultimate fix for this will be the ABI stable kernel and ops:
tensorflow/community#133

However, as a mitigation it may be worthwhile to lazy load custom-ops when they are used:
https://github.com/tensorflow/addons/blob/master/tensorflow_addons/activations/gelu.py#L23

At the moment all custom-ops are loaded during init. Seeing as >80% of addons does not use a custom-op it is likely that many users are experiencing this issue even when they don't plan on using a custom op. This is certainly a hacky "fix" and doesn't solve the issue but I thought it was worth discussing as I feel this is a major issue regarding adoption.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions