-
Notifications
You must be signed in to change notification settings - Fork 756
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
nn.Graph optimizer part 2: add L2, pass job complete, refactor #5604
Conversation
strint
commented
Jul 26, 2021
•
edited
Loading
edited
- fix error in test at Job Complete
- support L2, add l2 in sgd
- refactor optimizer conf and variable conf
Speed stats:
|
if state_block.type == BlockType.PARAMETER: | ||
self._var2var_op_name[state_block.origin] = ( | ||
self._variables_conf[state_block.origin] = VariableConfig( | ||
state_block.name_prefix + state_block.name | ||
) |
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.
给每个参数构造一个VariableConf
for param in param_group.parameters: | ||
vars_conf[param].l2 = l2 |
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.
获取L2
def build(self, x): | ||
out = self.m(x) | ||
out.backward() | ||
return out |
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.
测试输入 + matmul + 参数 + backward + 输出的构图
@@ -80,18 +129,18 @@ def __init__(self): | |||
self.add_optimizer("sgd0", sgd0) | |||
self.add_optimizer("sgd1", sgd1) |
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.
测试多optimizer的配置
CI failed, removing label automerge |
Speed stats:
|
Speed stats:
|