[FEAT] MatMul API #871
Conversation
yshekel
left a comment
There was a problem hiding this comment.
Structure looks good for generalized mat-mul
I think not what we need in labrador (its Rq elements there in NTT domain) but we can start from that, @LeonHibnik ?
yshekel
left a comment
There was a problem hiding this comment.
Good work, I left a few comments.
|
|
||
| // Process each matrix A in the batch with the same B matrix | ||
| for (size_t i = 0; i < batch_size; i++) { | ||
| ICICLE_CHECK(matrix_mult( |
There was a problem hiding this comment.
Why do you need a batch in this test? The API doesn't support it (and it is not required)
yshekel
left a comment
There was a problem hiding this comment.
Looks good, great tests but two problems:
(1) missing cpu implementation
(2) missing tests and code for PolyRing type
LeonHibnik
left a comment
There was a problem hiding this comment.
Looks good overall, left some comments.
I think we should move the matmul and transpose implementations from vecops to matops, open to a discussion
| // Naive algorithm using taskflow | ||
|
|
||
| // Divide the problem among workers | ||
| const int nof_workers = 10; // get_nof_workers(config); |
There was a problem hiding this comment.
Why is the nof_workers hardcoded?
| for (uint32_t j = 0; j < nof_cols_b; j++) { | ||
| // Initialize result element | ||
| uint64_t a_idx = config.columns_batch ? (i * nof_cols_a + 0) * stride : i * nof_cols_a + 0; | ||
| uint64_t b_idx = config.columns_batch ? (0 * nof_cols_b + j) * stride : 0 * nof_cols_b + j; |
There was a problem hiding this comment.
Why is nof_cols_b here?
There was a problem hiding this comment.
legibility, to keep it analogous to the loop body below
| for (uint32_t i = row_start; i < row_end; i++) { | ||
| for (uint32_t j = 0; j < nof_cols_b; j++) { | ||
| // Initialize result element | ||
| uint64_t a_idx = config.columns_batch ? (i * nof_cols_a + 0) * stride : i * nof_cols_a + 0; |
There was a problem hiding this comment.
Remove the + 0 and add a comment explaining it
Co-authored-by: LNM <lisa@ingonyama.com> Co-authored-by: yshekel <yshekel@gmail.com>
|
Nice |
cuda-backend-branch: lisa/matmul