-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Operator] Adding CPU support for matrix multiplication #251
Conversation
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.
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.
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 |
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.
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>
Thanks @BolinSNLHM ! |
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>
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>
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>
No description provided.