Uh oh!
There was an error while loading. Please reload this page.
[CUDA][PASS]Legalize tensorcore - #7147
Conversation
Uh oh!
There was an error while loading. Please reload this page.
jwfromm
left a comment
There was a problem hiding this comment.
Thanks for your contribution! I like the idea of padding to make other shapes work on tensorcore, but I think its important that you add some tests to confirm this features works as expected before we consider merging.
Uh oh!
There was an error while loading. Please reload this page.
Conflicts: python/tvm/topi/nn/batch_matmul.py python/tvm/topi/nn/dense.py
7bf253c to
25dac28CompareMeteorix
commented
Jan 25, 2021
Uh oh!
There was an error while loading. Please reload this page.
| return entry if isinstance(expr, relay.Function) else entry.body | ||
| def test_legalize_conv2d(data_shape, kernel_shape, pad_shape, do_pad=True): |
There was a problem hiding this comment.
Please reference test_legalize_pass.py for the CI issue.
Meteorix
commented
Jan 26, 2021
@Laurawly Thanks! The ci passed. |
Laurawly
commented
Jan 26, 2021
jcf94
left a comment
There was a problem hiding this comment.
Thanks! Sorry for my late reply. This looks good to me.
jwfromm
left a comment
There was a problem hiding this comment.
Thanks for adding the tests, this LGTM now.
Laurawly
commented
Jan 29, 2021
* add pad_to_tensorcore & legalize for dense/bmm/conv2d * fix pad & slice * fix comments * fix comments * resolve conflict * resolve conflict * support only fp16 * add tests/python/relay/test_pass_legalize_tensorcore.py * add tests for legalize tensorcore * fix pylint * fix pylint * code format * use_gpu test only; fix conv2d_alter_op * fix tests params * revert transform fix
* add pad_to_tensorcore & legalize for dense/bmm/conv2d * fix pad & slice * fix comments * fix comments * resolve conflict * resolve conflict * support only fp16 * add tests/python/relay/test_pass_legalize_tensorcore.py * add tests for legalize tensorcore * fix pylint * fix pylint * code format * use_gpu test only; fix conv2d_alter_op * fix tests params * revert transform fix
* add pad_to_tensorcore & legalize for dense/bmm/conv2d * fix pad & slice * fix comments * fix comments * resolve conflict * resolve conflict * support only fp16 * add tests/python/relay/test_pass_legalize_tensorcore.py * add tests for legalize tensorcore * fix pylint * fix pylint * code format * use_gpu test only; fix conv2d_alter_op * fix tests params * revert transform fix
* add pad_to_tensorcore & legalize for dense/bmm/conv2d * fix pad & slice * fix comments * fix comments * resolve conflict * resolve conflict * support only fp16 * add tests/python/relay/test_pass_legalize_tensorcore.py * add tests for legalize tensorcore * fix pylint * fix pylint * code format * use_gpu test only; fix conv2d_alter_op * fix tests params * revert transform fix
Add legalize pass: padding dense/conv2d/batch_matmul ops to legal shapes for using tensorcore on cuda target. To limit the overhead introduced by padding, we count the
extra_flopsand set the threshold to 2x, which is conservative compared to the speedup of tensorcore.This pr is dependent on #7146 .
@jcf94@merrymercy could you also help review this pr?