-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make packing of GEMM inputs more flexible
Previously the GEMM code assumed that data would be packed in the same format as the LHS / RHS input types, and with a fixed layout. To support new data types, especially int8, more flexibility will be needed. - int8 matmuls using dot product rather than FMA instructions will use a different blocked layout - For some architectures / data types it will make sense to expand inputs to a wider data type during packing rather than in the kernel - For some architectures / data types the kernel can operate on an unpacked LHS matrix, if it has unit column stride. For others packing will always be required. To enable this: - Add `Kernel` methods which return descriptors specifying the size and alignment required for packing a particular A or B input. - Modify kernel interface to use opaque `[u8]` slices for packing buffer contents. The kernel implementations will cast this to a slice of the type they use internally. - Add a `PackingBuffer` struct which wraps a `Vec<u32>` buffer and provides an API for reserving space in the buffer and casting its contents to `[u8]` slices for the kernel and its packing methods. The `PackedAMatrix` and `PackedBMatrix` types still have assumptions about the internal layout of packed buffers which will need to removed. That will happen in subsequent commits.
- Loading branch information
1 parent
9373e69
commit 42b75a1
Showing
9 changed files
with
469 additions
and
166 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.