Skip to content

Set default value to null #3732

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
Closed

Conversation

jnwan
Copy link

@jnwan jnwan commented Feb 25, 2025

Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/814

Context:

We use block_bucketize_sparse_features_cpu kernel to bucketize kjt, for kjt with weights = none, the returned kjt has weights tensor to be Tensor (undefined) which cause it couldn't be serialized. This diff set the default value to std::nullopt and only initialize the weights when the orignal kjt has weights.

Error message

terminate called after throwing an instance of 'c10::ValueError'
  what():  The tensor at position 1 cannot be serialized. Only tensors with allocated storage are supported.

Apply same logic to all other 3 fields

Reviewed By: sryap

Differential Revision: D70143698

Summary:
X-link: facebookresearch/FBGEMM#814

Context:

We use block_bucketize_sparse_features_cpu kernel to bucketize kjt, for kjt with weights = none, the returned kjt has weights tensor to be `Tensor (undefined)` which cause it couldn't be serialized. This diff set the default value to std::nullopt and only initialize the weights when the orignal kjt has weights.

Error message
```
terminate called after throwing an instance of 'c10::ValueError'
  what():  The tensor at position 1 cannot be serialized. Only tensors with allocated storage are supported.
```

Apply same logic to all other 3 fields

Reviewed By: sryap

Differential Revision: D70143698
@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Feb 25, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 85566ef
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/67be10d3d5a03b00088a8d29
😎 Deploy Preview https://deploy-preview-3732--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 7017af2.

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

Pull Request resolved: facebookresearch/FBGEMM#814

Context:

We use block_bucketize_sparse_features_cpu kernel to bucketize kjt, for kjt with weights = none, the returned kjt has weights tensor to be `Tensor (undefined)` which cause it couldn't be serialized. This diff set the default value to std::nullopt and only initialize the weights when the orignal kjt has weights.

Error message
```
terminate called after throwing an instance of 'c10::ValueError'
  what():  The tensor at position 1 cannot be serialized. Only tensors with allocated storage are supported.
```

Apply same logic to all other 3 fields

Reviewed By: sryap

Differential Revision: D70143698

fbshipit-source-id: c12dd360be3f5a21c8d330e1666cd447e97c1b54
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.

3 participants