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

universal-ckp: support megatron-deepspeed llama model #4666

Merged
merged 4 commits into from Nov 15, 2023

Conversation

mosheisland
Copy link
Contributor

Megatron-DeepSpeed's llama implementation of swiglu allocates a single ColumnParallelLinear layer L, but effectively this parameter is a container of two Linear layers L1, L2 used for silu(L1(x)) * L2(x)). This requires special handling in ds_to_universal to create a representation of L parameter where the slices of L1 and L2 are first concatenated and then L is created by concatenating L1 and L2.

Megatron-DeepSpeed's llama implementation of swiglu allocates a single
ColumnParallelLinear layer L, but effectively this parameter is a container of
two Linear layers L1, L2 used for silu(L1(x)) * L2(x)).
This requires special handling in ds_to_universal to create a representation
of L parameter where the slices of L1 and L2 are first concatenated and then
L is created by concatenating L1 and L2.

Signed-off-by: Moshe Island <misland@habana.ai>
@tjruwase tjruwase added this pull request to the merge queue Nov 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2023
@loadams loadams added this pull request to the merge queue Nov 15, 2023
Merged via the queue into microsoft:master with commit ce5e56a Nov 15, 2023
15 checks passed
mauryaavinash95 pushed a commit to mauryaavinash95/DeepSpeed that referenced this pull request Feb 17, 2024
Megatron-DeepSpeed's llama implementation of swiglu allocates a single
ColumnParallelLinear layer L, but effectively this parameter is a
container of two Linear layers L1, L2 used for silu(L1(x)) * L2(x)).
This requires special handling in ds_to_universal to create a
representation of L parameter where the slices of L1 and L2 are first
concatenated and then L is created by concatenating L1 and L2.

Signed-off-by: Moshe Island <misland@habana.ai>
Co-authored-by: Moshe Island <misland@habana.ai>
Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com>
Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.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

4 participants