Skip to content
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

[Dynamo] Update dynamo registration after pytorch refactored that part #84

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install dependencies via pip
run: |
python -m pip install --upgrade pip
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu116
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu118
pip install -r requirements.txt
pip install -r requirements-dev.txt

Expand Down Expand Up @@ -65,6 +65,7 @@ jobs:
include/**/*.h
src/**/*
python/hidet/backend/**/*.py
python/hidet/graph/ops/**/*.py
python/hidet/transforms/**/*.py
python/hidet/ir/**/*.py

Expand Down
8 changes: 3 additions & 5 deletions python/hidet/graph/frontend/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ def register_dynamo_backends():
By default, if torch has already been imported and dynamo is available, the backends will be registered immediately.
Otherwise, the user can call this function to register the backends manually.
"""
from torch._dynamo.optimizations.backends import register_backend, BACKENDS
from torch._dynamo.backends.registry import register_backend, list_backends
from .dynamo_backends import hidet_backend

if 'hidet' not in BACKENDS:
hidet_backend.__name__ = 'hidet'

register_backend(hidet_backend)
if 'hidet' not in list_backends():
register_backend(hidet_backend, name='hidet')


if imported() and dynamo_available():
Expand Down