-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
cleanup Hexagon conv2d tests #9473
Conversation
@csullivan and @cconvey please review |
import tvm | ||
from .infrastructure import get_packed_filter_layout | ||
|
||
|
||
@tvm.testing.fixture | ||
def shape_nhwc(batch, in_channel, in_size): | ||
return (batch, in_size, in_size, in_channel) | ||
|
||
|
||
@tvm.testing.fixture | ||
def shape_oihw(out_channel, in_channel, kernel): | ||
return (out_channel, in_channel, kernel, kernel) | ||
|
||
|
||
@tvm.testing.fixture | ||
def shape_oihw8i32o4i(out_channel, in_channel, kernel): | ||
return get_packed_filter_layout(out_channel, in_channel, kernel, kernel) |
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.
The goal being to check to see if the testing fixtures are the source of the i386
flakiness?
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.
I removed the fixtures because of their effect in terms of the ordering of parameters on the pytest command lines which I personally find confusing. I just realized, though, that the maxpool test in this same directory relies on these fixtures so I either need to remove that dependence or add back these fixtures.
shape.extend(block_shape) | ||
else: | ||
shape.extend([off_h, off_w, shape_nhwc[3]]) | ||
shape.append(ceildiv(shape_nhwc[3], off_c)) |
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.
In this code we handle ceildiv
as-is, but in the get_packed_filter_shape
function (below) we cast its result to a Python int
type.
Is there a good reason for doing it two different ways?
Specifically: casting to int
works when the runtime return type of ceildiv
is tvm.tir.expr.IntImm
. But I'm wondering if we're okay with this test making that assumption. I.e., are we testing everything we intend to test when we assume that the exact shapes are known at this point in time?
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.
Indeed, casting to int
is a means of converting from tvm.tir.expr.IntImm
to int
. I am not sure why it works differently for get_packed_shape
(no cast) vs. get_packed_filter_shape
(requires cast). Also not sure about your question RE knowing exact shapes. More investigation required.
NOTE: I did change get_packed_filter_shape
to take a shape instead of a list of dimensions to match the API of get_packed_shape
.
9a4c73f
to
3be018b
Compare
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
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
Thank you @adstraw @cconvey @csullivan ; the PR has been merged! |
* cleanup Hexagon conv2d tests * add back fixtures; skip tests only on i386 * fix pylint error * fix maxpool failures * fix `skipif` statement and verify error + code review feedback * fix typo "physical_physical" * retrigger ci * determining i386 processor string from CI * hopefully the correct test disable
* cleanup Hexagon conv2d tests * add back fixtures; skip tests only on i386 * fix pylint error * fix maxpool failures * fix `skipif` statement and verify error + code review feedback * fix typo "physical_physical" * retrigger ci * determining i386 processor string from CI * hopefully the correct test disable
* cleanup Hexagon conv2d tests * add back fixtures; skip tests only on i386 * fix pylint error * fix maxpool failures * fix `skipif` statement and verify error + code review feedback * fix typo "physical_physical" * retrigger ci * determining i386 processor string from CI * hopefully the correct test disable
* cleanup Hexagon conv2d tests * add back fixtures; skip tests only on i386 * fix pylint error * fix maxpool failures * fix `skipif` statement and verify error + code review feedback * fix typo "physical_physical" * retrigger ci * determining i386 processor string from CI * hopefully the correct test disable
* cleanup Hexagon conv2d tests * add back fixtures; skip tests only on i386 * fix pylint error * fix maxpool failures * fix `skipif` statement and verify error + code review feedback * fix typo "physical_physical" * retrigger ci * determining i386 processor string from CI * hopefully the correct test disable
Deletes unnecessary cases from the test_conv2d_blocked.py including cases covering logical
oihw
filter and packednhw8h8wc
packed input layouts. Moved quite a lot of shared code to the infrastructure file reducing maintenance costs. And, some other general cleanup items --- comments, variable names, etc.