Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jorendumoulin committed Mar 21, 2024
1 parent 3423ff4 commit d8989e3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
9 changes: 6 additions & 3 deletions pact/experiments/layout/generate_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class UnsupportedCombinationException(Exception):
[32, 32, 32], # ops = 32*32*32 = 32768
# [64, 24, 16],
# [64, 24, 48],
# [32, 32, 64], # ops = 32*32*64 = 65536
# [32, 64, 64], # ops = 32*64*64 = 131072
# [64, 64, 64], # ops = 64*64*64 = 262144
[32, 32, 64], # ops = 32*32*64 = 65536
[32, 64, 64], # ops = 32*64*64 = 131072
[64, 64, 64], # ops = 64*64*64 = 262144
# [64, 64, 128], # ops = 64*64*128 = 524288
# [64, 128, 128], # ops = 64*128*128 = 1048576
# [128, 128, 128], # ops = 128*128*128 = 2097152
Expand All @@ -40,6 +40,7 @@ class UnsupportedCombinationException(Exception):
# 'cpu', # cpu golden model
# 'base', # base system (no streamers)
"fifo-0", # streamer with a fifo depth of 0
"fifo-1-slow",
"fifo-1", # streamer with a fifo depth of 1
"fifo-2", # streamer with a fifo depth of 2
"fifo-3", # streamer with a fifo depth of 3
Expand Down Expand Up @@ -133,6 +134,8 @@ def generate_makefile(layout, backend):
runtime_backend = "snax-gemm"
elif backend == "fifo-0":
runtime_backend = "snax-streamer-gemm-fifo-0"
elif backend == "fifo-1-slow":
runtime_backend = "snax-streamer-gemm-fifo-1-slow"
elif backend == "fifo-1":
runtime_backend = "snax-streamer-gemm-fifo-1"
elif backend == "fifo-2":
Expand Down
27 changes: 19 additions & 8 deletions pact/experiments/layout/parse_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,29 @@
file_to_open = os.path.join(
directory, d, "matmul.x.logs", "trace_hart_00000000.trace.json"
)
with open(file_to_open) as file:
file = json.load(file)
result = file[2]
name_split = d.split("_")
layout = name_split[2]
backend = name_split[3]
size = "x".join(name_split[4:])
name_split = d.split("_")
layout = name_split[2]
backend = name_split[3]
size = "x".join(name_split[4:])
try:
with open(file_to_open) as file:
file = json.load(file)
result = file[2]

result["test"] = d
result["layout"] = layout
result["backend"] = backend
result["size"] = size
result["success"] = len(file) == 5
results.append(result)
except Exception as e:
print(f"Error: {e}")
result = {}
result["test"] = d
result["layout"] = layout
result["backend"] = backend
result["size"] = size
result["success"] = len(file) == 5
result["success"] = False
results.append(result)

# Store results in results.json
Expand Down
5 changes: 5 additions & 0 deletions runtime/snax-streamer-gemm-fifo-1-slow.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Specific settings for snax-mac RTL
SNITCH_SW_PATH = /opt/snax-gemm
VLTSIM = /opt-fifo-1-slow/snax-streamer-gemm-rtl/bin/snitch_cluster.vlt
CFLAGS += -I$(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/gemm/include
LDFLAGS += $(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/gemm/build/snax-gemm-lib.o

0 comments on commit d8989e3

Please sign in to comment.