-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add column wise sharding support for EmbeddingCollection (sequence em…
…beddings) (#432) Summary: Pull Request resolved: #432 Support for CW and TWCW sharding in EmbeddingCollection. Added logic to stitch feature outputs with local embedding dim after output dist to match original dim. Outputs are stored in order of rank, however, in column-wise sharding, there can be multiple shards of a table on the same rank and thereby multiple outputs on the same rank. i.e. rank 0: [f_0, f_0, f_1] rank 1: [f_0, f_1] output: [f_0(shard_0), f_0(shard_2), f_1(shard_0), f_0(shard_1), f_1(shard_1)] f_0 shard ranks = [0, 1, 0] # [f_0(shard_0) = rank0, f_0(shard_1) = rank0, f_0(shard_2) = rank1] f_0 output ranks = [0, 0, 1] # [f_0(shard_0) = rank0, f_0(shard_2) = rank0, f_0(shard_1) = rank0] # To get the correct order of outputs we want permute indices for output_ranks -> shard_ranks permute_indices = [0, 2, 1] Since outputs are stored by rank, the inter-shard order is lost and the shards on rank 0 would be combined first, making an incorrect combination of f_0's output with the shard ranks = [0, 0, 1]. To keep the correct shard rank of [0, 1, 0] when combining outputs, we generate permute indices for each feature to match the shard ranks. Reviewed By: dstaay-fb Differential Revision: D36944684 fbshipit-source-id: 10f24419e896db0fcd57540a61b767fc62d5e50d
- Loading branch information
1 parent
1b90350
commit 54bcaa8
Showing
7 changed files
with
254 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.