-
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
[Relay][TOPI]Fix meaning of conv2d_transpose output_padding parameter #4318
Conversation
there are some issue with ci, please retrigger the ci |
We need to update logs in https://github.com/uwsampl/tvm-distro/tree/master/tophub |
I don't know how to retrigger CI besides adding a dummy commit. If there is a better way, please do tell. |
git commit --allow-empty -m “Trigger CI” |
CI is still sad :( |
4a8cd08
to
5c508a0
Compare
It looks like I missed the VTA template. This one doesn't have any tests for the output padding and it makes me slightly uncomfortable, but the only test there is is for a very specific workload so I don't want to mess with it. |
cc @tmoreau89 |
I would appreciate some help with the VTA failure because it doesn't appear to be related to something i've done (I didn't add any if_then_else nodes), but at the same time it is in something I've modified (the conv2d_transpose test). So maybe I broke something, but I'm really not sure. |
@abergeron is the issue right now that VTA test will fail when you set output padding to |
It fails with (0, 0) in the CI right now. It might also be a good idea to test it with non-zero values to make sure it works. |
I see; I'm a little confused because the test case with output padding set to |
This is not super time critical, so you can take time to make sure it works properly. But I would like this to be merged within a week or two if possible. |
@abergeron ack, I'll investigate to see what causes the failure at the moment. Will report back by Tuesday. |
@tmoreau89 Any news? |
@abergeron got sidetracked with other commitments, I'll reproduce the issue tomorrow. |
FYI, I was able to reproduce the issue in your branch, I'll look more into what's causing it tomorrow... |
@abergeron: I have good new and bad news. The good news is that I was able to find the root cause of the observed bug. By changing the In order to circumvent the error the fix will be straightforward on your end: just change I've updated the schedule for VTA with this commit: https://github.com/uwsampl/tvm-distro/commits?author=tmoreau89 Essentially I changed the DCGAN schedules from The bad news is that this will need to be modified for all hardware targets under tophub. For instance the CUDA schedule will need to change: https://github.com/uwsampl/tvm-distro/blob/master/tophub/cuda_v0.06.log#L690 among other targets. In order to do so, I recommend first creating new schedule files under a new "package version" and then switching the package version in your PR in Finally, I also created a branch that will fix some scripts under VTA that will be affected from your change. If you could cherry pick my commits into your branch that would be great: https://github.com/tmoreau89/tvm/tree/4318_fix |
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.
Changes required:
- Change VTA package in
tophub.py
version to v0.07 to pass CI - Update TOPHUB entries for conv2d_transpose schedules
- Merge my branch changes into this PR: https://github.com/tmoreau89/tvm/tree/4318_fix
I consider this to be 100% good news since I would only have to update the schedules. I needed to figure out how to use autotvm for other purposes soon so I'll get on that. |
Great then! Happy to provide you with guidance as you go through the changes in tophub. |
6ee61d5
to
cab70d6
Compare
For now, I've included your fixes and rebased on the current master. I'll do the tuning for non-VTA targets later. |
Cool, let's see if the CIs pass; in the meantime, I don't think it's necessary to tune the targets, it's just a matter of changing the entries to include the new operator argument |
In the case of VTA, I had to add the new field in the argument field as to not break the schedule lookup mechanism: from |
I discovered that backends other than VTA don't have convenient scripts to do the tuning. I will probably write some so that we have a script in the repo that can reproduce tuning files in tophub. |
Hmmm, is the reason you want to re-tune schedules to cover cases where output pad = |
I forgot the tophub.py file update because I thought it was in your branch. Also, if I don't really need to retune anything, then I would rather save the time. But there might have been some output padding in the model that uses conv2d_transpose on tophub. I'm not sure exactly what model that is however. In any case I think it would be very good to have a reference script that produces the tuning files in tophub, so it would be easy to recreate the files when something changes. |
I've tried all the models in the benchmark files (in apps/benchmarks) and none of them use any convolution. So I have no idea where the conv2d_transpose in the tuning files comes from. If someone knows where those come from, it would help a lot. Also I think this kinds of reinforces the idea that a publicly available script to make those files would help a lot, unless it is already present somewhere I missed. |
ab80867
to
d958cd0
Compare
d958cd0
to
24cba20
Compare
@@ -55,7 +55,7 @@ | |||
'mali': "v0.05", | |||
'intel_graphics': "v0.01", | |||
|
|||
'vta': "v0.06", | |||
'vta': "v0.07", |
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.
cuda and arm cpu version also need to be updated
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.
done
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.
Revisiting the PR, overall everything looks good. Thank you @abergeron for handling the required changes.
@abergeron Thanks for the fix |
@abergeron @vinx13 @tmoreau89
I'll revert this PR for now. Could you fix these two bugs and double check whether cuda and arm_cpu implementation are correct? Further, could you investigate why CI doesn't catch these bugs? |
…apache#4318) * Add output_padding to generic * Add output_padding to the reference impl * Add output_padding to arm_cpu * Add output_padding to the test * Add output_padding for cuda * Add output_padding for x86 * Make use of the new output_padding argument in Relay * Adjust conv2d_transpose Relay test * Fix lint errors * Fix the VTA declaration of conv2d_transpose * support for output padding in conv2d transpose * some output padding will break IR pass * Fix new conv2d_transpose test * Update tophub * Fix conv1d output_padding too. * Fix the conv1d_transpose reference function. * Fix the cuda impl * fix the topi test for conv1d * Update the versions in tophub.py Co-authored-by: Thierry Moreau <[email protected]>
…arameter (apache#4318)" (apache#4708) This reverts commit dcf7fbf.
…apache#4318) * Add output_padding to generic * Add output_padding to the reference impl * Add output_padding to arm_cpu * Add output_padding to the test * Add output_padding for cuda * Add output_padding for x86 * Make use of the new output_padding argument in Relay * Adjust conv2d_transpose Relay test * Fix lint errors * Fix the VTA declaration of conv2d_transpose * support for output padding in conv2d transpose * some output padding will break IR pass * Fix new conv2d_transpose test * Update tophub * Fix conv1d output_padding too. * Fix the conv1d_transpose reference function. * Fix the cuda impl * fix the topi test for conv1d * Update the versions in tophub.py Co-authored-by: Thierry Moreau <[email protected]>
…arameter (apache#4318)" (apache#4708) This reverts commit dcf7fbf.
…apache#4318) * Add output_padding to generic * Add output_padding to the reference impl * Add output_padding to arm_cpu * Add output_padding to the test * Add output_padding for cuda * Add output_padding for x86 * Make use of the new output_padding argument in Relay * Adjust conv2d_transpose Relay test * Fix lint errors * Fix the VTA declaration of conv2d_transpose * support for output padding in conv2d transpose * some output padding will break IR pass * Fix new conv2d_transpose test * Update tophub * Fix conv1d output_padding too. * Fix the conv1d_transpose reference function. * Fix the cuda impl * fix the topi test for conv1d * Update the versions in tophub.py Co-authored-by: Thierry Moreau <[email protected]>
…arameter (apache#4318)" (apache#4708) This reverts commit dcf7fbf.
…apache#4318) * Add output_padding to generic * Add output_padding to the reference impl * Add output_padding to arm_cpu * Add output_padding to the test * Add output_padding for cuda * Add output_padding for x86 * Make use of the new output_padding argument in Relay * Adjust conv2d_transpose Relay test * Fix lint errors * Fix the VTA declaration of conv2d_transpose * support for output padding in conv2d transpose * some output padding will break IR pass * Fix new conv2d_transpose test * Update tophub * Fix conv1d output_padding too. * Fix the conv1d_transpose reference function. * Fix the cuda impl * fix the topi test for conv1d * Update the versions in tophub.py Co-authored-by: Thierry Moreau <[email protected]>
…arameter (apache#4318)" (apache#4708) This reverts commit dcf7fbf.
I've fixed the meaning of output_padding to be more in line with what other machine learning frameworks and libraries intend for the meaning and also to make it actually useful for the gradient.
This changed the definition of conv2d_transpose in TOPI in a minor way but I tried to make the change transparent as much as possible.
@vinx13