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

[zero] fix init bugs in zero context #686

Merged
merged 1 commit into from
Apr 7, 2022
Merged

[zero] fix init bugs in zero context #686

merged 1 commit into from
Apr 7, 2022

Conversation

1SAA
Copy link
Contributor

@1SAA 1SAA commented Apr 7, 2022

  • adapt model weight initialization for methods in Pytorch nn.init

@1SAA 1SAA requested review from feifeibear and ver217 April 7, 2022 07:51

def _pre_context_exec(self):
"""
The Callback function when entering the context
"""
self.logger = get_dist_logger("ZeroInitContext")

# substitute fan-in and fan-out calculation
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you exhaust all possible functions?
_calculate_fan_in_and_fan_out and calc_fanin_fanout just two of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works for all init functions in nn.init and colossalai.nn.init.

@1SAA 1SAA merged commit d7ecaf3 into hpcaitech:main Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants