From 50a6b9c9757c03fc6cf86057840c14548d59423f Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Oct 2024 16:16:46 -0700 Subject: [PATCH] Update things for sparse applications MICRO demo --- sam | 2 +- sparse_demo.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 sparse_demo.sh diff --git a/sam b/sam index 2151dc75..bb37e001 160000 --- a/sam +++ b/sam @@ -1 +1 @@ -Subproject commit 2151dc75f1e612aa2fd28b8f784bd5bd94a0d15f +Subproject commit bb37e0013b9c3a2bbe833aa4f56368f66531a50c diff --git a/sparse_demo.sh b/sparse_demo.sh new file mode 100755 index 00000000..90708d1d --- /dev/null +++ b/sparse_demo.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "Error: please provide a command argument" + exit 1 +fi + +command=$1 + +# Make SAM graphs +case $command in + compile) + echo "Setting up dependencies" + cd sam/ + pip install -e . + make submodules &> custard_log.txt + + # Build and Run Custard compiler + echo "Build and run Custard compiler, log at sam/custard_log.txt" + make taco/build &> custard_log.txt + make sam &> custard_log.txt + cd .. + ;; + lower) + cd sam/ + echo "Convert SAM graph to hardware-aware sparse dataflow graph" + PYTHONPATH=/aha/garnet/ python sam/onyx/parse_dot.py --sam_graph /aha/sam/compiler/sam-outputs/onyx-dot/mat_elemadd.gv --output_png hw_aware_mat_elemadd.png --output_graph hw_aware_mat_elemadd.gv + cd .. + ;; + gen) + echo "Map to sparse CGRA and generate bitstream" + EXHAUSTIVE_PIPE=1 PYTHONPATH=/aha/garnet/ python /aha/garnet/tests/test_memory_core/build_tb.py --ic_fork --sam_graph /aha/sam/compiler/sam-outputs/onyx-dot/mat_elemadd.gv --seed 0 --dump_bitstream --add_pond --combined --pipeline_scanner --base_dir /aha/garnet/SPARSE_TESTS/ --just_glb --dump_glb --fiber_access --width 12 --height 4 + ;; + *) + echo "Invalid command: $command" + exit 1 + ;; +esac