ibsidorenko commented on PR #13327:
URL: https://github.com/apache/tvm/pull/13327#issuecomment-1458536268
Hello, @vinx13 !
I have one question about this PR... Is it possible to give more information
or motivation about why do we need to convert indexes into "int64" data type?
A few words about why I am asking:
I am working on MetaScheduler for Hexagon target. And found that this PR
dramatically reduce performance for some operations.
**Example**: Average Pooling 2D
For this operator we use indexes in its compute function and pool2d divisor.
**Before IndexDataTypeNormalizer**:
`pool_avg[ax0, ax1, ax2, ax3, ax4] = (pool_sum[ax0, ax1, ax2, ax3, ax4] /
max((((min(1, (34 - ax2)) + 2) - max((1 - ax2), 0))*((min(1, (34 - ax3)) + 2) -
max((1 - ax3), 0))), 1))`
**After IndexDataTypeNormalizer:**
`pool_avg[ax0, ax1, ax2, ax3, ax4] = cast(int32, (cast(int64, pool_sum[ax0,
ax1, ax2, ax3, ax4]) / max((((min(1i64, (34i64 - ax2)) + 2i64) - max((1i64 -
ax2), 0i64))*((min(1i64, (34i64 - ax3)) + 2i64) - max((1i64 - ax3), 0i64))),
1i64)))`
As you can see we get extra cast("int64"). Unfortunately, Hexagon does not
support vectorization of "int64" data types and performance became very very
poor.
P.S. Just for experiment I have reverted conversion of indexes into int64
and get performance gain **+40%** (!!!).
So, I would like to fix it somehow but I would like to know motivation for
this PR.
Thank you in advance!
Just FYI cc @masahi
--
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]