Skip to content

Commit

Permalink
Merge pull request #965 from StanfordAHA/sparse_tiling
Browse files Browse the repository at this point in the history
tiling sparse matrices fixes
  • Loading branch information
kalhankoul96 committed May 31, 2023
2 parents 583c025 + 81dedf0 commit 246cc43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions SPARSE_TESTS/copy_formatted.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
import subprocess
import os

b_tensors = glob.glob("../matmul_ijk_ch7-6-b1/formatted/tensor_B*")
c_tensors = glob.glob("../matmul_ijk_ch7-6-b1/formatted/tensor_C*")
test = "relat5_tile20"

b_tensors = glob.glob(f"../matmul_ijk_{test}/formatted/tensor_B*")
c_tensors = glob.glob(f"../matmul_ijk_{test}/formatted/tensor_C*")

if not os.path.exists("./MAT_TMP_DIR"):
os.mkdir("./MAT_TMP_DIR")

os.system("rm -rf ./matmul*")
os.system("rm -rf ./MAT_TMP_DIR/tile*")
Expand Down Expand Up @@ -34,11 +39,11 @@

shutil.copy(f"{b}/B_shape.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_B_mode_shape")

shutil.copy(f"{c}/C0_crd.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_1_crd")
shutil.copy(f"{c}/C0_seg.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_1_seg")
shutil.copy(f"{c}/C0_crd.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_0_crd")
shutil.copy(f"{c}/C0_seg.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_0_seg")

shutil.copy(f"{c}/C1_crd.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_0_crd")
shutil.copy(f"{c}/C1_seg.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_0_seg")
shutil.copy(f"{c}/C1_crd.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_1_crd")
shutil.copy(f"{c}/C1_seg.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_1_seg")

shutil.copy(f"{c}/C_vals.txt", f"./MAT_TMP_DIR/{tile_str}/tensor_C_mode_vals")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_memory_core/build_tb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ def prepare_glb_collateral(glb_dir=None, bitstream=None, matrices_in=None, desig
"dimensionality": 1,
# "extent": [num_lines],
# HAX for testing against GLB
"extent": [num_lines * 10 + 500],
"extent": [2048],
"write_data_starting_addr": [0],
"write_data_stride": [1]
},
Expand Down

0 comments on commit 246cc43

Please sign in to comment.