Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping to cgra tensor debug #111

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sam/sim/src/tiling/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
41 changes: 28 additions & 13 deletions scripts/formatting/generate_tensor_tile_formats_onyx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#SBATCH -N 1
#SBATCH -t 360

# ./scripts/generate_frostt_formats_onyx.sh <tensor_name.txt>
# edit tensor_name.txt with tensors to tile
# ./scripts/generate_frostt_formats_onyx.sh <tensor_name.txt> <yaml_file> <benchmark> <other_format> <docker name>

shopt -s extglob

Expand All @@ -15,22 +16,17 @@ BENCHMARKS=(
# tensor3_elemadd
# tensor3_innerprod
# tensor3_mttkrp
tensor3_ttm
# tensor3_ttm
$3
# tensor3_ttm
# tensor3_mttkrp
# tensor3_elemmul
# tensor3_mttkrp
)

OTHER_FORMATS=(
# sss
# sss
# s
ss
# ss
# sss
# ss
)
$4
)

OTHERBENCHES='["tensor3_ttv", "tensor3_ttm", "tensor3_mttkrp"]'

Expand All @@ -55,6 +51,7 @@ run_format(){
bench_path=$4
tile_path=$5
tensor_format=$6
other_form=$7

basedir=$(pwd)
echo "Processing $f"
Expand All @@ -67,9 +64,24 @@ 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"

# 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

Expand Down Expand Up @@ -107,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
done

docker cp tiles $5:/aha/garnet/tiles_$3
Loading