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

TilerHelper and 2D Tiling Visualizations #1870

Merged
merged 140 commits into from
Nov 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
747ca3a
First version of tensor tiler
hunhoffe Oct 21, 2024
e5518fa
Merge branch 'main' into tiler-helper
hunhoffe Oct 21, 2024
1f86f05
Add some tests for the tiler
hunhoffe Oct 21, 2024
39e0a5d
Some improvements
hunhoffe Oct 21, 2024
03a0741
Merge branch 'main' into tiler-helper
hunhoffe Oct 22, 2024
8d67307
Some small improvements to tensortiler
hunhoffe Oct 22, 2024
637e314
Stub out example
hunhoffe Oct 22, 2024
d18a2ef
Added simple tiling examples
hunhoffe Oct 22, 2024
3c8ffb3
Merge branch 'main' into tiler-helper
hunhoffe Oct 22, 2024
d293c96
Update programming_examples/basic/tiling_exploration/per_tile/aie2.py
hunhoffe Oct 22, 2024
9c2ce5f
Fix makefile typos
hunhoffe Oct 22, 2024
2a3a484
Add tensor tiler tests
hunhoffe Oct 22, 2024
a47df3a
a couple more tests
hunhoffe Oct 22, 2024
babf9e7
Add a few more tests, remove template
hunhoffe Oct 22, 2024
46a487c
Add one more test
hunhoffe Oct 22, 2024
1071ee0
make tensortile test formatting a bit more sane
hunhoffe Oct 22, 2024
192194d
More python formatting
hunhoffe Oct 22, 2024
4f9656a
A few more tests
hunhoffe Oct 22, 2024
34ea2d8
Merge branch 'main' into tiler-helper
hunhoffe Oct 22, 2024
e437776
add visualization example
hunhoffe Oct 22, 2024
c744299
caption more correctly
hunhoffe Oct 22, 2024
d51e5c8
A bit of progress towards matrix_vector
hunhoffe Oct 23, 2024
87df9a7
Merge branch 'main' into tiler-helper
hunhoffe Oct 23, 2024
3bb4d19
Merge branch 'main' into tiler-helper
hunhoffe Oct 25, 2024
c4d2071
Updates from erika-iron-brainstorming branch
hunhoffe Oct 25, 2024
7b08c1a
Merge branch 'main' into tiler-helper
hunhoffe Oct 25, 2024
b08eebf
python format
hunhoffe Oct 25, 2024
06716e1
Add some visualization of access count (in addition to existing acces…
hunhoffe Oct 25, 2024
7f91465
Merge branch 'main' into tiler-helper
hunhoffe Oct 28, 2024
64879eb
Fix up tests after access count visualization changes
hunhoffe Oct 28, 2024
9accb78
Try to simplify form of sizes/strides by collapses stride value which…
hunhoffe Oct 28, 2024
6ad0860
Rename chunk to tile_group; repeat working in initial tests
hunhoffe Oct 28, 2024
864c72e
Missed adding in previous commit
hunhoffe Oct 28, 2024
db8fe9b
Some refinement for repeat count
hunhoffe Oct 28, 2024
0cf026a
Complete matrix vector tiling sweep test
hunhoffe Oct 28, 2024
eeec0a9
npu_dma_memcpy_nd take TensorTile, some repeat tests
hunhoffe Oct 28, 2024
ec47d34
More tile repeat tests
hunhoffe Oct 28, 2024
516803b
Finish tile repeat test suite
hunhoffe Oct 28, 2024
0d93ac0
Fix bad change from a few commits ago
hunhoffe Oct 28, 2024
364b0a4
Fix another bad change from a few commits ago
hunhoffe Oct 28, 2024
854de4d
First attempt at tile step in tile helper
hunhoffe Oct 30, 2024
100b866
Saving progress
hunhoffe Oct 30, 2024
00e632e
Add test file, will remove later
hunhoffe Oct 30, 2024
108fa81
Merge branch 'main' into tiler-helper
hunhoffe Oct 30, 2024
6dfd1db
move scratch file to somewhere less disruptive
hunhoffe Oct 31, 2024
17f4125
Disable tensor tiler 2d mat mul whole array test (for now)
hunhoffe Oct 31, 2024
d758e6a
Merge branch 'main' into tiler-helper
hunhoffe Oct 31, 2024
b2685bc
Add notes for how to proceed with impl
hunhoffe Oct 31, 2024
f104e7a
First step of tiler cleanup
hunhoffe Nov 1, 2024
246df71
Saving progress
hunhoffe Nov 1, 2024
38d7465
plot size based on tensor dims
hunhoffe Nov 1, 2024
64f99c7
access order looks nice even with larger tensors
hunhoffe Nov 2, 2024
def3c0e
Add experimentation notebook, will probably delete later
hunhoffe Nov 2, 2024
a783ef7
simpler_tiler appears functional
hunhoffe Nov 2, 2024
bd22201
tile sequence access order visualization seems good
hunhoffe Nov 2, 2024
b95b1a6
forgot to add init file
hunhoffe Nov 2, 2024
7f242d9
Animation is working in notebook but not in visualization
hunhoffe Nov 2, 2024
821ace1
Saving progress
hunhoffe Nov 2, 2024
f2c70a3
Just starting to test tile groups
hunhoffe Nov 2, 2024
59836c2
update to tiling speed
hunhoffe Nov 2, 2024
b375cdb
some tile groups working
hunhoffe Nov 2, 2024
0cf2dea
Better sizes for partial
hunhoffe Nov 4, 2024
38f6105
fixed some bugs with partial tile groups
hunhoffe Nov 4, 2024
a83149a
Seems to be working for step iteration without partial and without re…
hunhoffe Nov 4, 2024
07462cb
Fix bug
hunhoffe Nov 4, 2024
32fc56d
Step partial not implemented yet, but the rest seems good
hunhoffe Nov 4, 2024
4153d8d
Remove old code
hunhoffe Nov 4, 2024
aeeebc1
Move new code over to prepare for testing
hunhoffe Nov 4, 2024
0c34136
Fix file paths
hunhoffe Nov 4, 2024
6e6c223
add first few new tests
hunhoffe Nov 4, 2024
b50a5e3
Tests for simple tiler
hunhoffe Nov 4, 2024
a7a5e1c
Remove notebook
hunhoffe Nov 4, 2024
16abd03
Merge branch 'main' into tiler-helper
hunhoffe Nov 4, 2024
827a1e0
Remove old tests, first group of group_tiler tests
hunhoffe Nov 4, 2024
f5039f8
Small iterations on tests
hunhoffe Nov 4, 2024
f9202c2
Small iterations on tests
hunhoffe Nov 4, 2024
48cb941
Add some partial tests
hunhoffe Nov 5, 2024
beb4478
Add more partial tests
hunhoffe Nov 5, 2024
ba191dd
Finish partial tests for now
hunhoffe Nov 5, 2024
f406042
Add checks for type of pattern_repeat
hunhoffe Nov 5, 2024
22b793f
some unchecked changes
hunhoffe Nov 5, 2024
9d02033
fix small bugs
hunhoffe Nov 6, 2024
a821ef5
code simplification is mostly done
hunhoffe Nov 7, 2024
27e7fa6
Start fixing up number of dimensions
hunhoffe Nov 7, 2024
8cea0a6
Try to reduce hard-coded dimensions in 2d tiler
hunhoffe Nov 7, 2024
a5813b5
reduce hardcoded dimensionality a little bit more
hunhoffe Nov 7, 2024
a125ea1
small improvements for testing
hunhoffe Nov 7, 2024
d86ac40
Add first tests for step tiler
hunhoffe Nov 7, 2024
fa803af
Finish step tiler without partial tests
hunhoffe Nov 7, 2024
eca45bf
stub out step tiler partial
hunhoffe Nov 7, 2024
86891f2
Access tensors from tile sequence
hunhoffe Nov 7, 2024
6a6ed95
Add access tensor checks to simple tiler tests
hunhoffe Nov 7, 2024
2b06819
Improving group tiler tests
hunhoffe Nov 7, 2024
cf130b6
Finished extensions to group_tiler test
hunhoffe Nov 7, 2024
c2b8b7c
add tensor checks for some of group tiler partial
hunhoffe Nov 7, 2024
4518109
Add tensor tests to more of the group tiler partial
hunhoffe Nov 7, 2024
6dd3ad6
finished adding tensor checks to group tiler partial tests
hunhoffe Nov 7, 2024
02191ae
add tensor checks to the step tiler
hunhoffe Nov 7, 2024
c853b1d
fix one bug, there is at least one more bug though
hunhoffe Nov 7, 2024
92744af
First partial step tiler test
hunhoffe Nov 7, 2024
46f8e80
more step tiler partial tests
hunhoffe Nov 7, 2024
3bf4088
add step tiler partial col test
hunhoffe Nov 7, 2024
7d6eb83
stub out step tiler partial row and both tests
hunhoffe Nov 7, 2024
05325df
More tiler partial row tests
hunhoffe Nov 7, 2024
c2303dc
finish step tiler partial row tests
hunhoffe Nov 7, 2024
b40af01
Merge branch 'main' into tiler-helper
hunhoffe Nov 8, 2024
ae301de
Start porting older tests to new tensortiler interface
hunhoffe Nov 8, 2024
9dc3a2b
Finish adding old tests (including matvec) to tensortiler lit tests
hunhoffe Nov 8, 2024
4f4671a
Stub out outline for matmul whole array tiling sweep test
hunhoffe Nov 8, 2024
cc58804
Mat mul sweep is working, clean up other tests, address test performance
hunhoffe Nov 11, 2024
cb62f2b
Merge branch 'main' into tiler-helper
hunhoffe Nov 11, 2024
570d455
Start updating some examples
hunhoffe Nov 12, 2024
9d0ab4e
fix format
hunhoffe Nov 12, 2024
26d14a1
update dma transpose example
hunhoffe Nov 12, 2024
4e198ac
Fix another example
hunhoffe Nov 12, 2024
e77567a
Merge branch 'main' into tiler-helper
hunhoffe Nov 12, 2024
c4027ca
Merge branch 'main' into tiler-helper
hunhoffe Nov 12, 2024
73d89e8
Continue fixing up examples
hunhoffe Nov 12, 2024
ca4f1ff
Make diagram clearer
hunhoffe Nov 12, 2024
13d072b
Finish documenting tiling exploration examples
hunhoffe Nov 12, 2024
c1f3d62
fix up readme for tile group example
hunhoffe Nov 12, 2024
9612dbc
Start adding visualization to matmul whole array
hunhoffe Nov 12, 2024
dc46323
Add visualization notebook for mat mul whole array
hunhoffe Nov 12, 2024
6d39b61
Fix py formatting
hunhoffe Nov 12, 2024
0ab222a
Remove unused tiling functions
hunhoffe Nov 12, 2024
7703aa2
Add tiling tools overview notebook
hunhoffe Nov 12, 2024
18476ec
Merge branch 'main' into tiler-helper
hunhoffe Nov 12, 2024
029010c
Merge branch 'main' into tiler-helper
hunhoffe Nov 13, 2024
acbb79d
Add tilerhelper how-to notebook to CI testing, add README
hunhoffe Nov 13, 2024
f9ecca1
Add documentation for the matrix multiplication visualization notebook
hunhoffe Nov 13, 2024
501cd4b
Merge branch 'main' into tiler-helper
hunhoffe Nov 13, 2024
3315246
Added comments to explain TensorTile additions in mat mul whole_array…
hunhoffe Nov 13, 2024
bb2a8c1
Merge branch 'main' into tiler-helper
hunhoffe Nov 13, 2024
3c683f3
Strip output from notebooks
hunhoffe Nov 13, 2024
d7fab49
Add top-level tiling_exploration README
hunhoffe Nov 14, 2024
ff2e876
Merge branch 'main' into tiler-helper
hunhoffe Nov 14, 2024
1f6d58f
Merge branch 'main' into tiler-helper
hunhoffe Nov 14, 2024
d5ec744
Merge branch 'main' into tiler-helper
hunhoffe Nov 15, 2024
5ea9e38
Merge branch 'main' into tiler-helper
hunhoffe Nov 16, 2024
04e7e4b
Merge branch 'main' into tiler-helper
hunhoffe Nov 18, 2024
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
Prev Previous commit
Next Next commit
Rename chunk to tile_group; repeat working in initial tests
hunhoffe committed Oct 28, 2024
commit 6ad086019ce673ce62a86ee1eda3cf5a10e98dde
4 changes: 3 additions & 1 deletion programming_examples/basic/dma_transpose/aie2.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,9 @@ def my_passthrough(M, K, N, generate_acccess_map=False):
offset=0,
)
if generate_acccess_map:
data_transform.visualize(file_path="transpose_data.png")
data_transform.visualize(
plot_access_count=False, file_path="transpose_data.png"
)
return

with mlir_mod_ctx() as ctx:
4 changes: 2 additions & 2 deletions programming_examples/basic/row_wise_bias_add/aie2.py
Original file line number Diff line number Diff line change
@@ -51,10 +51,10 @@ def core_body():

tiler = TensorTiler2D(M, N, m, n, tensor_col_major=True)
t = next(
tiler.tile_iter(chunk_height=M // m, chunk_width=N // n)
tiler.tile_iter(tile_group_height=M // m, tile_group_width=N // n)
) # Transfer all tiles at once
bias_tiler = TensorTiler2D(1, N, 1, n)
bias_t = next(bias_tiler.tile_iter(chunk_width=N // n))
bias_t = next(bias_tiler.tile_iter(tile_group_width=N // n))

@runtime_sequence(tensor_ty, bias_ty, tensor_ty)
def sequence(inp, bias, out):
142 changes: 72 additions & 70 deletions python/helpers/tensortiler/tensortiler2d.py
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ def visualize(
show_numbers: bool = False,
file_path: str | None = None,
show_plot: bool = True,
plot_access_count: bool = False,
) -> None:
TensorTiler2D.generate_access_graphs(
self.tensor_height,
@@ -41,28 +42,25 @@ def visualize(
show_numbers=show_numbers,
file_path=file_path,
show_plot=show_plot,
plot_access_count=plot_access_count,
)

def access_tensors(
self, allow_repeat=False
) -> tuple[np.ndarray, np.ndarray | None]:
def access_tensors(self) -> tuple[np.ndarray, np.ndarray]:
return TensorTiler2D.get_access_tensors(
self.tensor_height,
self.tensor_width,
self.sizes,
self.strides,
offset=self.offset,
allow_repeat=allow_repeat,
)

def access_order(self, allow_repeat=False) -> np.ndarray:
def access_order(self) -> np.ndarray:
return TensorTiler2D.get_access_tensors(
self.tensor_height,
self.tensor_width,
self.sizes,
self.strides,
offset=self.offset,
allow_repeat=allow_repeat,
)[0]

def access_count(self) -> np.ndarray:
@@ -72,7 +70,6 @@ def access_count(self) -> np.ndarray:
self.sizes,
self.strides,
offset=self.offset,
allow_repeat=True,
)[1]

def __str__(self) -> str:
@@ -238,49 +235,59 @@ def strides(self) -> list[int]:

def tile_iter(
self,
chunk_height: int = 1,
chunk_width: int = 1,
tile_group_height: int = 1,
tile_group_width: int = 1,
tile_repeat: int = 1,
col_major: bool = False,
) -> TensorTile2DIter:
assert (
self._num_tiles_per_row % chunk_width == 0
), f"Tiles per row ({self._num_tiles_per_row}) must be divisible by chunk width ({chunk_width})"
tile_group_height >= 1 and tile_group_width >= 1 and tile_repeat >= 1
), f"Tile group height, Tile group width, tile repeat ({tile_group_height}, {tile_group_width}, {tile_repeat}) must be >0"
assert (
self._num_tiles_per_row % tile_group_width == 0
), f"Tiles per row ({self._num_tiles_per_row}) must be divisible by Tile group width ({tile_group_width})"
assert (
self._num_tiles_per_col % chunk_height == 0
), f"Tiles per row ({self._num_tiles_per_col}) must be divisible by chunk width ({chunk_height})"
self._num_tiles_per_col % tile_group_height == 0
), f"Tiles per row ({self._num_tiles_per_col}) must be divisible by Tile group width ({tile_group_height})"
if tile_group_height > 1 or tile_group_width > 1:
assert (
tile_repeat == 1
), "[Under Development] Tile repeat only supported with tile_group_height, tile_group_width = 1, 1"

chunks_per_row = self._num_tiles_per_row // chunk_width
chunks_per_col = self._num_tiles_per_col // chunk_height
tile_groups_per_row = self._num_tiles_per_row // tile_group_width
tile_groups_per_col = self._num_tiles_per_col // tile_group_height

steps = chunks_per_row * chunks_per_col
steps = tile_groups_per_row * tile_groups_per_col

def calc_offset(iter_num):
if not col_major:
row_idx = iter_num % chunks_per_row
col_idx = iter_num // chunks_per_row
row_idx = iter_num % tile_groups_per_row
col_idx = iter_num // tile_groups_per_row
else:
col_idx = iter_num % chunks_per_col
row_idx = iter_num // chunks_per_col
col_idx = iter_num % tile_groups_per_col
row_idx = iter_num // tile_groups_per_col

offset = row_idx * chunk_width * self._tile_width
offset += col_idx * chunk_height * self._tensor_width * self._tile_height
offset = row_idx * tile_group_width * self._tile_width
offset += (
col_idx * tile_group_height * self._tensor_width * self._tile_height
)
return offset

iter_sizes = self._sizes.copy()
iter_strides = self._strides.copy()

if self._tile_col_major and not self._tensor_col_major:
# This is a special case where we can combine a chunk into one logical tile (horizontally)
iter_sizes[1] = chunk_height
iter_sizes[2] = chunk_width * self._tile_width
# This is a special case where we can combine a tile group into one logical tile (horizontally)
iter_sizes[1] = tile_group_height
iter_sizes[2] = tile_group_width * self._tile_width
elif not self._tile_col_major and self._tensor_col_major:
# This is a special case where we can combine a chunk into one logical tile (vertically)
iter_sizes[1] = chunk_width
iter_sizes[2] = chunk_height * self._tile_height
elif chunk_width == 1:
# This is a special case where we can combine a tile group into one logical tile (vertically)
iter_sizes[1] = tile_group_width
iter_sizes[2] = tile_group_height * self._tile_height
elif tile_group_width == 1:
# These are two more special cases; we can combine tiles here too to get a simpler transform
if self._tile_col_major:
iter_sizes = [1, chunk_height, self._tile_width, self._tile_height]
iter_sizes = [1, tile_group_height, self._tile_width, self._tile_height]
iter_strides = [
1,
self._tile_height * self._tensor_width,
@@ -291,31 +298,45 @@ def calc_offset(iter_num):
iter_sizes = [
1,
1,
self._tile_height * chunk_height,
self._tile_height * tile_group_height,
self._tile_width,
]
iter_strides = [1, self._tile_width, self._tensor_width, 1]
elif chunk_height == 1:
elif tile_group_height == 1:
# These are two more special cases; we can combine tiles here too to get a simpler transform
if self._tile_col_major:
iter_sizes = [1, 1, self._tile_width * chunk_width, self._tile_height]
iter_sizes = [
1,
1,
self._tile_width * tile_group_width,
self._tile_height,
]
iter_strides = [1, 1, 1, self._tensor_width]
else:
iter_sizes = [1, chunk_width, self._tile_height, self._tile_width]
iter_sizes = [1, tile_group_width, self._tile_height, self._tile_width]
iter_strides = [1, self._tile_width, self._tensor_width, 1]
else:
# This should always be the case that creates a correct transfrom;
# however, it may be needlessly complex (large values in out dimensions)
size_idx = [0, 1]
if self._tensor_col_major:
size_idx = [1, 0]
iter_sizes[size_idx[0]] = chunk_height
iter_sizes[size_idx[1]] = chunk_width
iter_sizes[size_idx[0]] = tile_group_height
iter_sizes[size_idx[1]] = tile_group_width

iter_sizes, iter_strides = self._validate_and_clean_sizes_strides(
iter_sizes, iter_strides
)

if tile_repeat != 1:
assert (
iter_sizes[0] == 1
), "[Under Development] Highest size dim must be 1 for tile repeat"
assert (
iter_strides[0] == 0
), "[Under Development] Highest strides dim must be 0 for tile repeat"
iter_sizes[0] = tile_repeat

return TensorTile2DIter(
self._tensor_height,
self._tensor_width,
@@ -374,7 +395,9 @@ def _generate_access_graphs_from_tensor(
for j in range(access_order_tensor.shape[1]):
if access_order_tensor[i, j] != -1:
order_dict[access_order_tensor[i, j]] = (i, j)
for i in range(len(order_dict) - 1):
order_keys = list(order_dict.keys())
order_keys.sort()
for i in range(order_keys[0], order_keys[-1]):
y1, x1 = order_dict[i]
y2, x2 = order_dict[i + 1]
ax_order.arrow(
@@ -462,8 +485,7 @@ def get_access_tensors(
tile_height: int | None = None,
tile_width: int | None = None,
offset: int = 0,
allow_repeat: bool = False,
) -> (np.ndarray, np.ndarray | None):
) -> tuple[np.ndarray, np.ndarray | None]:
assert tensor_height > 0 and tensor_width > 0, "Tensor dimensions must be > 0"
assert len(sizes) == 4, "Sizes should be a list of size 4"
assert len(strides) == 4, "Strides should be a list of size 4"
@@ -478,12 +500,9 @@ def get_access_tensors(
)

# Create access count map (if repeat allowed)
if allow_repeat:
access_count_tensor = np.full(
(tensor_height * tensor_width,), 0, dtype=cls.DTYPE
)
else:
access_count_tensor = None
access_count_tensor = np.full(
(tensor_height * tensor_width,), 0, dtype=cls.DTYPE
)

access_count = 0
for i in range(sizes[0]):
@@ -497,24 +516,12 @@ def get_access_tensors(
+ k * strides[2]
+ l * strides[3]
)
if not allow_repeat:
assert (
access_order_tensor[access_idx] == -1
), f"Attempted to access index={access_idx} twice."
else:
access_count_tensor[access_idx] += 1
access_count_tensor[access_idx] += 1
access_order_tensor[access_idx] = access_count
access_count += 1
if not allow_repeat:
assert access_count <= np.prod(
access_order_tensor.shape
), f"Access pattern has too many elements (expected max {np.prod(access_order_tensor.shape)}, got {access_count})"

access_order_tensor = access_order_tensor.reshape((tensor_height, tensor_width))
if allow_repeat:
access_count_tensor = access_count_tensor.reshape(
(tensor_height, tensor_width)
)
access_count_tensor = access_count_tensor.reshape((tensor_height, tensor_width))
return access_order_tensor, access_count_tensor

@classmethod
@@ -531,7 +538,7 @@ def generate_access_graphs(
show_numbers: bool = False,
file_path: str | None = None,
show_plot: bool = True,
allow_repeat: bool = False,
plot_access_count: bool = False,
):
access_order_tensor, access_count_tensor = cls.get_access_tensors(
tensor_height,
@@ -541,7 +548,6 @@ def generate_access_graphs(
tile_height=tile_height,
tile_width=tile_width,
offset=offset,
allow_repeat=allow_repeat,
)

# Show a graph for a single tile
@@ -554,7 +560,7 @@ def generate_access_graphs(
access_order_tensor[0:tile_height, 0:tile_width],
(
None
if not allow_repeat
if not plot_access_count
else access_count_tensor[0:tile_height, 0:tile_width]
),
title="Per-Tile Access Order",
@@ -566,7 +572,7 @@ def generate_access_graphs(

cls._generate_access_graphs_from_tensor(
access_order_tensor,
access_count_tensor,
(None if not plot_access_count else access_count_tensor),
show_arrows=show_arrows,
show_numbers=show_numbers,
file_path=file_path,
@@ -607,7 +613,7 @@ def visualize(
show_numbers: bool = False,
file_path: str | None = None,
show_plot: bool = True,
allow_repeat: bool = False,
plot_access_count: bool = False,
) -> None:
tile_height = self._tile_height if show_tile else None
tile_width = self._tile_width if show_tile else None
@@ -622,29 +628,25 @@ def visualize(
show_numbers=show_numbers,
file_path=file_path,
show_plot=show_plot,
allow_repeat=allow_repeat,
plot_access_count=plot_access_count,
)

def access_order(self, allow_repeat: bool = False) -> np.ndarray:
# Call class method
def access_order(self) -> np.ndarray:
return self.get_access_tensors(
self._tensor_height,
self._tensor_width,
self._sizes,
self._strides,
self._tile_height,
self._tile_width,
allow_repeat=allow_repeat,
)[0]

def access_count(self) -> np.ndarray:
# Call class method
return self.get_access_tensors(
self._tensor_height,
self._tensor_width,
self._sizes,
self._strides,
self._tile_height,
self._tile_width,
allow_repeat=True,
)[1]
2 changes: 1 addition & 1 deletion test/python/tensortiler2d/matrix_vector_tiling_sweep.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ def matrix_vector_tiling_sweep():
tensor_height=M, tensor_width=K, tile_height=m, tile_width=k
)
A_tile_iter = A_tiler.tile_iter(
chunk_height=M_div_m_div_n_cores, chunk_width=K // k
tile_group_height=M_div_m_div_n_cores, tile_group_width=K // k
)

C_tiler = TensorTiler2D(
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
# RUN: %python %s | FileCheck %s


# CHECK-LABEL: square_tiler_col_major_tensor_and_tile_tile_chunking
# CHECK-LABEL: square_tiler_col_major_tensor_and_tile_tile_grouping
@construct_test
def square_tiler_col_major_tensor_and_tile_tile_chunking():
def square_tiler_col_major_tensor_and_tile_tile_grouping():
tiler = TensorTiler2D(32, 32, 4, 4, tensor_col_major=True, tile_col_major=True)
access_order = tiler.access_order()
reference_access = np.array(
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
# RUN: %python %s | FileCheck %s


# CHECK-LABEL: square_tiler_col_major_tensor_tile_chunking_rectangular_col_major_chunks
# CHECK-LABEL: square_tiler_col_major_tensor_tile_grouping_rectangular_col_major_grups
@construct_test
def square_tiler_col_major_tensor_tile_chunking_rectangular_col_major_chunks():
def square_tiler_col_major_tensor_tile_grouping_rectangular_col_major_groups():
tiler = TensorTiler2D(16, 16, 4, 4, tensor_col_major=True)
access_order = tiler.access_order()
reference_access = np.array(
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
# RUN: %python %s | FileCheck %s


# CHECK-LABEL: square_tiler_tile_chunking
# CHECK-LABEL: square_tiler_tile_grouping
@construct_test
def square_tiler_tile_chunking():
def square_tiler_tile_grouping():
tiler = TensorTiler2D(32, 32, 8, 8)
access_order = tiler.access_order()
reference_access = np.array(
Loading