-
Notifications
You must be signed in to change notification settings - Fork 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
common: promote sparse functionality #2328
base: main
Are you sure you want to change the base?
Conversation
7594c9c
to
21ae45b
Compare
9a0e698
to
90e3147
Compare
make test |
90e3147
to
ed97330
Compare
ed97330
to
4f503fa
Compare
make test |
// macro is defined. | ||
CPU_INSTANCE_SPARSE_X64(jit_uni_sparse_matmul_t) | ||
CPU_INSTANCE_SPARSE(ref_sparse_matmul_t) | ||
CPU_INSTANCE_X64(jit_uni_sparse_matmul_t) |
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.
Now, when the sparse functionality is not experimental, it is possible to pass sparse memory descriptors when creating any primitive and therefore it could lead to undefined behavior because only matmul and reorder primitives have corresponding checks for memory descriptors.
We need to add such checks to other primitives too.
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.
Just to expand, I think we should check that at primitive_desc create functions for most primitives.
@@ -75,7 +75,6 @@ dnnl_status_t DNNL_API dnnl_ocl_interop_memory_create(dnnl_memory_t *memory, | |||
const_dnnl_memory_desc_t memory_desc, dnnl_engine_t engine, | |||
dnnl_ocl_interop_memory_kind_t memory_kind, void *handle); | |||
|
|||
#ifdef DNNL_EXPERIMENTAL_SPARSE |
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.
We don't have get_mem_object
and set_mem_object
functions that would take indices. I don't think it's critical, but just need to have that in mind as we may have to add it later on.
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.
LGTM. Please address the issue with sparse reorder.
8b59600
to
965c9b1
Compare
363d4bb
to
04cdc16
Compare
04cdc16
to
8904c86
Compare
Promoting experimental sparse functionality - common structures and methods. Currently only CPU x64 matmul and reorder have sparse implementations, the rest is guarded by
is_dense_format_kind
call in pd init functions.