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

Further refactor deepspeed.moe.utils + deepspeed.moe.layer type hints #5060

Conversation

ringohoffman
Copy link
Contributor

@ringohoffman ringohoffman commented Feb 2, 2024

When unpacking a dict, keys that appear after the unpacking can overwrite the keys of the unpacked dict, meaning we can avoid avoid the pattern of skipping certain keys; also use defaultdict to avoid having to do the boilerplate of assigning the elements of group_moe.

More type hints and small stylistic changes to deepspeed.moe.layer

in dict unpacking, keys after an unpacking overwrite keys of the unpacked dict, meaning we can avoid avoid the pattern of skipping certain keys; also use defaultdict to avoid having to do the boilerplate of assigning the elements of group_moe
deepspeed/moe/layer.py Outdated Show resolved Hide resolved
Co-authored-by: Michael Wyatt <mrwyattii@gmail.com>
@mrwyattii
Copy link
Contributor

@ringohoffman could you please run formatting on this branch? pre-commit run --all-files

@mrwyattii mrwyattii merged commit 9922270 into microsoft:master Feb 5, 2024
12 checks passed
mauryaavinash95 pushed a commit to mauryaavinash95/DeepSpeed that referenced this pull request Feb 17, 2024
…microsoft#5060)

When unpacking a `dict`, keys that appear after the unpacking can
overwrite the keys of the unpacked `dict`, meaning we can avoid avoid
the pattern of skipping certain keys; also use `defaultdict` to avoid
having to do the boilerplate of assigning the elements of `group_moe`.

More type hints and small stylistic changes to `deepspeed.moe.layer`

---------

Co-authored-by: Michael Wyatt <mrwyattii@gmail.com>
Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
rraminen pushed a commit to ROCm/DeepSpeed that referenced this pull request May 9, 2024
…microsoft#5060)

When unpacking a `dict`, keys that appear after the unpacking can
overwrite the keys of the unpacked `dict`, meaning we can avoid avoid
the pattern of skipping certain keys; also use `defaultdict` to avoid
having to do the boilerplate of assigning the elements of `group_moe`.

More type hints and small stylistic changes to `deepspeed.moe.layer`

---------

Co-authored-by: Michael Wyatt <mrwyattii@gmail.com>
Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
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.

None yet

2 participants