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

[part9]Remove singleclient outdated api #5752

Merged
merged 18 commits into from
Aug 8, 2021

Conversation

luqiang-guo
Copy link
Contributor

@luqiang-guo luqiang-guo commented Aug 5, 2021

删除multiclient 下single client的接口
总删除列表

此pr完成了一部分接口清理。

  • load_variables
  • current_machine_id
  • current_resource
  • current_global_function_desc
  • ExecutionConfig
  • global_function

@luqiang-guo luqiang-guo requested review from clackhan, daquexian and oneflow-ci-bot and removed request for oneflow-ci-bot and Ancientshi August 6, 2021 11:11
@luqiang-guo luqiang-guo requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 6, 2021 12:05
"""
return enable_if.unique([get_current_resource])()


@enable_if.condition(hob.in_normal_mode & hob.env_initialized)
def get_current_resource():
Copy link
Contributor

Choose a reason for hiding this comment

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

这些是不是也一并删掉?

Comment on lines 86 to 88
@enable_if.condition(hob.in_normal_mode & hob.env_initialized)
def get_current_machine_id() -> int:
return oneflow._oneflow_internal.CurrentMachineId()
Copy link
Contributor

Choose a reason for hiding this comment

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

一并删除

Comment on lines -96 to -97
api_func = enable_if.unique(
[GetCurrentLazyGlobalFunctionDesc, GetCurrentEagerGlobalFunctionDesc]
Copy link
Contributor

Choose a reason for hiding this comment

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

上面对应的这两个函数也一并删除

@chengtbf chengtbf removed the request for review from oneflow-ci-bot August 6, 2021 16:29
@luqiang-guo luqiang-guo removed the request for review from oneflow-ci-bot August 8, 2021 08:13


def Init() -> None:
sync_default_session_if_normal()
Copy link
Contributor

Choose a reason for hiding this comment

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

这个文件的改动请 @daquexian 大老师看一下吧~

@@ -587,31 +566,3 @@ def GenerateValueAndAssign(var_blob, start_nd_idx, stop_nd_idx):
pass
if sync_between_multi_machine:
oneflow._oneflow_internal.eager.single_client.Sync()


def Init() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

对这个函数的调用也一起删掉吧,应该在 session_util.py

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 8, 2021 08:56
@luqiang-guo luqiang-guo requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 8, 2021 14:49
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 8, 2021 15:08
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2021

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 140.2ms (= 7011.7ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 128.2ms (= 6409.8ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.09 (= 140.2ms / 128.2ms)

PyTorch resnet50 time: 84.9ms (= 4244.5ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.5ms (= 3726.0ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.14 (= 84.9ms / 74.5ms)

PyTorch resnet50 time: 58.6ms (= 2931.0ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 50.1ms (= 2504.1ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.17 (= 58.6ms / 50.1ms)

PyTorch resnet50 time: 45.9ms (= 2296.4ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 41.5ms (= 2072.6ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.11 (= 45.9ms / 41.5ms)

PyTorch resnet50 time: 43.7ms (= 2184.0ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 45.3ms (= 2267.3ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 0.96 (= 43.7ms / 45.3ms)

@oneflow-ci-bot oneflow-ci-bot merged commit 603db80 into master Aug 8, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the remove_singleclient_outdated_api_part9 branch August 8, 2021 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge purge purge obsolete code python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants