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

Fea/nn graph/block proxy func #5727

Merged
merged 42 commits into from Aug 4, 2021
Merged

Conversation

strint
Copy link
Contributor

@strint strint commented Aug 4, 2021

nn.Graph支持nn.Module的forward中调用了自定义函数的情况

@strint strint marked this pull request as ready for review August 4, 2021 12:45
if name in self._origin.__dict__:
return self._origin.__dict__[name]
# support get function
if hasattr(self._origin, name):
return partial(getattr(self._origin.__class__, name), self)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

主要改动在这里,其它的是代码的整理、简化

@strint strint requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 4, 2021 12:52
@strint strint added this to the v0.5.0 milestone Aug 4, 2021
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 4, 2021 14:27
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 4, 2021 16:59
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2021

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 137.7ms (= 6887.0ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 125.8ms (= 6289.8ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.09 (= 137.7ms / 125.8ms)

PyTorch resnet50 time: 85.0ms (= 4250.4ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 72.7ms (= 3635.8ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.17 (= 85.0ms / 72.7ms)

PyTorch resnet50 time: 56.5ms (= 2822.6ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 47.1ms (= 2353.2ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.20 (= 56.5ms / 47.1ms)

PyTorch resnet50 time: 49.0ms (= 2449.6ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 41.7ms (= 2083.9ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.18 (= 49.0ms / 41.7ms)

PyTorch resnet50 time: 38.7ms (= 1935.0ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 44.4ms (= 2221.2ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 0.87 (= 38.7ms / 44.4ms)

@oneflow-ci-bot oneflow-ci-bot merged commit a407579 into master Aug 4, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the fea/nn_graph/block_proxy_func branch August 4, 2021 18:33
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

3 participants