Skip to content

Commit

Permalink
Move tools test. Removed relative includes
Browse files Browse the repository at this point in the history
  • Loading branch information
ayerofieiev-tt committed Jul 6, 2024
1 parent 1cf6f37 commit f7a7c5a
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/before_merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
python3 -m pip install pytest-github-report
- name: Run Tools Tests
env:
pytest_verbosity: 2
pytest_report_title: "⭐️ Tools Tests"
run: |
source venv/bin/activate
python3 -m pytest --github-report tests/tools/ -s
- name: Run Lowering Tests
env:
pytest_verbosity: 2
Expand Down
File renamed without changes.
12 changes: 7 additions & 5 deletions torch_ttnn/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ def aten_backend(
# Rewrite with ttnn ops, will insert redundant data movement
from torch.fx.passes.infra.pass_manager import PassManager
from torch.fx.passes.dialect.common.cse_pass import CSEPass
from .passes.lowering.to_tt_pass import ToTtPass
from .passes.lowering.add_data_move_pass import AddDataMovePass
from .passes.lowering.eliminate_data_move_pass import EliminateDataMovePass
from .passes.lowering.permute_reshape_tuple import PermuteReshapeTuple
from .passes.graphviz_pass import GraphvizPass
from torch_ttnn.passes.lowering.to_tt_pass import ToTtPass
from torch_ttnn.passes.lowering.add_data_move_pass import AddDataMovePass
from torch_ttnn.passes.graphviz_pass import GraphvizPass
from torch_ttnn.passes.lowering.eliminate_data_move_pass import (
EliminateDataMovePass,
)
from torch_ttnn.passes.lowering.permute_reshape_tuple import PermuteReshapeTuple

passes = [
ToTtPass(),
Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/fx_graphviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from . import mock_ttnn as ttnn
from torch_tnn import mock_ttnn as ttnn


def _tensor_weight(t):
Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/handle_input_aliasing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import torch
from typing import List
from .utils import GraphCleanup
from torch_ttnn.utils import GraphCleanup

"""
AOT Autograd has an optimization where if it determines that the storage of the
Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/passes/graphviz_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from .. import mock_ttnn as ttnn
from torch_ttnn import mock_ttnn as ttnn

from torch.fx.passes.infra.pass_base import PassBase, PassResult

Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/passes/lowering/add_data_move_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from .. import mock_ttnn as ttnn
from torch_ttnn import mock_ttnn as ttnn

from torch.fx.passes.infra.pass_base import PassBase, PassResult

Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/passes/lowering/eliminate_data_move_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from .. import mock_ttnn as ttnn
from torch_ttnn import mock_ttnn as ttnn

from torch.fx.passes.infra.pass_base import PassBase, PassResult

Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/passes/lowering/permute_reshape_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from .. import mock_ttnn as ttnn
from torch_ttnn import mock_ttnn as ttnn

from torch.fx.passes.infra.pass_base import PassBase, PassResult

Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/passes/lowering/to_tt_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from .. import mock_ttnn as ttnn
from torch_ttnn import mock_ttnn as ttnn

from torch.fx.passes.infra.pass_base import PassBase, PassResult
import torch.fx.traceback as fx_traceback
Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/patterns/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from .. import mock_ttnn as ttnn
from torch_ttnn import mock_ttnn as ttnn


# NOTE(yoco) The name `add` must be the same as the name of the function.
Expand Down
2 changes: 1 addition & 1 deletion torch_ttnn/patterns/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ttnn
except ImportError:
print("ttnn is not installed, use mock_ttnn instead")
from .. import mock_ttnn as ttnn
from torch_ttnn import mock_ttnn as ttnn


# NOTE(yoco) The name `matmul` must be the same as the name of the function.
Expand Down

0 comments on commit f7a7c5a

Please sign in to comment.