Skip to content

Commit

Permalink
2024-12-03 nightly release (af4cb11)
Browse files Browse the repository at this point in the history
  • Loading branch information
pytorchbot committed Dec 3, 2024
1 parent d8bcf80 commit ea0f687
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
8 changes: 8 additions & 0 deletions torchrec/distributed/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@
except OSError:
pass

try:
from tensordict import TensorDict
except ImportError:

class TensorDict:
pass


logger: logging.Logger = logging.getLogger(__name__)


Expand Down
7 changes: 7 additions & 0 deletions torchrec/distributed/embeddingbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@
except OSError:
pass

try:
from tensordict import TensorDict
except ImportError:

class TensorDict:
pass


def _pin_and_move(tensor: torch.Tensor, device: torch.device) -> torch.Tensor:
return (
Expand Down
2 changes: 1 addition & 1 deletion torchrec/distributed/model_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def named_buffers(
yield key, param

@property
def fused_optimizer(self) -> KeyedOptimizer:
def fused_optimizer(self) -> CombinedOptimizer:
return self._optim

@property
Expand Down
8 changes: 8 additions & 0 deletions torchrec/modules/embedding_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor, KeyedTensor


try:
from tensordict import TensorDict
except ImportError:

class TensorDict:
pass


@torch.fx.wrap
def reorder_inverse_indices(
inverse_indices: Optional[Tuple[List[str], torch.Tensor]],
Expand Down
7 changes: 5 additions & 2 deletions torchrec/sparse/jagged_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@

# OSS
try:
pass
from tensordict import TensorDict
except ImportError:
pass

class TensorDict:
pass


logger: logging.Logger = logging.getLogger()

Expand Down

0 comments on commit ea0f687

Please sign in to comment.