Skip to content

Added TF specific documentation to DistributedEmbedding. #94

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hertschuh
Copy link
Collaborator

No description provided.

@hertschuh hertschuh requested a review from cantonios May 21, 2025 03:25
`DistributedEmbedding` is a layer optimized for TPU chips with SparseCore
and can dramatically improve the speed of embedding lookups and embedding
training, in particular for large embedding tables. It works by combining
multiple lookups in one invocations, and by sharding the embedding tables
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple lookups into one invocation,

and can dramatically improve the speed of embedding lookups and embedding
training, in particular for large embedding tables. It works by combining
multiple lookups in one invocations, and by sharding the embedding tables
across the available chips.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sharding doesn't necessarily make it faster on its own. That leads to more communication for the collective, which can actually slow the lookup down if the table would otherwise fit on a single chip. We might want to specify that it can make lookups faster for large tables that already need to be model-sharded.


### Using in a Keras model

The use Keras' `model.fit()`, one must compile the model under the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use Keras' ...

using the strategy and also automatically distributes the dataset.

```python
model = create_model(embedding)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you create the model under the scope as well, since the layer needs to be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants