torchrec 0.2.0.dev0__37-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. examples/__init__.py +0 -0
  2. examples/datasets/__init__.py +8 -0
  3. examples/datasets/criteo_dataframes.py +101 -0
  4. examples/ray/__init__.py +0 -0
  5. examples/ray/compute_world_size.py +51 -0
  6. examples/ray/train_torchrec.py +133 -0
  7. examples/retrieval/__init__.py +6 -0
  8. examples/retrieval/data/__init__.py +6 -0
  9. examples/retrieval/data/dataloader.py +44 -0
  10. examples/retrieval/knn_index.py +67 -0
  11. examples/retrieval/modules/__init__.py +6 -0
  12. examples/retrieval/modules/two_tower.py +229 -0
  13. examples/retrieval/two_tower_retrieval.py +192 -0
  14. examples/retrieval/two_tower_train.py +253 -0
  15. examples/torcharrow/__init__.py +8 -0
  16. examples/torcharrow/dataloader.py +116 -0
  17. examples/torcharrow/run.py +126 -0
  18. fbgemm_gpu/__init__.py +16 -0
  19. fbgemm_gpu/batched_unary_embeddings_ops.py +82 -0
  20. fbgemm_gpu/enums.py +21 -0
  21. fbgemm_gpu/fbgemm_gpu_py.so +0 -0
  22. fbgemm_gpu/permute_pooled_embedding_modules.py +73 -0
  23. fbgemm_gpu/permute_pooled_embedding_modules_split.py +76 -0
  24. fbgemm_gpu/split_embedding_codegen_lookup_invokers/__init__.py +19 -0
  25. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_adagrad.py +120 -0
  26. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_adam.py +149 -0
  27. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_rowwise_adagrad.py +128 -0
  28. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_rowwise_adagrad_with_counter.py +134 -0
  29. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_rowwise_adagrad_with_weight_decay.py +128 -0
  30. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_sgd.py +105 -0
  31. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_args.py +54 -0
  32. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_lamb.py +149 -0
  33. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_lars_sgd.py +128 -0
  34. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_partial_rowwise_adam.py +149 -0
  35. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_partial_rowwise_lamb.py +149 -0
  36. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_adagrad.py +128 -0
  37. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_adagrad_with_counter.py +134 -0
  38. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_adagrad_with_weight_decay.py +128 -0
  39. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_weighted_adagrad.py +130 -0
  40. fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_sgd.py +105 -0
  41. fbgemm_gpu/split_embedding_configs.py +182 -0
  42. fbgemm_gpu/split_embedding_inference_converter.py +208 -0
  43. fbgemm_gpu/split_table_batched_embeddings_ops.py +2503 -0
  44. fbgemm_gpu/uvm.py +35 -0
  45. torchrec/__init__.py +27 -0
  46. torchrec/datasets/__init__.py +31 -0
  47. torchrec/datasets/criteo.py +831 -0
  48. torchrec/datasets/movielens.py +140 -0
  49. torchrec/datasets/random.py +188 -0
  50. torchrec/datasets/scripts/__init__.py +0 -0
  51. torchrec/datasets/scripts/contiguous_preproc_criteo.py +75 -0
  52. torchrec/datasets/scripts/npy_preproc_criteo.py +73 -0
  53. torchrec/datasets/test_utils/__init__.py +0 -0
  54. torchrec/datasets/test_utils/criteo_test_utils.py +139 -0
  55. torchrec/datasets/utils.py +341 -0
  56. torchrec/distributed/__init__.py +55 -0
  57. torchrec/distributed/batched_embedding_kernel.py +697 -0
  58. torchrec/distributed/collective_utils.py +71 -0
  59. torchrec/distributed/comm.py +149 -0
  60. torchrec/distributed/comm_ops.py +930 -0
  61. torchrec/distributed/dist_data.py +949 -0
  62. torchrec/distributed/embedding.py +638 -0
  63. torchrec/distributed/embedding_kernel.py +326 -0
  64. torchrec/distributed/embedding_lookup.py +760 -0
  65. torchrec/distributed/embedding_sharding.py +660 -0
  66. torchrec/distributed/embedding_tower_sharding.py +992 -0
  67. torchrec/distributed/embedding_types.py +369 -0
  68. torchrec/distributed/embeddingbag.py +731 -0
  69. torchrec/distributed/fused_embeddingbag.py +148 -0
  70. torchrec/distributed/grouped_position_weighted.py +103 -0
  71. torchrec/distributed/model_parallel.py +555 -0
  72. torchrec/distributed/planner/__init__.py +24 -0
  73. torchrec/distributed/planner/constants.py +77 -0
  74. torchrec/distributed/planner/enumerators.py +353 -0
  75. torchrec/distributed/planner/parallelized_planners.py +307 -0
  76. torchrec/distributed/planner/partitioners.py +280 -0
  77. torchrec/distributed/planner/perf_models.py +24 -0
  78. torchrec/distributed/planner/planners.py +290 -0
  79. torchrec/distributed/planner/proposers.py +270 -0
  80. torchrec/distributed/planner/shard_estimators.py +971 -0
  81. torchrec/distributed/planner/stats.py +477 -0
  82. torchrec/distributed/planner/storage_reservations.py +168 -0
  83. torchrec/distributed/planner/types.py +423 -0
  84. torchrec/distributed/planner/utils.py +30 -0
  85. torchrec/distributed/quant_embedding.py +307 -0
  86. torchrec/distributed/quant_embedding_kernel.py +295 -0
  87. torchrec/distributed/quant_embeddingbag.py +288 -0
  88. torchrec/distributed/sharding/__init__.py +0 -0
  89. torchrec/distributed/sharding/cw_sequence_sharding.py +71 -0
  90. torchrec/distributed/sharding/cw_sharding.py +242 -0
  91. torchrec/distributed/sharding/dp_sequence_sharding.py +87 -0
  92. torchrec/distributed/sharding/dp_sharding.py +217 -0
  93. torchrec/distributed/sharding/rw_sequence_sharding.py +130 -0
  94. torchrec/distributed/sharding/rw_sharding.py +393 -0
  95. torchrec/distributed/sharding/sequence_sharding.py +69 -0
  96. torchrec/distributed/sharding/tw_sequence_sharding.py +211 -0
  97. torchrec/distributed/sharding/tw_sharding.py +469 -0
  98. torchrec/distributed/sharding/twcw_sharding.py +32 -0
  99. torchrec/distributed/sharding/twrw_sharding.py +543 -0
  100. torchrec/distributed/sharding/vb_cw_sharding.py +91 -0
  101. torchrec/distributed/sharding/vb_rw_sharding.py +250 -0
  102. torchrec/distributed/sharding/vb_sharding.py +54 -0
  103. torchrec/distributed/sharding/vb_tw_sharding.py +148 -0
  104. torchrec/distributed/sharding/vb_twrw_sharding.py +388 -0
  105. torchrec/distributed/test_utils/__init__.py +0 -0
  106. torchrec/distributed/test_utils/multi_process.py +132 -0
  107. torchrec/distributed/test_utils/test_model.py +818 -0
  108. torchrec/distributed/test_utils/test_model_parallel.py +74 -0
  109. torchrec/distributed/test_utils/test_model_parallel_base.py +117 -0
  110. torchrec/distributed/test_utils/test_sharding.py +280 -0
  111. torchrec/distributed/train_pipeline.py +531 -0
  112. torchrec/distributed/types.py +594 -0
  113. torchrec/distributed/utils.py +186 -0
  114. torchrec/fused_planner.py +57 -0
  115. torchrec/fx/__init__.py +15 -0
  116. torchrec/fx/tracer.py +78 -0
  117. torchrec/inference/__init__.py +25 -0
  118. torchrec/inference/client.py +127 -0
  119. torchrec/inference/model_packager.py +102 -0
  120. torchrec/inference/modules.py +155 -0
  121. torchrec/inference/state_dict_transform.py +103 -0
  122. torchrec/metrics/__init__.py +0 -0
  123. torchrec/metrics/auc.py +159 -0
  124. torchrec/metrics/calibration.py +108 -0
  125. torchrec/metrics/ctr.py +104 -0
  126. torchrec/metrics/metric_module.py +358 -0
  127. torchrec/metrics/metrics_config.py +152 -0
  128. torchrec/metrics/metrics_namespace.py +114 -0
  129. torchrec/metrics/model_utils.py +85 -0
  130. torchrec/metrics/mse.py +134 -0
  131. torchrec/metrics/ne.py +164 -0
  132. torchrec/metrics/rec_metric.py +686 -0
  133. torchrec/metrics/throughput.py +174 -0
  134. torchrec/models/__init__.py +27 -0
  135. torchrec/models/deepfm.py +346 -0
  136. torchrec/models/dlrm.py +708 -0
  137. torchrec/modules/__init__.py +34 -0
  138. torchrec/modules/activation.py +55 -0
  139. torchrec/modules/crossnet.py +446 -0
  140. torchrec/modules/deepfm.py +213 -0
  141. torchrec/modules/embedding_configs.py +148 -0
  142. torchrec/modules/embedding_modules.py +381 -0
  143. torchrec/modules/embedding_tower.py +150 -0
  144. torchrec/modules/feature_processor.py +74 -0
  145. torchrec/modules/fused_embedding_modules.py +625 -0
  146. torchrec/modules/lazy_extension.py +258 -0
  147. torchrec/modules/mlp.py +172 -0
  148. torchrec/modules/utils.py +117 -0
  149. torchrec/optim/__init__.py +35 -0
  150. torchrec/optim/clipping.py +53 -0
  151. torchrec/optim/fused.py +42 -0
  152. torchrec/optim/keyed.py +399 -0
  153. torchrec/optim/rowwise_adagrad.py +222 -0
  154. torchrec/optim/test_utils/__init__.py +19 -0
  155. torchrec/optim/warmup.py +147 -0
  156. torchrec/quant/__init__.py +34 -0
  157. torchrec/quant/embedding_modules.py +545 -0
  158. torchrec/sparse/__init__.py +33 -0
  159. torchrec/sparse/jagged_tensor.py +1281 -0
  160. torchrec/sparse/test_utils/__init__.py +45 -0
  161. torchrec/streamable.py +46 -0
  162. torchrec/test_utils/__init__.py +111 -0
  163. torchrec-0.2.dev0.dist-info/LICENSE +29 -0
  164. torchrec-0.2.dev0.dist-info/METADATA +175 -0
  165. torchrec-0.2.dev0.dist-info/RECORD +167 -0
  166. torchrec-0.2.dev0.dist-info/WHEEL +5 -0
  167. torchrec-0.2.dev0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,326 @@
1
+ #!/usr/bin/env python3
2
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+ #
5
+ # This source code is licensed under the BSD-style license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+ import abc
9
+ import logging
10
+ from collections import defaultdict, OrderedDict
11
+ from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
12
+
13
+ import torch
14
+ import torch.distributed as dist
15
+ from torch import nn
16
+ from torchrec.distributed.embedding_types import (
17
+ EmbeddingComputeKernel,
18
+ GroupedEmbeddingConfig,
19
+ ShardedEmbeddingTable,
20
+ )
21
+ from torchrec.distributed.types import Shard, ShardedTensor, ShardedTensorMetadata
22
+ from torchrec.distributed.utils import append_prefix
23
+ from torchrec.modules.embedding_configs import pooling_type_to_str
24
+ from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
25
+
26
+ logger: logging.Logger = logging.getLogger(__name__)
27
+
28
+
29
+ class BaseEmbedding(abc.ABC, nn.Module):
30
+ """
31
+ Abstract base class for grouped `nn.Embedding` and `nn.EmbeddingBag`
32
+ """
33
+
34
+ @abc.abstractmethod
35
+ def forward(
36
+ self,
37
+ features: KeyedJaggedTensor,
38
+ ) -> torch.Tensor:
39
+ """
40
+ Args:
41
+ features (KeyedJaggedTensor):
42
+ Returns:
43
+ torch.Tensor: sparse gradient parameter names.
44
+ """
45
+ pass
46
+
47
+ def sparse_grad_parameter_names(
48
+ self, destination: Optional[List[str]] = None, prefix: str = ""
49
+ ) -> List[str]:
50
+ destination = [] if destination is None else destination
51
+ return destination
52
+
53
+ @property
54
+ @abc.abstractmethod
55
+ def config(self) -> GroupedEmbeddingConfig:
56
+ pass
57
+
58
+
59
+ def get_state_dict(
60
+ embedding_tables: List[ShardedEmbeddingTable],
61
+ params: Union[
62
+ nn.ModuleList,
63
+ List[Union[nn.Module, torch.Tensor]],
64
+ List[torch.Tensor],
65
+ ],
66
+ pg: Optional[dist.ProcessGroup] = None,
67
+ destination: Optional[Dict[str, Any]] = None,
68
+ prefix: str = "",
69
+ ) -> Dict[str, Any]:
70
+ if destination is None:
71
+ destination = OrderedDict()
72
+ # pyre-ignore [16]
73
+ destination._metadata = OrderedDict()
74
+ """
75
+ It is possible for there to be multiple shards from a table on a single rank.
76
+ We accumulate them in key_to_local_shards. Repeat shards should have identical
77
+ global ShardedTensorMetadata.
78
+ """
79
+ key_to_local_shards: Dict[str, List[Shard]] = defaultdict(list)
80
+ key_to_global_metadata: Dict[str, ShardedTensorMetadata] = {}
81
+
82
+ def get_key_from_embedding_table(embedding_table: ShardedEmbeddingTable) -> str:
83
+ return prefix + f"{embedding_table.name}.weight"
84
+
85
+ for embedding_table, param in zip(embedding_tables, params):
86
+ key = get_key_from_embedding_table(embedding_table)
87
+ assert embedding_table.local_rows == param.size(0)
88
+ if embedding_table.compute_kernel not in [
89
+ EmbeddingComputeKernel.QUANT,
90
+ EmbeddingComputeKernel.QUANT_UVM,
91
+ EmbeddingComputeKernel.QUANT_UVM_CACHING,
92
+ ]:
93
+ assert embedding_table.local_cols == param.size(1)
94
+ # for inference there is no pg, all tensors are local
95
+ if embedding_table.global_metadata is not None and pg is not None:
96
+ # set additional field of sharded tensor based on local tensor properties
97
+ embedding_table.global_metadata.tensor_properties.dtype = param.dtype
98
+ embedding_table.global_metadata.tensor_properties.requires_grad = (
99
+ param.requires_grad
100
+ )
101
+ key_to_global_metadata[key] = embedding_table.global_metadata
102
+
103
+ key_to_local_shards[key].append(
104
+ Shard(param, embedding_table.local_metadata)
105
+ )
106
+ else:
107
+ destination[key] = param
108
+
109
+ if pg is not None:
110
+ # Populate the remaining destinations that have a global metadata
111
+ for key in key_to_local_shards:
112
+ global_metadata = key_to_global_metadata[key]
113
+ destination[
114
+ key
115
+ ] = ShardedTensor._init_from_local_shards_and_global_metadata(
116
+ local_shards=key_to_local_shards[key],
117
+ sharded_tensor_metadata=global_metadata,
118
+ process_group=pg,
119
+ )
120
+
121
+ return destination
122
+
123
+
124
+ class GroupedEmbedding(BaseEmbedding):
125
+ def __init__(
126
+ self,
127
+ config: GroupedEmbeddingConfig,
128
+ sparse: bool,
129
+ pg: Optional[dist.ProcessGroup] = None,
130
+ device: Optional[torch.device] = None,
131
+ ) -> None:
132
+ super().__init__()
133
+ torch._C._log_api_usage_once(f"torchrec.distributed.{self.__class__.__name__}")
134
+ self._config = config
135
+ self._pg = pg
136
+ self._emb_modules: nn.ModuleList = nn.ModuleList()
137
+ self._sparse = sparse
138
+ for embedding_config in self._config.embedding_tables:
139
+ self._emb_modules.append(
140
+ nn.Embedding(
141
+ num_embeddings=embedding_config.local_rows,
142
+ embedding_dim=embedding_config.local_cols,
143
+ device=device,
144
+ sparse=self._sparse,
145
+ _weight=torch.empty(
146
+ embedding_config.local_rows,
147
+ embedding_config.local_cols,
148
+ device=device,
149
+ ).uniform_(
150
+ embedding_config.get_weight_init_min(),
151
+ embedding_config.get_weight_init_max(),
152
+ ),
153
+ )
154
+ )
155
+
156
+ def forward(self, features: KeyedJaggedTensor) -> torch.Tensor:
157
+ indices_dict: Dict[str, torch.Tensor] = {}
158
+ indices_list = torch.split(features.values(), features.length_per_key())
159
+ for key, indices in zip(features.keys(), indices_list):
160
+ indices_dict[key] = indices
161
+ unpooled_embeddings: List[torch.Tensor] = []
162
+ for embedding_config, emb_module in zip(
163
+ self._config.embedding_tables, self._emb_modules
164
+ ):
165
+ for feature_name in embedding_config.feature_names:
166
+ unpooled_embeddings.append(emb_module(input=indices_dict[feature_name]))
167
+ return torch.cat(unpooled_embeddings, dim=0)
168
+
169
+ # pyre-fixme[14]: `state_dict` overrides method defined in `Module` inconsistently.
170
+ def state_dict(
171
+ self,
172
+ destination: Optional[Dict[str, Any]] = None,
173
+ prefix: str = "",
174
+ keep_vars: bool = False,
175
+ ) -> Dict[str, Any]:
176
+ params = [
177
+ emb_module.weight if keep_vars else emb_module.weight.data
178
+ for emb_module in self._emb_modules
179
+ ]
180
+ return get_state_dict(
181
+ self._config.embedding_tables, params, self._pg, destination, prefix
182
+ )
183
+
184
+ def named_parameters(
185
+ self, prefix: str = "", recurse: bool = True
186
+ ) -> Iterator[Tuple[str, nn.Parameter]]:
187
+ for config, emb_module in zip(
188
+ self._config.embedding_tables,
189
+ self._emb_modules,
190
+ ):
191
+ param = emb_module.weight
192
+ assert config.local_rows == param.size(0)
193
+ assert config.local_cols == param.size(1)
194
+ yield append_prefix(prefix, f"{config.name}.weight"), param
195
+
196
+ def sparse_grad_parameter_names(
197
+ self, destination: Optional[List[str]] = None, prefix: str = ""
198
+ ) -> List[str]:
199
+ destination = [] if destination is None else destination
200
+ if self._sparse:
201
+ for config in self._config.embedding_tables:
202
+ destination.append(append_prefix(prefix, f"{config.name}.weight"))
203
+ return destination
204
+
205
+ @property
206
+ def config(self) -> GroupedEmbeddingConfig:
207
+ return self._config
208
+
209
+ def named_buffers(
210
+ self, prefix: str = "", recurse: bool = True
211
+ ) -> Iterator[Tuple[str, torch.Tensor]]:
212
+ for config, emb_module in zip(
213
+ self._config.embedding_tables,
214
+ self._emb_modules,
215
+ ):
216
+ yield append_prefix(prefix, f"{config.name}.weight"), emb_module.weight
217
+
218
+
219
+ class GroupedEmbeddingBag(BaseEmbedding):
220
+ def __init__(
221
+ self,
222
+ config: GroupedEmbeddingConfig,
223
+ sparse: bool,
224
+ pg: Optional[dist.ProcessGroup] = None,
225
+ device: Optional[torch.device] = None,
226
+ ) -> None:
227
+ super().__init__()
228
+ torch._C._log_api_usage_once(f"torchrec.distributed.{self.__class__.__name__}")
229
+ self._config = config
230
+ self._pg = pg
231
+ self._emb_modules: nn.ModuleList = nn.ModuleList()
232
+ self._sparse = sparse
233
+ self._emb_names: List[str] = []
234
+ self._lengths_per_emb: List[int] = []
235
+
236
+ for embedding_config in self._config.embedding_tables:
237
+ self._emb_modules.append(
238
+ nn.EmbeddingBag(
239
+ num_embeddings=embedding_config.local_rows,
240
+ embedding_dim=embedding_config.local_cols,
241
+ mode=pooling_type_to_str(embedding_config.pooling),
242
+ device=device,
243
+ include_last_offset=True,
244
+ sparse=self._sparse,
245
+ _weight=torch.empty(
246
+ embedding_config.local_rows,
247
+ embedding_config.local_cols,
248
+ device=device,
249
+ ).uniform_(
250
+ embedding_config.get_weight_init_min(),
251
+ embedding_config.get_weight_init_max(),
252
+ ),
253
+ )
254
+ )
255
+
256
+ def forward(self, features: KeyedJaggedTensor) -> torch.Tensor:
257
+ pooled_embeddings: List[torch.Tensor] = []
258
+ for embedding_config, emb_module in zip(
259
+ self._config.embedding_tables, self._emb_modules
260
+ ):
261
+ for feature_name in embedding_config.feature_names:
262
+ values = features[feature_name].values()
263
+ offsets = features[feature_name].offsets()
264
+ weights = features[feature_name].weights_or_none()
265
+ if weights is not None and not torch.is_floating_point(weights):
266
+ weights = None
267
+ pooled_embeddings.append(
268
+ emb_module(
269
+ input=values,
270
+ offsets=offsets,
271
+ per_sample_weights=weights,
272
+ )
273
+ )
274
+ return torch.cat(pooled_embeddings, dim=1)
275
+
276
+ # pyre-fixme[14]: `state_dict` overrides method defined in `Module` inconsistently.
277
+ def state_dict(
278
+ self,
279
+ destination: Optional[Dict[str, Any]] = None,
280
+ prefix: str = "",
281
+ keep_vars: bool = False,
282
+ ) -> Dict[str, Any]:
283
+ params = [
284
+ emb_module.weight if keep_vars else emb_module.weight.data
285
+ for emb_module in self._emb_modules
286
+ ]
287
+ return get_state_dict(
288
+ self._config.embedding_tables, params, self._pg, destination, prefix
289
+ )
290
+
291
+ def named_parameters(
292
+ self, prefix: str = "", recurse: bool = True
293
+ ) -> Iterator[Tuple[str, nn.Parameter]]:
294
+ for config, emb_module in zip(
295
+ self._config.embedding_tables,
296
+ self._emb_modules,
297
+ ):
298
+ param = emb_module.weight
299
+ assert config.local_rows == param.size(0)
300
+ assert config.local_cols == param.size(1)
301
+ yield append_prefix(prefix, f"{config.name}.weight"), param
302
+
303
+ def named_buffers(
304
+ self, prefix: str = "", recurse: bool = True
305
+ ) -> Iterator[Tuple[str, torch.Tensor]]:
306
+ for config, emb_module in zip(
307
+ self._config.embedding_tables,
308
+ self._emb_modules,
309
+ ):
310
+ param = emb_module.weight
311
+ assert config.local_rows == param.size(0)
312
+ assert config.local_cols == param.size(1)
313
+ yield append_prefix(prefix, f"{config.name}.weight"), param
314
+
315
+ def sparse_grad_parameter_names(
316
+ self, destination: Optional[List[str]] = None, prefix: str = ""
317
+ ) -> List[str]:
318
+ destination = [] if destination is None else destination
319
+ if self._sparse:
320
+ for config in self._config.embedding_tables:
321
+ destination.append(append_prefix(prefix, f"{config.name}.weight"))
322
+ return destination
323
+
324
+ @property
325
+ def config(self) -> GroupedEmbeddingConfig:
326
+ return self._config