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

GlobalMultiClientEnv and refine EagerExecution #5523

Merged
merged 8 commits into from
Jul 16, 2021

Conversation

chengtbf
Copy link
Contributor

  • 去除 core 目录下对 api 目录的引用
  • 提供 GlobalMultiClientEnv() 查询当前是否是 Multi-Client
  • 修改 Global<GlobalJobBuildAndInferCtxMgr> 的逻辑,首先会判断是否是 Multi-Client:
    - 如果是 Multi-Client,直接返回 LazyMgr
    - 如果是 Single-Client,再根据 Single-Client 下的逻辑判断是否设置了标记 eager_execution_enabled,如果是,则 Eager 执行 global_function ,否则 Lazy 执行 global_function

这样我们新版的 torch 代码就跟 enable_eager_execution 完全无关了。

本 PR 不依赖对 enable_eager_execution 标记的移除;也不依赖 Compatible Single-Client 的迁移

Comment on lines 37 to 38
Maybe<bool> GlobalMultiClientEnv();

Copy link
Contributor

Choose a reason for hiding this comment

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

这个接口放在env_desc.h文件中是不是更合适一点。还可以基于这个接口简单重构一下api中IsMultiClient的实现

Copy link
Contributor

Choose a reason for hiding this comment

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

嗯,跟env放在一起比较好

Copy link
Contributor Author

Choose a reason for hiding this comment

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

改了,放在 env 里了。另外 api 里面的我没动,感觉重构也没太大意义,还省去了一个 include。

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 10:41
@oneflow-ci-bot oneflow-ci-bot self-requested a review July 16, 2021 12:08
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 13:33
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 15:19
@oneflow-ci-bot oneflow-ci-bot merged commit a2bfb15 into master Jul 16, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the dev_cc_lazy_mode_enable_eager branch July 16, 2021 17:10
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