-
Notifications
You must be signed in to change notification settings - Fork 89
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Coverage ReportCreated: 2024-10-25 14:52Click here for information about interpreting this report.
Generated by llvm-cov -- llvm version 14.0.0 |
How hard is it to generalize from 2d? |
@fifield Great question but I'm not sure... This needs some work before it's ready for merge due to some complexities with translating between the sizes/strides generated by the TensorTiler2D and the limitations in sizes/sizes allowed by the hardware. My plan right now is to get a bit more confident about the problem space in 2D (which is also easier to visualize) before moving on to something more complex. |
I believe this PR is ready to review. However, it contains two new notebooks so perhaps #1909 should be merged first. It also removes some tiling functions (which I believe are less featureful than what I've added). These functions are only used by unused examples, which may be removed entirely in a pending PR. So perhaps #1908 should also be merged first. |
CI is currently failing because lit test for notebooks assumes dependencies which are only added in #1909 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nitpick would be to add an overall README to the tiling_exploration
programming example directory.
Notes:
|
Description
This PR introduces some classes to help with data transformations/tiling and data visualization. The main classes introduced are:
TensorTile
: A class representing information for specifying a 'chunk' of data, suitable for use in describing anpu_dma_memcpy_nd
operation; also includes code for visualizing theTensorTile
.TensorTileSequence
: A wrapper class for a list ofTensorTile
s; also includes code for visualization (including animations).TensorTiler2D
: A class that helps with data tiling. Providessimple_tiler()
,group_tiler()
, andstep_tiler()
methods to aid in generating iterative patterns of tiling over the tensor.I also include:
test/python/tensortiler
dma_transpose
,matrix_scalar_add
,row_wise_bias_add
matrxi_multiplication/whole_array
) to show how to use theTensorTiler2D
programming_examples/basic/tiling_exploration
) and an introductory notebook that use the device to create an access order map that can be compared to the map provided by theTensorTiler2D
. These examples are meant to verify theTensorTiler2D
can produce valid access patterns but also illustrate how to use the tensor tiling code.npu_dma_memcpy_nd
to support taking aTensorTile
directly instead of sizes/strides/offsetSome incidental things that got included in this PR:
Note for future contributions
Notes
Credit to Andre for his really excellent tool here: https://andreroesti.com/data-layout-viz/data_layout.html
This is my attempt at making something similar that can be integrated into a development tool directly, with the additional step of generating sizes/strides for you.