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

Feat logical slice ops grad #8337

Merged
merged 45 commits into from
Jun 6, 2022
Merged

Feat logical slice ops grad #8337

merged 45 commits into from
Jun 6, 2022

Conversation

wyg1997
Copy link
Contributor

@wyg1997 wyg1997 commented May 31, 2022

#8313

支持 LogicalSliceAssign/LogicalSlice 后向

wyg1997 and others added 30 commits May 25, 2022 10:12
@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 2, 2022 02:57
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2022

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 130.0ms (= 13001.6ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 145.0ms (= 14499.6ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.12 (= 145.0ms / 130.0ms)

OneFlow resnet50 time: 76.2ms (= 7621.0ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 85.4ms (= 8543.2ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.12 (= 85.4ms / 76.2ms)

OneFlow resnet50 time: 52.9ms (= 10585.0ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 58.3ms (= 11661.2ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.10 (= 58.3ms / 52.9ms)

OneFlow resnet50 time: 39.5ms (= 7893.7ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 49.5ms (= 9907.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.26 (= 49.5ms / 39.5ms)

OneFlow resnet50 time: 33.7ms (= 6733.2ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 39.2ms (= 7846.7ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.17 (= 39.2ms / 33.7ms)

OneFlow swin dataloader time: 0.384s (= 76.796s / 200, num_workers=1)
PyTorch swin dataloader time: 0.151s (= 30.165s / 200, num_workers=1)
Relative speed: 0.393 (= 0.151s / 0.384s)

OneFlow swin dataloader time: 0.068s (= 13.694s / 200, num_workers=4)
PyTorch swin dataloader time: 0.043s (= 8.661s / 200, num_workers=4)
Relative speed: 0.633 (= 0.043s / 0.068s)

OneFlow swin dataloader time: 0.041s (= 8.232s / 200, num_workers=8)
PyTorch swin dataloader time: 0.023s (= 4.576s / 200, num_workers=8)
Relative speed: 0.556 (= 0.023s / 0.041s)

❌ OneFlow resnet50 time: 146.4ms (= 14643.5ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 174.7ms (= 17472.9ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.19 (= 174.7ms / 146.4ms)

OneFlow resnet50 time: 99.4ms (= 9938.4ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 112.4ms (= 11240.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.13 (= 112.4ms / 99.4ms)

OneFlow resnet50 time: 71.4ms (= 14284.3ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 93.2ms (= 18638.0ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.30 (= 93.2ms / 71.4ms)

OneFlow resnet50 time: 59.1ms (= 11819.6ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 74.4ms (= 14873.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.26 (= 74.4ms / 59.1ms)

OneFlow resnet50 time: 53.7ms (= 10735.6ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 73.6ms (= 14729.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.37 (= 73.6ms / 53.7ms)

@github-actions github-actions bot removed the automerge label Jun 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2022

CI failed when running job: cpu-module. PR label automerge has been removed

Comment on lines 124 to 125
zeros = JUST(functional::ConsistentConstant(ctx->value_shape, 0, out_grads[0]->dtype(),
parallel_desc, *JUST(GetSbpList(nd_sbp))));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里不能按 out_grads 的 nd_sbp 来初始化,因为 value_shape 的某个维度不一定可以 Split

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 6, 2022 03:18
@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 6, 2022 06:14
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 6, 2022 07:47
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 6, 2022 12:04
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2022

View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8337/

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 6, 2022 16:24
@mergify mergify bot merged commit 83ed0ba into master Jun 6, 2022
@mergify mergify bot deleted the feat-logical_slice_ops_grad branch June 6, 2022 18:34
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.

4 participants