-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024-10-03 nightly release (642da8e)
- Loading branch information
pytorchbot
committed
Oct 3, 2024
1 parent
072843a
commit 83a353c
Showing
29 changed files
with
616 additions
and
828 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Data Types | ||
------------------- | ||
|
||
|
||
TorchRec contains data types for representing embedding, otherwise known as sparse features. | ||
Sparse features are typically indices that are meant to be fed into embedding tables. For a given | ||
batch, the number of embedding lookup indices are variable. Therefore, there is a need for a **jagged** | ||
dimension to represent the variable amount of embedding lookup indices for a batch. | ||
|
||
This section covers the classes for the 3 TorchRec data types for representing sparse features: | ||
**JaggedTensor**, **KeyedJaggedTensor**, and **KeyedTensor**. | ||
|
||
.. automodule:: torchrec.sparse.jagged_tensor | ||
|
||
.. autoclass:: JaggedTensor | ||
:members: | ||
|
||
.. autoclass:: KeyedJaggedTensor | ||
:members: | ||
|
||
.. autoclass:: KeyedTensor | ||
:members: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Inference | ||
---------------------------------- | ||
|
||
TorchRec provides easy-to-use APIs for transforming an authored TorchRec model | ||
into an optimized inference model for distributed inference, via eager module swaps. | ||
|
||
This transforms TorchRec modules like ``EmbeddingBagCollection`` in the model to | ||
a quantized, sharded version that can be compiled using torch.fx and TorchScript | ||
for inference in a C++ environment. | ||
|
||
The intended use is calling ``quantize_inference_model`` on the model followed by | ||
``shard_quant_model``. | ||
|
||
.. codeblock:: | ||
|
||
.. automodule:: torchrec.inference.modules | ||
|
||
.. autofunction:: quantize_inference_model | ||
.. autofunction:: shard_quant_model |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Model Parallel | ||
---------------------------------- | ||
|
||
``DistributedModelParallel`` is the main API for distributed training with TorchRec optimizations. | ||
|
||
|
||
.. automodule:: torchrec.distributed.model_parallel | ||
|
||
.. autoclass:: DistributedModelParallel | ||
:members: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Modules | ||
---------------------------------- | ||
|
||
Standard TorchRec modules represent collections of embedding tables: | ||
|
||
* ``EmbeddingBagCollection`` is a collection of ``torch.nn.EmbeddingBag`` | ||
* ``EmbeddingCollection`` is a collection of ``torch.nn.Embedding`` | ||
|
||
These modules are constructed through standardized config classes: | ||
|
||
* ``EmbeddingBagConfig`` for ``EmbeddingBagCollection`` | ||
* ``EmbeddingConfig`` for ``EmbeddingCollection`` | ||
|
||
.. automodule:: torchrec.modules.embedding_configs | ||
|
||
.. autoclass:: EmbeddingBagConfig | ||
:show-inheritance: | ||
|
||
.. autoclass:: EmbeddingConfig | ||
:show-inheritance: | ||
|
||
.. autoclass:: BaseEmbeddingConfig | ||
|
||
.. automodule:: torchrec.modules.embedding_modules | ||
|
||
.. autoclass:: EmbeddingBagCollection | ||
:members: | ||
|
||
.. autoclass:: EmbeddingCollection | ||
:members: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Planner | ||
---------------------------------- | ||
|
||
The TorchRec Planner is responsible for determining the most performant, balanced | ||
sharding plan for distributed training and inference. | ||
|
||
The main API for generating a sharding plan is ``EmbeddingShardingPlanner.plan`` | ||
|
||
.. automodule:: torchrec.distributed.types | ||
|
||
.. autoclass:: ShardingPlan | ||
:members: | ||
|
||
.. automodule:: torchrec.distributed.planner.planners | ||
|
||
.. autoclass:: EmbeddingShardingPlanner | ||
:members: | ||
|
||
.. automodule:: torchrec.distributed.planner.enumerators | ||
|
||
.. autoclass:: EmbeddingEnumerator | ||
:members: | ||
|
||
.. automodule:: torchrec.distributed.planner.partitioners | ||
|
||
.. autoclass:: GreedyPerfPartitioner | ||
:members: | ||
|
||
|
||
.. automodule:: torchrec.distributed.planner.storage_reservations | ||
|
||
.. autoclass:: HeuristicalStorageReservation | ||
:members: | ||
|
||
.. automodule:: torchrec.distributed.planner.proposers | ||
|
||
.. autoclass:: GreedyProposer | ||
:members: | ||
|
||
|
||
.. automodule:: torchrec.distributed.planner.shard_estimators | ||
|
||
.. autoclass:: EmbeddingPerfEstimator | ||
:members: | ||
|
||
|
||
.. automodule:: torchrec.distributed.planner.shard_estimators | ||
|
||
.. autoclass:: EmbeddingStorageEstimator | ||
:members: |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.