[Operator] Adding CPU support for matrix multiplication#251
Merged
yaoyaoding merged 114 commits intohidet-org:mainfrom May 28, 2023
Merged
[Operator] Adding CPU support for matrix multiplication#251yaoyaoding merged 114 commits intohidet-org:mainfrom
yaoyaoding merged 114 commits intohidet-org:mainfrom
Conversation
yaoyaoding
requested changes
May 27, 2023
Member
yaoyaoding
left a comment
There was a problem hiding this comment.
Thanks @BolinSNLHM! Nice to see that hidet is getting to have better support for cpu backend.
As your first PR, it looks great! I left some comments. Please also add a test case in hidet/tests/operators/test_matmul.py to test your new operator.
Comment on lines
+308
to
+314
| def matmul_kernel_x86(a_ptr: ~float32, b_ptr: ~float32, c_ptr: ~float32): | ||
| a = as_tensor_pointer(a_ptr, dtype=float32, shape=[m_size, k_size]) | ||
| b = as_tensor_pointer(b_ptr, dtype=float32, shape=[k_size, n_size]) | ||
| c = as_tensor_pointer(c_ptr, dtype=float32, shape=[m_size, n_size]) | ||
| mbs = (m_size + block_m - 1) // block_m | ||
| nbs = (n_size + block_n - 1) // block_n | ||
| kbs = (k_size + block_k - 1) // block_k |
Member
There was a problem hiding this comment.
If we declare kernel function in this way (use pointer as input instead of directly declare the input tensor), we will not support prologue/epilogue fusion. In this case, we should override the allow_prologue(...) and allow_epilogue(...) to return False. A better way is to disable prologue fusion and enable epilogue fusion, and decalre c as the tensor directly in the parameter list.
Co-authored-by: Yaoyao Ding <dingyaoyao.cs@gmail.com>
Co-authored-by: Yaoyao Ding <dingyaoyao.cs@gmail.com>
yaoyaoding
approved these changes
May 28, 2023
Member
|
Thanks @BolinSNLHM ! |
vadiklyutiy
pushed a commit
that referenced
this pull request
Jul 22, 2024
Added advanced tensor indexing. I had to create a new task called "AdvancedIndexingTask". Otherwise it will not work with dynamic shapes. --------- Co-authored-by: Zhumakhan <nazirzhumakhan@gmail,.com>
vadiklyutiy
pushed a commit
that referenced
this pull request
Jul 23, 2024
Added advanced tensor indexing. I had to create a new task called "AdvancedIndexingTask". Otherwise it will not work with dynamic shapes. --------- Co-authored-by: Zhumakhan <nazirzhumakhan@gmail,.com>
vadiklyutiy
pushed a commit
that referenced
this pull request
Dec 26, 2024
Added advanced tensor indexing. I had to create a new task called "AdvancedIndexingTask". Otherwise it will not work with dynamic shapes. --------- Co-authored-by: Zhumakhan <nazirzhumakhan@gmail,.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.