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

fix bug of SyncOnMasterFn atexit #5909

Merged
merged 7 commits into from
Aug 16, 2021
Merged

Conversation

chengtbf
Copy link
Contributor

修复 oneflow/__init__.py 在 atexit 注册 _SyncOnMasterFn 函数时,并没有真正执行这个 sync() 函数的 BUG。

测试: (在 sync() 函数内加测试 log )

master:

chengcheng@oneflow-21:~/debug/graph $ python3 test_graph_linear.py 
Nothing happened because environment has been initialized
..
----------------------------------------------------------------------
Ran 2 tests in 1.530s
OK

本分支:

chengcheng@oneflow-21:~/debug/graph $ python3 test_graph_linear.py 
Nothing happened because environment has been initialized
..
----------------------------------------------------------------------
Ran 2 tests in 1.561s

OK
cclog: sync on master

@chengtbf chengtbf requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 16, 2021 08:52
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 16, 2021 09:33
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 16, 2021 10:24
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 16, 2021 10:24
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 16, 2021 11:26
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 16, 2021 11:27
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 138.7ms (= 6935.9ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 127.6ms (= 6380.7ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.09 (= 138.7ms / 127.6ms)

PyTorch resnet50 time: 83.4ms (= 4168.3ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.1ms (= 3707.4ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.12 (= 83.4ms / 74.1ms)

PyTorch resnet50 time: 57.5ms (= 2877.3ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 47.1ms (= 2352.9ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.22 (= 57.5ms / 47.1ms)

PyTorch resnet50 time: 47.9ms (= 2393.9ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 39.1ms (= 1954.2ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.23 (= 47.9ms / 39.1ms)

PyTorch resnet50 time: 42.4ms (= 2120.0ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 40.8ms (= 2040.1ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 1.04 (= 42.4ms / 40.8ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 16, 2021 12:20
@oneflow-ci-bot oneflow-ci-bot merged commit 6374e59 into master Aug 16, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the dev_cc_fix_exit_sync branch August 16, 2021 12:21
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