-
Notifications
You must be signed in to change notification settings - Fork 826
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
Sync vm mode guard #8212
Merged
Merged
Sync vm mode guard #8212
Changes from all commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
6e8e9c9
ThreadLocalGuard
lixinqi 9d796d5
SyncVmModeGuard
lixinqi 84cd03b
identity_eval
lixinqi 5de267c
Merge branch 'master' into sync_vm_mode_guard
lixinqi 147c7f0
auto format by CI
oneflow-ci-bot 08e9178
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 9885a89
Merge branch 'master' into sync_vm_mode_guard
lixinqi ca16369
fix static analyzer complaints
lixinqi f59d17d
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 3eb809a
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 55c163c
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 8aa2e8f
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 7612597
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi de5f971
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 8e86949
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 2ca0707
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 8537b7e
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 55c5160
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi e643eb1
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi eccdfe6
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 043accc
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 97b0eef
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 1591853
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi ba6f2d7
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 5e1a86a
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 1ee004c
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi e853c71
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi c5afe82
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 14226d6
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 754d6a7
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi acb7c98
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 5916848
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 913f6f5
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi fa3867e
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 61bee99
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 7eb2d72
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 5862a95
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 29ad00c
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 7297192
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 0a54078
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi cec8a1d
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi b50e236
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi a6c5d07
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi b6b73a2
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 43197bb
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 4453c58
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 582e11f
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 4001637
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 7fdc675
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 1555f70
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi cea5d58
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi ccbddef
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi c914f2f
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 6b7885f
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 09489b2
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi ee14204
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 4720413
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 97b697d
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 2cccecb
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 755199c
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 31a5022
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi d690538
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi a3a6056
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi dcaacc6
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 700c39a
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 1c6f65f
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi 1d3c62f
Merge branch 'master' of github.com:Oneflow-Inc/oneflow
lixinqi caaa2db
merge master
lixinqi 6fc5b4e
remove identity_eval
lixinqi fbcd8b6
SyncVmMode
lixinqi 98cc7ee
Merge branch 'master' into sync_vm_mode_guard
ouyangyu bf2872f
Merge branch 'master' into sync_vm_mode_guard
ouyangyu 3570701
Merge branch 'master' into sync_vm_mode_guard
mergify[bot] cc659f8
Merge branch 'master' into sync_vm_mode_guard
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright 2020 The OneFlow Authors. All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
#ifndef ONEFLOW_CORE_VM_SYNC_VM_MODE_GUARD_H_ | ||
#define ONEFLOW_CORE_VM_SYNC_VM_MODE_GUARD_H_ | ||
|
||
#include "oneflow/core/common/thread_local_guard.h" | ||
|
||
namespace oneflow { | ||
|
||
enum class SyncVmMode { | ||
kInvalid = 0, | ||
kEnable = 1, | ||
kDisable = 2, | ||
}; | ||
|
||
class SyncVmModeGuard final : public ThreadLocalGuard<SyncVmMode> { | ||
public: | ||
using ThreadLocalGuard<SyncVmMode>::ThreadLocalGuard; | ||
~SyncVmModeGuard() = default; | ||
|
||
static bool IsCurrentSyncVmMode() { | ||
const auto& opt_sync_mode = Current(); | ||
return opt_sync_mode.has_value() && CHECK_JUST(opt_sync_mode) == SyncVmMode::kEnable; | ||
} | ||
}; | ||
|
||
} // namespace oneflow | ||
|
||
#endif // ONEFLOW_CORE_VM_SYNC_VM_MODE_GUARD_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
核心逻辑。