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

Remove python function wrapper. #6012

Merged
merged 15 commits into from Aug 25, 2021
Merged

Conversation

hjchen2
Copy link
Contributor

@hjchen2 hjchen2 commented Aug 23, 2021

移除python中的function wrapper,并解决builtin function添加doc的问题。

@@ -121,7 +121,11 @@
namespace functional = one::functional;

ONEFLOW_API_PYBIND11_MODULE("F", m) {{
py::options options;
options.disable_function_signatures();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

禁止pybind自动生成doc

See the License for the specific language governing permissions and
limitations under the License.
"""
from oneflow._oneflow_internal.F import *
Copy link
Contributor

Choose a reason for hiding this comment

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

这个 F 名字空间,其实作用是对应了 torch 中的 torch._C 吧?
我们是未来会改成 _C 吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

目前感觉没太大必要,和torch的_C也不是完全对应。torch的接口导出比较分散,有些直接导出到torch,有些是torch._C,我们都统一到F

Copy link
Contributor

Choose a reason for hiding this comment

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

好的。

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 23, 2021 15:00
@github-actions
Copy link
Contributor

CI failed, removing label automerge

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 23, 2021 15:51
@hjchen2 hjchen2 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 24, 2021 07:01
Co-authored-by: Yao Chi <later@usopp.net>
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 24, 2021 10:25
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 24, 2021 11:34
@hjchen2 hjchen2 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 24, 2021 14:42
@github-actions
Copy link
Contributor

CI failed, removing label automerge

@github-actions
Copy link
Contributor

CI failed, removing label automerge

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 24, 2021 15:52
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 24, 2021 17:07
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 24, 2021 17:22
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 24, 2021 18:23
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 24, 2021 19:57
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 24, 2021 22:45
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 24, 2021 23:52
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 140.4ms (= 7021.5ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 128.3ms (= 6415.7ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.09 (= 140.4ms / 128.3ms)

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

PyTorch resnet50 time: 60.2ms (= 3011.1ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 47.8ms (= 2390.2ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.26 (= 60.2ms / 47.8ms)

PyTorch resnet50 time: 49.8ms (= 2488.0ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 40.6ms (= 2031.0ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.22 (= 49.8ms / 40.6ms)

PyTorch resnet50 time: 42.8ms (= 2138.3ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 41.3ms (= 2063.8ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 1.04 (= 42.8ms / 41.3ms)

@oneflow-ci-bot oneflow-ci-bot merged commit bd30b9e into master Aug 25, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the dev_rm_python_function_wrapper branch August 25, 2021 01:31
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