Support multi-dimensional runtime_meta in RES streaming buffers by lazy init (#5643)#5643
Closed
FriedCosey wants to merge 1 commit intopytorch:mainfrom
Closed
Support multi-dimensional runtime_meta in RES streaming buffers by lazy init (#5643)#5643FriedCosey wants to merge 1 commit intopytorch:mainfrom
FriedCosey wants to merge 1 commit intopytorch:mainfrom
Conversation
Contributor
|
@FriedCosey has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100944325. |
2c863f6 to
3429c2d
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
3429c2d to
93818b6
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
93818b6 to
716155d
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
716155d to
d06edd7
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
d06edd7 to
74eba68
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
74eba68 to
bbacffe
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
bbacffe to
3f33c63
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
3f33c63 to
b494721
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
b494721 to
0530779
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
0530779 to
30786c1
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
30786c1 to
705a0e6
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
705a0e6 to
9f9e21e
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
9f9e21e to
3ae4bb0
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 16, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
3ae4bb0 to
f75438b
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
f75438b to
a33583a
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
a33583a to
a8a7da6
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
57dc926 to
6f26962
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
6f26962 to
7211bd0
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
7211bd0 to
6c69ec7
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
6c69ec7 to
06bdfaa
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 17, 2026
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
49b9861 to
e091dc0
Compare
FriedCosey
pushed a commit
to FriedCosey/FBGEMM
that referenced
this pull request
Apr 18, 2026
…zy init (pytorch#5643) Summary: X-link: facebookresearch/FBGEMM#2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
…zy init (pytorch#5643) Summary: Pull Request resolved: pytorch#5643 X-link: https://github.com/facebookresearch/FBGEMM/pull/2591 The `res_runtime_meta` buffer in `SplitTableBatchedEmbeddingBagsCodegen` was hardcoded to shape `(cache_size, 1)`. When `_hash_zch_runtime_meta` has dim > 1 (e.g., feature cache storing 2 cached features via `zch_custom_runtime_meta_dim=2`), the `.copy_()` in `raw_embedding_stream()` crashes with: `RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]` Full output P2274437578 This diff lazy resizes the buffer defaults to `(cache_size, 1, torch.long)` and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs. Reviewed By: chouxi Differential Revision: D100944325
Contributor
|
This pull request has been merged in ffdfb0e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/2591
The
res_runtime_metabuffer inSplitTableBatchedEmbeddingBagsCodegenwas hardcoded to shape(cache_size, 1). When_hash_zch_runtime_metahas dim > 1 (e.g., feature cache storing 2 cached features viazch_custom_runtime_meta_dim=2), the.copy_()inraw_embedding_stream()crashes with:RuntimeError: output with shape [N, 1] doesn't match the broadcast shape [N, 2]Full output P2274437578
This diff lazy resizes the buffer defaults to
(cache_size, 1, torch.long)and auto-corrects on the first iteration when runtime_meta data arrives with a different shape or dtype. This is a one-time operation, after the first resize, dims match and no further reallocation occurs.Reviewed By: chouxi
Differential Revision: D100944325