From 016c0753751e5f5e70dc84685c22cc01d3983d20 Mon Sep 17 00:00:00 2001 From: Kalhan Koul Date: Wed, 17 Jan 2024 11:13:55 -0800 Subject: [PATCH 1/2] debug with akhilesh --- sam/sim/src/tiling/tile.py | 2 ++ .../formatting/generate_tensor_tile_formats_onyx.sh | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sam/sim/src/tiling/tile.py b/sam/sim/src/tiling/tile.py index 59022253..5a8d5df4 100644 --- a/sam/sim/src/tiling/tile.py +++ b/sam/sim/src/tiling/tile.py @@ -529,6 +529,7 @@ def cotile_multilevel_coo(app_str, hw_config_fname, tensors, output_dir_path, hi help="If this is enabled, the 'other' tensors will have at least one nonzero value") args = parser.parse_args() + print("Args:", args) random.seed(args.seed) np.random.seed(args.seed) @@ -557,6 +558,7 @@ def cotile_multilevel_coo(app_str, hw_config_fname, tensors, output_dir_path, hi inputCache = inputCacheTensor tensor_path = os.path.join(FROSTT_PATH, args.input_tensor + ".tns") + print("tensor_path", tensor_path) # FIXME: This is broken frostt_tensor = FrosttTensor(tensor_path) diff --git a/scripts/formatting/generate_tensor_tile_formats_onyx.sh b/scripts/formatting/generate_tensor_tile_formats_onyx.sh index c5c51a6d..1c01ec0e 100755 --- a/scripts/formatting/generate_tensor_tile_formats_onyx.sh +++ b/scripts/formatting/generate_tensor_tile_formats_onyx.sh @@ -67,10 +67,20 @@ run_format(){ export FROSTT_TENSOR_PATH=$filename export FROSTT_FORMATTED_PATH=$bench_path/formatted/ export TENSOR_FORMAT=$tensor_format - echo "Tensor format: $TENSOR_FORMAT" + echo "FROSTT_FORMATTED_TACO_PATH: $FROSTT_FORMATTED_TACO_PATH" + echo "FROSTT_PATH: $FROSTT_PATH" + echo "FROSTT_TENSOR_PATH: $FROSTT_TENSOR_PATH" + echo "FROSTT_FORMATTED_PATH: $FROSTT_FORMATTED_PATH" + echo "TENSOR_FORMAT: $TENSOR_FORMAT" + echo "format: $format" $basedir/compiler/taco/build/bin/taco-test sam.pack_$format + echo "Name: $name" + echo "Format: $format" + echo "Bench: $bench" + echo "Bench path: $bench_path" + python3 $basedir/scripts/formatting/datastructure_tns.py -n $name -f $format --other -b $bench -hw --output_dir $bench_path/formatted/$name echo "Done processing $name" From 7f2ae26f7d5ed420df6af542ee92db80013559b6 Mon Sep 17 00:00:00 2001 From: Akhilesh Varadan Balasingam Date: Sun, 21 Jan 2024 22:03:36 -0800 Subject: [PATCH 2/2] clean up tiling flow --- .../generate_tensor_tile_formats_onyx.sh | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/scripts/formatting/generate_tensor_tile_formats_onyx.sh b/scripts/formatting/generate_tensor_tile_formats_onyx.sh index 1c01ec0e..5cd8c1b4 100755 --- a/scripts/formatting/generate_tensor_tile_formats_onyx.sh +++ b/scripts/formatting/generate_tensor_tile_formats_onyx.sh @@ -2,7 +2,8 @@ #SBATCH -N 1 #SBATCH -t 360 -# ./scripts/generate_frostt_formats_onyx.sh +# edit tensor_name.txt with tensors to tile +# ./scripts/generate_frostt_formats_onyx.sh shopt -s extglob @@ -15,7 +16,8 @@ BENCHMARKS=( # tensor3_elemadd # tensor3_innerprod # tensor3_mttkrp - tensor3_ttm +# tensor3_ttm +$3 # tensor3_ttm # tensor3_mttkrp # tensor3_elemmul @@ -23,14 +25,8 @@ BENCHMARKS=( ) OTHER_FORMATS=( -# sss -# sss -# s - ss -# ss -# sss - # ss - ) + $4 +) OTHERBENCHES='["tensor3_ttv", "tensor3_ttm", "tensor3_mttkrp"]' @@ -55,6 +51,7 @@ run_format(){ bench_path=$4 tile_path=$5 tensor_format=$6 + other_form=$7 basedir=$(pwd) echo "Processing $f" @@ -74,12 +71,17 @@ run_format(){ echo "TENSOR_FORMAT: $TENSOR_FORMAT" echo "format: $format" + # if tensor_format == "ss": $basedir/compiler/taco/build/bin/taco-test sam.pack_$format - + # else: + # $basedir/compiler/taco/build/bin/taco-test sam.pack_ echo "Name: $name" echo "Format: $format" echo "Bench: $bench" echo "Bench path: $bench_path" + echo "tile_path: $tile_path" + echo "tensor_format: $tensor_format" + echo "other_form: $other_form" python3 $basedir/scripts/formatting/datastructure_tns.py -n $name -f $format --other -b $bench -hw --output_dir $bench_path/formatted/$name @@ -117,5 +119,8 @@ for i in ${!FORMATS[@]}; do set_temp_env $old_frostt_formatted_taco_path $old_frostt_path $old_frostt_tensor_path $old_frostt_formatted_path chmod -R 775 $FROSTT_FORMATTED_PATH + done -done \ No newline at end of file +done + +docker cp tiles $5:/aha/garnet/tiles_$3