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

Remove contiguous() in split_embedding_weights_with_scale_bias #1808

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.

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