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

Add local to global balanced override env var #7981

Merged
merged 43 commits into from
Apr 14, 2022

Conversation

clackhan
Copy link
Contributor

@clackhan clackhan commented Apr 8, 2022

添加ONEFLOW_EAGER_LOCAL_TO_GLOBAL_BALANCED_OVERRIDE 环境变量,该环境变量用于指示local to global时输入数据的形状是否是一样的,如果设置为true,则不需要同步各rank形状,本地计算逻辑形状。

@clackhan clackhan requested a review from lixinqi April 8, 2022 04:06
}

bool GetLocalToGlobalIsBalanced(bool is_balanced) {
thread_local Optional<bool> eager_local_to_global_balanced_override =
Copy link
Contributor

Choose a reason for hiding this comment

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

看起来这个会一个环境变量打开所有的 local to global 的 is_balanced ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

看起来这个会一个环境变量打开所有的 local to global 的 is_balanced ?

是的,这个环境变量有一键配置的作用,对整个网络生效

Copy link
Contributor

@strint strint left a comment

Choose a reason for hiding this comment

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

lgtm

@clackhan clackhan requested a review from oneflow-ci-bot April 8, 2022 04:28
@@ -53,6 +53,21 @@ namespace impl {

namespace {

Optional<bool> ParseEagerLocalToGlobalBalancedOverride() {
const char* env_p = std::getenv("ONEFLOW_EAGER_LOCAL_TO_GLOBAL_BALANCED_OVERRIDE");
Copy link
Contributor

Choose a reason for hiding this comment

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

引入一个新的环境变量,至少源码层级得有一点注释或者解释。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

引入一个新的环境变量,至少源码层级得有一点注释或者解释。

已添加注释

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2022

Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally.

@clackhan clackhan requested review from BBuf and daquexian as code owners April 12, 2022 10:32
@clackhan clackhan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot April 12, 2022 10:33
@github-actions
Copy link
Contributor

View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/7981/

@clackhan clackhan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot April 13, 2022 01:59
@github-actions
Copy link
Contributor

View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/7981/

@github-actions
Copy link
Contributor

View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/7981/

@clackhan clackhan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot April 14, 2022 06:53
@github-actions
Copy link
Contributor

View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/7981/

@github-actions
Copy link
Contributor

Speed stats:

@chengtbf chengtbf merged commit 3539d33 into master Apr 14, 2022
@chengtbf chengtbf deleted the add_local_to_global_balanced_override_env_var branch April 14, 2022 13:25
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.

5 participants