Skip to content

Remove contiguous() in split_embedding_weights_with_scale_bias #1808

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

Closed
wants to merge 1 commit into from

Conversation

IvanKobzarev
Copy link

Summary:
Calling tensor.contiguous() in case of non-contiguous tensor creates a new tensor.
Changing it will not change the original tensor.

To use results of split_embedding_weights_with_scale_bias(split_scale_bias_mode=2) as a tensor in state_dict - we should be able via that tensor to change the original tbe weight.

For that we need to remove copy via contiguous().

Differential Revision:
D46483112

Privacy Context Container: L1138451

Summary:
Calling `tensor.contiguous()` in case of non-contiguous tensor creates a new tensor.
Changing it will not change the original `tensor`.

To use results of `split_embedding_weights_with_scale_bias(split_scale_bias_mode=2)` as a tensor in state_dict - we should be able via that tensor to change the original tbe weight.

For that we need to remove copy via contiguous().

Differential Revision:
D46483112

Privacy Context Container: L1138451

fbshipit-source-id: dffaad9c7e92aaaf7761958c0d190a7ed21ee00e
@netlify
Copy link

netlify bot commented Jun 6, 2023

Deploy Preview for pytorch-fbgemm-docs canceled.

Name Link
🔨 Latest commit faae87c
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/647f553405f0570008c5f0d0

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46483112

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 10e93a0.

coconutruben added a commit to coconutruben/FBGEMM-1 that referenced this pull request Jan 23, 2025
Summary:
# Why

get improvements for MoE kernel

# What

cherry-pick the relevant components of https://github.com/ROCm/composable_kernel/pull/1808/files#

Reviewed By: jianyuh

Differential Revision: D68534277
coconutruben added a commit to coconutruben/FBGEMM-1 that referenced this pull request Jan 25, 2025
Summary:

X-link: facebookresearch/FBGEMM#687

# Why

get improvements for MoE kernel

# What

cherry-pick the relevant components of https://github.com/ROCm/composable_kernel/pull/1808/files#

Reviewed By: jianyuh

Differential Revision: D68534277
coconutruben added a commit to coconutruben/FBGEMM-1 that referenced this pull request Jan 27, 2025
Summary:

X-link: facebookresearch/FBGEMM#687

# Why

get improvements for MoE kernel

# What

cherry-pick the relevant components of https://github.com/ROCm/composable_kernel/pull/1808/files#

Reviewed By: jianyuh

Differential Revision: D68534277
facebook-github-bot pushed a commit that referenced this pull request Jan 27, 2025
Summary:
Pull Request resolved: #3609

X-link: facebookresearch/FBGEMM#687

# Why

get improvements for MoE kernel

# What

cherry-pick the relevant components of https://github.com/ROCm/composable_kernel/pull/1808/files#

Reviewed By: jianyuh

Differential Revision: D68534277

fbshipit-source-id: 47a7ce8a239eaa0cd4dc9e713e1603ee3c42825e
coconutruben added a commit to coconutruben/FBGEMM-1 that referenced this pull request Jan 28, 2025
Summary:
# Why

- some kernels were missed in the previous cherry-pick
- the interface has changed slightly and extracting the `intermediate_size` is different

# What

- get remaining files from ROCm/composable_kernel@1ff50e7
- adjust interface
- explicitly pass silu as the activation function

Differential Revision: D68792360
q10 pushed a commit to q10/FBGEMM that referenced this pull request Apr 10, 2025
Summary:
X-link: pytorch#3609

Pull Request resolved: facebookresearch/FBGEMM#687

# Why

get improvements for MoE kernel

# What

cherry-pick the relevant components of https://github.com/ROCm/composable_kernel/pull/1808/files#

Reviewed By: jianyuh

Differential Revision: D68534277

fbshipit-source-id: 47a7ce8a239eaa0cd4dc9e713e1603ee3c42825e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants