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

Lazy Interpret support infer default device cpu #5880

Merged
merged 5 commits into from
Aug 14, 2021

Conversation

chengtbf
Copy link
Contributor

  • Lazy Interpret 支持推导默认的 Device(当 Ctx 中的 placement、 device 均为空时,默认生成 cpu device)
  • 增加 arange 单测并测试。

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 14, 2021 08:55
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 14, 2021 10:13
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 14, 2021 11:24
super().__init__()

def build(self):
return flow.arange(start=0, end=100, step=3, device=flow.device("cuda"))
Copy link
Contributor

Choose a reason for hiding this comment

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

测试是否需要覆盖一下 device 未设置,使用默认 cpu device 的 case?

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 142.0ms (= 7100.7ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 128.0ms (= 6400.5ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.11 (= 142.0ms / 128.0ms)

PyTorch resnet50 time: 83.8ms (= 4190.9ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.3ms (= 3713.4ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.13 (= 83.8ms / 74.3ms)

PyTorch resnet50 time: 55.9ms (= 2792.9ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 47.1ms (= 2355.2ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.19 (= 55.9ms / 47.1ms)

PyTorch resnet50 time: 48.6ms (= 2430.3ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 38.9ms (= 1947.2ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.25 (= 48.6ms / 38.9ms)

PyTorch resnet50 time: 43.3ms (= 2166.4ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 37.1ms (= 1854.1ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 1.17 (= 43.3ms / 37.1ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 14, 2021 12:52
@oneflow-ci-bot oneflow-ci-bot merged commit 1fa52b4 into master Aug 14, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the dev_cc_lazy_default_device branch August 14, 2021 12:52
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