Skip to content

Commit

Permalink
make visualization for example architectures optional
Browse files Browse the repository at this point in the history
  • Loading branch information
asyms committed Sep 22, 2023
1 parent e06b2ac commit cdf0de8
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 33 deletions.
12 changes: 6 additions & 6 deletions zigzag/inputs/examples/hardware/Ascend_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from zigzag.classes.hardware.architecture.core import Core


def memory_hierarchy_dut(multiplier_array):
def memory_hierarchy_dut(multiplier_array, visualize=False):
"""Memory hierarchy variables"""
""" size=#bit, bw=(read bw, write bw), cost=(read word energy, write work energy) """

Expand Down Expand Up @@ -243,12 +243,12 @@ def memory_hierarchy_dut(multiplier_array):
),
served_dimensions="all",
)
if visualize:
from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

# visualize_memory_hierarchy_graph(memory_hierarchy_graph)
visualize_memory_hierarchy_graph(memory_hierarchy_graph)
return memory_hierarchy_graph


Expand Down
12 changes: 6 additions & 6 deletions zigzag/inputs/examples/hardware/Edge_TPU_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from zigzag.classes.hardware.architecture.core import Core


def memory_hierarchy_dut(multiplier_array):
def memory_hierarchy_dut(multiplier_array, visualize=False):
"""Memory hierarchy variables"""
""" size=#bit, bw=(read bw, write bw), cost=(read word energy, write work energy) """

Expand Down Expand Up @@ -152,12 +152,12 @@ def memory_hierarchy_dut(multiplier_array):
),
served_dimensions="all",
)
if visualize:
from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

# visualize_memory_hierarchy_graph(memory_hierarchy_graph)
visualize_memory_hierarchy_graph(memory_hierarchy_graph)
return memory_hierarchy_graph


Expand Down
9 changes: 6 additions & 3 deletions zigzag/inputs/examples/hardware/Eyeriss_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from zigzag.classes.hardware.architecture.core import Core


def memory_hierarchy_latency_test1(multiplier_array):
def memory_hierarchy_latency_test1(multiplier_array, visualize=False):
"""Memory hierarchy variables"""
""" size=#bit, bw=(read bw, write bw), cost=(read word energy, write work energy) """
rf1 = MemoryInstance(
Expand Down Expand Up @@ -167,9 +167,12 @@ def memory_hierarchy_latency_test1(multiplier_array):
),
served_dimensions="all",
)
if visualize:
from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

# from visualization.graph.memory_hierarchy import visualize_memory_hierarchy_graph
# visualize_memory_hierarchy_graph(memory_hierarchy_graph)
visualize_memory_hierarchy_graph(memory_hierarchy_graph)
return memory_hierarchy_graph


Expand Down
12 changes: 6 additions & 6 deletions zigzag/inputs/examples/hardware/Meta_prototype.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from zigzag.classes.hardware.architecture.core import Core


def memory_hierarchy_dut(multiplier_array):
def memory_hierarchy_dut(multiplier_array, visualize=False):
"""Memory hierarchy variables"""
""" size=#bit, bw=(read bw, write bw), cost=(read word energy, write work energy) """

Expand Down Expand Up @@ -197,12 +197,12 @@ def memory_hierarchy_dut(multiplier_array):
),
served_dimensions="all",
)
if visualize:
from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

# visualize_memory_hierarchy_graph(memory_hierarchy_graph)
visualize_memory_hierarchy_graph(memory_hierarchy_graph)
return memory_hierarchy_graph


Expand Down
12 changes: 6 additions & 6 deletions zigzag/inputs/examples/hardware/TPU_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from zigzag.classes.hardware.architecture.core import Core


def memory_hierarchy_dut(multiplier_array):
def memory_hierarchy_dut(multiplier_array, visualize=False):
"""Memory hierarchy variables"""
""" size=#bit, bw=(read bw, write bw), cost=(read word energy, write work energy) """

Expand Down Expand Up @@ -130,12 +130,12 @@ def memory_hierarchy_dut(multiplier_array):
),
served_dimensions="all",
)
if visualize:
from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

visualize_memory_hierarchy_graph(memory_hierarchy_graph)
visualize_memory_hierarchy_graph(memory_hierarchy_graph)
return memory_hierarchy_graph


Expand Down
12 changes: 6 additions & 6 deletions zigzag/inputs/examples/hardware/Tesla_NPU_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from zigzag.classes.hardware.architecture.core import Core


def memory_hierarchy_dut(multiplier_array):
def memory_hierarchy_dut(multiplier_array, visualize=False):
"""Memory hierarchy variables"""
""" size=#bit, bw=(read bw, write bw), cost=(read word energy, write work energy) """

Expand Down Expand Up @@ -200,12 +200,12 @@ def memory_hierarchy_dut(multiplier_array):
),
served_dimensions="all",
)
if visualize:
from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

from zigzag.visualization.graph.memory_hierarchy import (
visualize_memory_hierarchy_graph,
)

# visualize_memory_hierarchy_graph(memory_hierarchy_graph)
visualize_memory_hierarchy_graph(memory_hierarchy_graph)
return memory_hierarchy_graph


Expand Down

0 comments on commit cdf0de8

Please sign in to comment.