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

LazyInterpret build LocalTensor if input is local #5582

Merged
merged 3 commits into from
Jul 23, 2021

Conversation

chengtbf
Copy link
Contributor

LazyInterpret 在推导 output Tensor 时,根据 input tensor 是否是 Local 来创建 LocalTensor 或者 ConsistentTensor。
但是 LazyInterpret 调用 JobBuildAndInferCtx AddOp 时,永远是 ConsistentOp。

@github-actions
Copy link
Contributor

CI failed, removing label automerge

@github-actions
Copy link
Contributor

CI failed, removing label automerge

1 similar comment
@github-actions
Copy link
Contributor

CI failed, removing label automerge

@oneflow-ci-bot oneflow-ci-bot removed their request for review July 23, 2021 06:50
@strint
Copy link
Contributor

strint commented Jul 23, 2021

ConsistentOp支持输入Lazy Local Tensor? 看这里把loca 的input和variable都转成了Local,而不是单卡的consistent

1 similar comment
@strint
Copy link
Contributor

strint commented Jul 23, 2021

ConsistentOp支持输入Lazy Local Tensor? 看这里把loca 的input和variable都转成了Local,而不是单卡的consistent

@chengtbf
Copy link
Contributor Author

ConsistentOp支持输入Lazy Local Tensor? 看这里把loca 的input和variable都转成了Local,而不是单卡的consistent

ConsistentOp 跟 Tensor 没有任何关系。ConsistentOp 不需要 Tensor 这个概念,只需要 lbn 就行。

@strint
Copy link
Contributor

strint commented Jul 23, 2021

ConsistentOp支持输入Lazy Local Tensor? 看这里把loca 的input和variable都转成了Local,而不是单卡的consistent

ConsistentOp 跟 Tensor 没有任何关系。ConsistentOp 不需要 Tensor 这个概念,只需要 lbn 就行。

哦,这些Tensor只是存了一些必要的meta信息,方便在job外以一个统一的数据结构交换meta信息的。

@chengtbf
Copy link
Contributor Author

ConsistentOp支持输入Lazy Local Tensor? 看这里把loca 的input和variable都转成了Local,而不是单卡的consistent

ConsistentOp 跟 Tensor 没有任何关系。ConsistentOp 不需要 Tensor 这个概念,只需要 lbn 就行。

哦,这些Tensor只是存了一些必要的meta信息,方便在job外以一个统一的数据结构交换meta信息的。

是的~

@oneflow-ci-bot oneflow-ci-bot removed their request for review July 23, 2021 08:06
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 139.1ms (= 6956.1ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 126.1ms (= 6305.6ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.10 (= 139.1ms / 126.1ms)

PyTorch resnet50 time: 84.2ms (= 4210.9ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 73.6ms (= 3682.2ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.14 (= 84.2ms / 73.6ms)

PyTorch resnet50 time: 58.2ms (= 2912.0ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 50.6ms (= 2528.5ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.15 (= 58.2ms / 50.6ms)

PyTorch resnet50 time: 49.7ms (= 2486.6ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 47.2ms (= 2359.0ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.05 (= 49.7ms / 47.2ms)

PyTorch resnet50 time: 44.1ms (= 2206.9ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 46.6ms (= 2332.0ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 0.95 (= 44.1ms / 46.6ms)

@oneflow-ci-bot oneflow-ci-bot self-requested a review July 23, 2021 08:54
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 139.9ms (= 6994.0ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 125.9ms (= 6293.2ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.11 (= 139.9ms / 125.9ms)

PyTorch resnet50 time: 83.5ms (= 4172.5ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 73.7ms (= 3684.6ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.13 (= 83.5ms / 73.7ms)

PyTorch resnet50 time: 58.3ms (= 2915.0ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 49.6ms (= 2480.3ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.18 (= 58.3ms / 49.6ms)

PyTorch resnet50 time: 48.9ms (= 2446.0ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 46.8ms (= 2337.8ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.05 (= 48.9ms / 46.8ms)

PyTorch resnet50 time: 44.8ms (= 2239.7ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 47.0ms (= 2348.0ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 0.95 (= 44.8ms / 47.0ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review July 23, 2021 10:27
@oneflow-ci-bot oneflow-ci-bot merged commit 0b5dc89 into master Jul 23, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the dev_cc_lazy_local_tensor branch July 23, 2021 10:28
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.

3 participants