-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[AutoParallel] adapt lazyinit & fix pass #45840
[AutoParallel] adapt lazyinit & fix pass #45840
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -304,7 +338,10 @@ def main_program(self): | |||
|
|||
@property | |||
def startup_program(self): | |||
return self.concrete_program.startup_program | |||
try: | |||
return self.proxy_layer.startup_program |
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.
这里为什么要这样写?
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.
因为用户有可能并没有用 LazyGuard,在这种情况下也需要保证正确执行之前无lazyinit版本的动转静。
@@ -199,6 +206,7 @@ def __init__(self, layer, loss_func, metrics, inputs_spec, labels_spec): | |||
|
|||
self.build_info = BuildInfo() | |||
self._logger = get_logger(logging.INFO) | |||
self.lazy_init = False |
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.
这个lazy_init参数的作用是什么?可否在这里Note注明下?
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.
这里是为了表示用户是否使用了 LazyGuard。如果没有的话(False),会直接利用 model 初始化时的参数;如果使用了(True),会通过执行 startup_program 来初始化参数
} | ||
# slice param_value with dist_attr | ||
# share sliced_param_value with param_tensor in global_scope | ||
from .converter import Converter |
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.
import 语句不要动态import,推荐统一放到最前面
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.
已修改。
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.
LGTM
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.
LGTM
name of the auto_parallel/helper.py file should be more specific in future
PR types
New features
PR changes
Others
Describe
auto_parallel_gpt_model.py
to weight_sharing version in unittest