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

Fix embedding order in EmbeddingBagCollection #1646

Closed
wants to merge 1 commit into from

Conversation

yingufan
Copy link
Contributor

Summary:

  1. The bug was introduced in D37352626 where we grouped tables by (pooling, data_type), but still used the original order for _embedding_names and _length_per_key.
  2. Another bug was also introduced in D37352626 where we stacked embeddings with shape (batch, dim) along the batch dimension, but we should concat along the dim dimension.

The unit tests didn't capture any of these bugs, because:

  1. The numerical tolerance was too loose (1.0). This diff tightens it to 0.1.
  2. The test inputs were not sufficient to trigger the bugs, e.g. the inputs only had one batch, one grouping key, and one embedding dim.

Reviewed By: YazhiGao

Differential Revision: D52894935

Summary:
1. The bug was introduced in D37352626 where we grouped tables by (pooling, data_type), but still used the original order for _embedding_names and _length_per_key.
1. Another bug was also introduced in D37352626 where we stacked embeddings with shape (batch, dim) along the batch dimension, but we should concat along the dim dimension.

The unit tests didn't capture any of these bugs, because:
1. The numerical tolerance was too loose (1.0).  This diff tightens it to 0.1.
2. The test inputs were not sufficient to trigger the bugs, e.g. the inputs only had one batch, one grouping key, and one embedding dim.

Reviewed By: YazhiGao

Differential Revision: D52894935
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 22, 2024
@facebook-github-bot
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants