-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Remove duplicate backend registration from torch 2.5 #27245
Conversation
src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/backend.py
Outdated
Show resolved
Hide resolved
src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/backend.py
Outdated
Show resolved
Hide resolved
src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/backend.py
Outdated
Show resolved
Hide resolved
from packaging import version | ||
|
||
if version.parse(torch.__version__) < version.parse("2.5.0"): | ||
register_backend(compiler_fn=openvino, name="openvino") | ||
except ImportError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be it is better to check if backend
is registered by this code?
if not hasattr(torch.backends, 'openvino') or not torch.backends.openvino.is_available()
that is torch version agnostic approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, this can be improved. However I am not sure if the registered backends list can be easily accessible. Lets merge this PR as is and consider this improvement for future @suryasidd
build_jenkins |
build_jenkins |
Details:
Tickets: