jcf94 commented on a change in pull request #8605:
URL: https://github.com/apache/tvm/pull/8605#discussion_r681488070
##########
File path: include/tvm/relay/attrs/nn.h
##########
@@ -1047,12 +1047,15 @@ struct SparseTransposeAttrs : public
tvm::AttrsNode<SparseTransposeAttrs> {
/*! \brief Attributes for sparse_dense operator */
struct SparseConv2DAttrs : public tvm::AttrsNode<SparseConv2DAttrs> {
std::string layout;
+ int kernel_size;
Review comment:
Suggest to follow the definition of `Conv2DAttrs` to use
`Array<IndexExpr> kernel_size` here.
##########
File path: python/tvm/relay/analysis/sparse_conv2d.py
##########
@@ -108,19 +112,28 @@ def process_params(expr, params, block_size,
sparsity_threshold, layout):
)
else:
sparse_weight_data = sparse_weight.data
+ elif weight_kernel[0] == kernel_size == 3 and layout == "NHWC":
Review comment:
Only support NHWC here?
##########
File path: python/tvm/relay/data_dep_optimization/bsr_conv2d.py
##########
@@ -23,7 +23,7 @@
from .utils import _run_opt_pass
-def convert(func, params, blocksize, sparsity_threshold, layout="NHWC"):
+def convert(func, params, blocksize, sparsity_threshold, layout="NHWC",
kernel_size=1):
"""Convert a dense func and according parameters to block sparse
Review comment:
```suggestion
"""Convert a conv2d func and according parameters to block sparse
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]