-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[QST] question about layout #1183
Comments
The chat GPT explanation is true only for compact matrices with canonical layouts. The statement no longer holds true if the layout is no longer compact or canonical row/col major |
"Thank you very much for your response. I apologize for my lack of experience; I'm not quite sure when non-compact matrices and non-canonical row major or column major would be used. Could you provide an example?" |
interleaved gemm is an example. it is supported by both cutlass and cublas (https://github.com/NVIDIA/cutlass/blob/main/include/cutlass/layout/matrix.h#L255). in dl, we can set leading dimension to be different from the problem size so that we can implicitly split a gemm into several small gemms and call batch gemm directly. e.g. the original big gemm is M x N. the real problem size of the small gemm is M x (N / 3). we can then set the leading dimension to be N, but problem size still be N / 3 to use batch gemm. |
I'm very sorry, please forgive my ignorance. I don't understand why splitting an MxN GEMM into three MxN/3 GEMMs as batches would improve performance. |
otherwise, you need to explictily split the matrix into three smaller ones.
that url uses interleaved layout, not canonical row or column major layout. |
I have solved my problem,thanks |
What is your question?
I believe I may have a misunderstanding of the concepts of layout and leading dimension.
My understanding of the leading dimension comes from the responses provided by ChatGPT.
The following is ChatGPT's explanation of the leading dimension:
"Specifically, for a matrix A(m x n), its leading dimension is lda (for column-major order, i.e., column-wise storage, it is m; for row-major order, i.e., row-wise storage, it is n)."
So my question is: since it's possible to determine whether a matrix is row-major or column-major by the size of the leading dimension (whether it's the size of the first or second dimension of the matrix), why is it still necessary to explicitly specify whether a matrix is row-major or column-major?
The text was updated successfully, but these errors were encountered: