Skip to content

Commit

Permalink
[Dynamo] Update dynamo registration after pytorch refactored that part (
Browse files Browse the repository at this point in the history
#84)

* update dynamo registration after pytorch refactored that part

* use cu118 of torch
  • Loading branch information
yaoyaoding committed Feb 15, 2023
1 parent 33cfcbb commit 13bfb7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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

0 comments on commit 13bfb7c

Please sign in to comment.