Skip to content
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

fix upsample bug #5753

Merged
merged 11 commits into from
Aug 7, 2021
Merged

fix upsample bug #5753

merged 11 commits into from
Aug 7, 2021

Conversation

BBuf
Copy link
Contributor

@BBuf BBuf commented Aug 5, 2021

修复upsample.h中的一个BUG。

@oneflow-ci-bot oneflow-ci-bot self-requested a review August 5, 2021 16:23
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2021

CI failed, removing label automerge

@github-actions github-actions bot removed the automerge label Aug 5, 2021
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 5, 2021 18:13
@BBuf BBuf added the automerge label Aug 6, 2021
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 6, 2021 01:32
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 6, 2021 01:32
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 6, 2021 03:32
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 6, 2021 08:31
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 6, 2021 10:42
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 6, 2021 14:04
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2021

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 139.7ms (= 6986.3ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 127.9ms (= 6392.8ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.09 (= 139.7ms / 127.9ms)

PyTorch resnet50 time: 84.2ms (= 4210.3ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.5ms (= 3725.7ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.13 (= 84.2ms / 74.5ms)

PyTorch resnet50 time: 60.3ms (= 3016.1ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 49.0ms (= 2451.9ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.23 (= 60.3ms / 49.0ms)

PyTorch resnet50 time: 47.5ms (= 2377.5ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 41.0ms (= 2047.8ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.16 (= 47.5ms / 41.0ms)

PyTorch resnet50 time: 43.3ms (= 2163.9ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 43.7ms (= 2187.4ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 0.99 (= 43.3ms / 43.7ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 6, 2021 17:32
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 7, 2021 02:15
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2021

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 140.8ms (= 7039.3ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 128.0ms (= 6399.1ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.10 (= 140.8ms / 128.0ms)

PyTorch resnet50 time: 84.2ms (= 4208.3ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.5ms (= 3723.1ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.13 (= 84.2ms / 74.5ms)

PyTorch resnet50 time: 60.3ms (= 3017.2ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 49.0ms (= 2452.2ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.23 (= 60.3ms / 49.0ms)

PyTorch resnet50 time: 46.6ms (= 2332.3ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 41.4ms (= 2072.1ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.13 (= 46.6ms / 41.4ms)

PyTorch resnet50 time: 40.6ms (= 2031.9ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 41.3ms (= 2063.3ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 0.98 (= 40.6ms / 41.3ms)

@oneflow-ci-bot oneflow-ci-bot merged commit c52eef0 into master Aug 7, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the fix_upsample_bug branch August 7, 2021 05:35
@@ -138,7 +138,7 @@ OF_DEVICE_FUNC T cubic_convolution2(const T x, const T A) {

template<typename T>
OF_DEVICE_FUNC void get_cubic_upsample_coefficients(T coeffs[4], const T t) {
T A = -0.75;
float A = -0.75;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix has accually no effect.
A will be passed to the second parameter typed const T of cubic_convolution1<T> and cubic_convolution2<T>, and obviously an implicit cast will be performed due to T = int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants