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.
- examples/__init__.py +0 -0
- examples/datasets/__init__.py +8 -0
- examples/datasets/criteo_dataframes.py +101 -0
- examples/ray/__init__.py +0 -0
- examples/ray/compute_world_size.py +51 -0
- examples/ray/train_torchrec.py +133 -0
- examples/retrieval/__init__.py +6 -0
- examples/retrieval/data/__init__.py +6 -0
- examples/retrieval/data/dataloader.py +44 -0
- examples/retrieval/knn_index.py +67 -0
- examples/retrieval/modules/__init__.py +6 -0
- examples/retrieval/modules/two_tower.py +229 -0
- examples/retrieval/two_tower_retrieval.py +192 -0
- examples/retrieval/two_tower_train.py +253 -0
- examples/torcharrow/__init__.py +8 -0
- examples/torcharrow/dataloader.py +116 -0
- examples/torcharrow/run.py +126 -0
- fbgemm_gpu/__init__.py +16 -0
- fbgemm_gpu/batched_unary_embeddings_ops.py +82 -0
- fbgemm_gpu/enums.py +21 -0
- fbgemm_gpu/fbgemm_gpu_py.so +0 -0
- fbgemm_gpu/permute_pooled_embedding_modules.py +73 -0
- fbgemm_gpu/permute_pooled_embedding_modules_split.py +76 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/__init__.py +19 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_adagrad.py +120 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_adam.py +149 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_rowwise_adagrad.py +128 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_rowwise_adagrad_with_counter.py +134 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_rowwise_adagrad_with_weight_decay.py +128 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_approx_sgd.py +105 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_args.py +54 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_lamb.py +149 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_lars_sgd.py +128 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_partial_rowwise_adam.py +149 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_partial_rowwise_lamb.py +149 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_adagrad.py +128 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_adagrad_with_counter.py +134 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_adagrad_with_weight_decay.py +128 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_rowwise_weighted_adagrad.py +130 -0
- fbgemm_gpu/split_embedding_codegen_lookup_invokers/lookup_sgd.py +105 -0
- fbgemm_gpu/split_embedding_configs.py +182 -0
- fbgemm_gpu/split_embedding_inference_converter.py +208 -0
- fbgemm_gpu/split_table_batched_embeddings_ops.py +2503 -0
- fbgemm_gpu/uvm.py +35 -0
- torchrec/__init__.py +27 -0
- torchrec/datasets/__init__.py +31 -0
- torchrec/datasets/criteo.py +831 -0
- torchrec/datasets/movielens.py +140 -0
- torchrec/datasets/random.py +188 -0
- torchrec/datasets/scripts/__init__.py +0 -0
- torchrec/datasets/scripts/contiguous_preproc_criteo.py +75 -0
- torchrec/datasets/scripts/npy_preproc_criteo.py +73 -0
- torchrec/datasets/test_utils/__init__.py +0 -0
- torchrec/datasets/test_utils/criteo_test_utils.py +139 -0
- torchrec/datasets/utils.py +341 -0
- torchrec/distributed/__init__.py +55 -0
- torchrec/distributed/batched_embedding_kernel.py +697 -0
- torchrec/distributed/collective_utils.py +71 -0
- torchrec/distributed/comm.py +149 -0
- torchrec/distributed/comm_ops.py +930 -0
- torchrec/distributed/dist_data.py +949 -0
- torchrec/distributed/embedding.py +638 -0
- torchrec/distributed/embedding_kernel.py +326 -0
- torchrec/distributed/embedding_lookup.py +760 -0
- torchrec/distributed/embedding_sharding.py +660 -0
- torchrec/distributed/embedding_tower_sharding.py +992 -0
- torchrec/distributed/embedding_types.py +369 -0
- torchrec/distributed/embeddingbag.py +731 -0
- torchrec/distributed/fused_embeddingbag.py +148 -0
- torchrec/distributed/grouped_position_weighted.py +103 -0
- torchrec/distributed/model_parallel.py +555 -0
- torchrec/distributed/planner/__init__.py +24 -0
- torchrec/distributed/planner/constants.py +77 -0
- torchrec/distributed/planner/enumerators.py +353 -0
- torchrec/distributed/planner/parallelized_planners.py +307 -0
- torchrec/distributed/planner/partitioners.py +280 -0
- torchrec/distributed/planner/perf_models.py +24 -0
- torchrec/distributed/planner/planners.py +290 -0
- torchrec/distributed/planner/proposers.py +270 -0
- torchrec/distributed/planner/shard_estimators.py +971 -0
- torchrec/distributed/planner/stats.py +477 -0
- torchrec/distributed/planner/storage_reservations.py +168 -0
- torchrec/distributed/planner/types.py +423 -0
- torchrec/distributed/planner/utils.py +30 -0
- torchrec/distributed/quant_embedding.py +307 -0
- torchrec/distributed/quant_embedding_kernel.py +295 -0
- torchrec/distributed/quant_embeddingbag.py +288 -0
- torchrec/distributed/sharding/__init__.py +0 -0
- torchrec/distributed/sharding/cw_sequence_sharding.py +71 -0
- torchrec/distributed/sharding/cw_sharding.py +242 -0
- torchrec/distributed/sharding/dp_sequence_sharding.py +87 -0
- torchrec/distributed/sharding/dp_sharding.py +217 -0
- torchrec/distributed/sharding/rw_sequence_sharding.py +130 -0
- torchrec/distributed/sharding/rw_sharding.py +393 -0
- torchrec/distributed/sharding/sequence_sharding.py +69 -0
- torchrec/distributed/sharding/tw_sequence_sharding.py +211 -0
- torchrec/distributed/sharding/tw_sharding.py +469 -0
- torchrec/distributed/sharding/twcw_sharding.py +32 -0
- torchrec/distributed/sharding/twrw_sharding.py +543 -0
- torchrec/distributed/sharding/vb_cw_sharding.py +91 -0
- torchrec/distributed/sharding/vb_rw_sharding.py +250 -0
- torchrec/distributed/sharding/vb_sharding.py +54 -0
- torchrec/distributed/sharding/vb_tw_sharding.py +148 -0
- torchrec/distributed/sharding/vb_twrw_sharding.py +388 -0
- torchrec/distributed/test_utils/__init__.py +0 -0
- torchrec/distributed/test_utils/multi_process.py +132 -0
- torchrec/distributed/test_utils/test_model.py +818 -0
- torchrec/distributed/test_utils/test_model_parallel.py +74 -0
- torchrec/distributed/test_utils/test_model_parallel_base.py +117 -0
- torchrec/distributed/test_utils/test_sharding.py +280 -0
- torchrec/distributed/train_pipeline.py +531 -0
- torchrec/distributed/types.py +594 -0
- torchrec/distributed/utils.py +186 -0
- torchrec/fused_planner.py +57 -0
- torchrec/fx/__init__.py +15 -0
- torchrec/fx/tracer.py +78 -0
- torchrec/inference/__init__.py +25 -0
- torchrec/inference/client.py +127 -0
- torchrec/inference/model_packager.py +102 -0
- torchrec/inference/modules.py +155 -0
- torchrec/inference/state_dict_transform.py +103 -0
- torchrec/metrics/__init__.py +0 -0
- torchrec/metrics/auc.py +159 -0
- torchrec/metrics/calibration.py +108 -0
- torchrec/metrics/ctr.py +104 -0
- torchrec/metrics/metric_module.py +358 -0
- torchrec/metrics/metrics_config.py +152 -0
- torchrec/metrics/metrics_namespace.py +114 -0
- torchrec/metrics/model_utils.py +85 -0
- torchrec/metrics/mse.py +134 -0
- torchrec/metrics/ne.py +164 -0
- torchrec/metrics/rec_metric.py +686 -0
- torchrec/metrics/throughput.py +174 -0
- torchrec/models/__init__.py +27 -0
- torchrec/models/deepfm.py +346 -0
- torchrec/models/dlrm.py +708 -0
- torchrec/modules/__init__.py +34 -0
- torchrec/modules/activation.py +55 -0
- torchrec/modules/crossnet.py +446 -0
- torchrec/modules/deepfm.py +213 -0
- torchrec/modules/embedding_configs.py +148 -0
- torchrec/modules/embedding_modules.py +381 -0
- torchrec/modules/embedding_tower.py +150 -0
- torchrec/modules/feature_processor.py +74 -0
- torchrec/modules/fused_embedding_modules.py +625 -0
- torchrec/modules/lazy_extension.py +258 -0
- torchrec/modules/mlp.py +172 -0
- torchrec/modules/utils.py +117 -0
- torchrec/optim/__init__.py +35 -0
- torchrec/optim/clipping.py +53 -0
- torchrec/optim/fused.py +42 -0
- torchrec/optim/keyed.py +399 -0
- torchrec/optim/rowwise_adagrad.py +222 -0
- torchrec/optim/test_utils/__init__.py +19 -0
- torchrec/optim/warmup.py +147 -0
- torchrec/quant/__init__.py +34 -0
- torchrec/quant/embedding_modules.py +545 -0
- torchrec/sparse/__init__.py +33 -0
- torchrec/sparse/jagged_tensor.py +1281 -0
- torchrec/sparse/test_utils/__init__.py +45 -0
- torchrec/streamable.py +46 -0
- torchrec/test_utils/__init__.py +111 -0
- torchrec-0.2.dev0.dist-info/LICENSE +29 -0
- torchrec-0.2.dev0.dist-info/METADATA +175 -0
- torchrec-0.2.dev0.dist-info/RECORD +167 -0
- torchrec-0.2.dev0.dist-info/WHEEL +5 -0
- torchrec-0.2.dev0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,270 @@
|
|
|
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 copy
|
|
9
|
+
import itertools
|
|
10
|
+
import logging
|
|
11
|
+
from typing import cast, Dict, List, Optional, Set, Tuple
|
|
12
|
+
|
|
13
|
+
from torchrec.distributed.planner.types import Proposer, ShardingOption
|
|
14
|
+
from torchrec.distributed.planner.utils import prod
|
|
15
|
+
|
|
16
|
+
logger: logging.Logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
MAX_PROPOSALS: int = int(1e4)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class GreedyProposer(Proposer):
|
|
22
|
+
"""
|
|
23
|
+
Proposes sharding plans in greedy fashion.
|
|
24
|
+
|
|
25
|
+
Sorts sharding options for each shardable parameter by perf.
|
|
26
|
+
On each iteration, finds parameter with largest current storage usage and tries its
|
|
27
|
+
next sharding option.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(self, use_depth: bool = True) -> None:
|
|
31
|
+
self._use_depth: bool = use_depth
|
|
32
|
+
self._sharding_options_by_fqn: Dict[str, List[ShardingOption]] = {}
|
|
33
|
+
self._current_proposal: Dict[str, int] = {}
|
|
34
|
+
|
|
35
|
+
def load(self, search_space: List[ShardingOption]) -> None:
|
|
36
|
+
self._reset()
|
|
37
|
+
for sharding_option in search_space:
|
|
38
|
+
fqn = sharding_option.fqn
|
|
39
|
+
if fqn not in self._sharding_options_by_fqn:
|
|
40
|
+
self._sharding_options_by_fqn[fqn] = []
|
|
41
|
+
self._sharding_options_by_fqn[fqn].append(sharding_option)
|
|
42
|
+
|
|
43
|
+
for sharding_options in self._sharding_options_by_fqn.values():
|
|
44
|
+
sharding_options.sort(
|
|
45
|
+
key=lambda x: _sharding_option_score(x, self._use_depth)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
self._current_proposal = {
|
|
49
|
+
fqn: 0 for fqn in self._sharding_options_by_fqn.keys()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
def _reset(self) -> None:
|
|
53
|
+
self._sharding_options_by_fqn = {}
|
|
54
|
+
self._current_proposal = {}
|
|
55
|
+
|
|
56
|
+
def propose(self) -> Optional[List[ShardingOption]]:
|
|
57
|
+
if self._current_proposal:
|
|
58
|
+
return copy.deepcopy(
|
|
59
|
+
[
|
|
60
|
+
self._sharding_options_by_fqn[fqn][index]
|
|
61
|
+
for fqn, index in self._current_proposal.items()
|
|
62
|
+
]
|
|
63
|
+
)
|
|
64
|
+
else:
|
|
65
|
+
return None
|
|
66
|
+
|
|
67
|
+
def feedback(
|
|
68
|
+
self,
|
|
69
|
+
partitionable: bool,
|
|
70
|
+
plan: Optional[List[ShardingOption]] = None,
|
|
71
|
+
perf_rating: Optional[float] = None,
|
|
72
|
+
) -> None:
|
|
73
|
+
# static strategy, ignore feedback and just provide next proposal
|
|
74
|
+
largest_fqn: Optional[str] = None
|
|
75
|
+
largest_storage: Tuple[float, float, float, float] = (0, 0, 0, 0)
|
|
76
|
+
for fqn, sharding_options in self._sharding_options_by_fqn.items():
|
|
77
|
+
index = self._current_proposal[fqn]
|
|
78
|
+
if index + 1 < len(sharding_options):
|
|
79
|
+
sharding_option = sharding_options[index]
|
|
80
|
+
current_storage = (
|
|
81
|
+
# pyre-fixme [16]: `Optional` has no attribute `hbm`
|
|
82
|
+
max([shard.storage.hbm for shard in sharding_option.shards]),
|
|
83
|
+
sum([shard.storage.hbm for shard in sharding_option.shards]),
|
|
84
|
+
# pyre-fixme [16]: `Optional` has no attribute `ddr`
|
|
85
|
+
max([shard.storage.ddr for shard in sharding_option.shards]),
|
|
86
|
+
sum([shard.storage.ddr for shard in sharding_option.shards]),
|
|
87
|
+
)
|
|
88
|
+
if current_storage > largest_storage:
|
|
89
|
+
largest_fqn = fqn
|
|
90
|
+
largest_storage = current_storage
|
|
91
|
+
|
|
92
|
+
if largest_fqn is not None:
|
|
93
|
+
self._current_proposal[largest_fqn] += 1
|
|
94
|
+
else:
|
|
95
|
+
self._current_proposal = {}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class UniformProposer(Proposer):
|
|
99
|
+
"""
|
|
100
|
+
Proposes uniform sharding plans, plans that have the same sharding type for all
|
|
101
|
+
sharding options.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
def __init__(self, use_depth: bool = True) -> None:
|
|
105
|
+
self._use_depth: bool = use_depth
|
|
106
|
+
self._grouped_sharding_options: List[List[ShardingOption]] = []
|
|
107
|
+
self._proposal_index: int = 0
|
|
108
|
+
|
|
109
|
+
def load(self, search_space: List[ShardingOption]) -> None:
|
|
110
|
+
self._reset()
|
|
111
|
+
all_fqns = set()
|
|
112
|
+
sharding_options_by_type_and_fqn: Dict[
|
|
113
|
+
str, Dict[str, List[ShardingOption]]
|
|
114
|
+
] = {}
|
|
115
|
+
|
|
116
|
+
for sharding_option in search_space:
|
|
117
|
+
sharding_type = sharding_option.sharding_type
|
|
118
|
+
fqn = sharding_option.fqn
|
|
119
|
+
all_fqns.add(fqn)
|
|
120
|
+
|
|
121
|
+
if sharding_type not in sharding_options_by_type_and_fqn:
|
|
122
|
+
sharding_options_by_type_and_fqn[sharding_type] = {}
|
|
123
|
+
if fqn not in sharding_options_by_type_and_fqn[sharding_type]:
|
|
124
|
+
sharding_options_by_type_and_fqn[sharding_type][fqn] = []
|
|
125
|
+
|
|
126
|
+
sharding_options_by_type_and_fqn[sharding_type][fqn].append(sharding_option)
|
|
127
|
+
|
|
128
|
+
for sharding_options_by_fqn in sharding_options_by_type_and_fqn.values():
|
|
129
|
+
for sharding_options in sharding_options_by_fqn.values():
|
|
130
|
+
sharding_options.sort(
|
|
131
|
+
key=lambda x: _sharding_option_score(x, self._use_depth)
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
for sharding_options_by_fqn in sharding_options_by_type_and_fqn.values():
|
|
135
|
+
if sharding_options_by_fqn.keys() == all_fqns:
|
|
136
|
+
self._grouped_sharding_options.append(
|
|
137
|
+
[
|
|
138
|
+
sorted_sharding_options[0]
|
|
139
|
+
for sorted_sharding_options in sharding_options_by_fqn.values()
|
|
140
|
+
]
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
def _reset(self) -> None:
|
|
144
|
+
self._grouped_sharding_options = []
|
|
145
|
+
self._proposal_index = 0
|
|
146
|
+
|
|
147
|
+
def propose(self) -> Optional[List[ShardingOption]]:
|
|
148
|
+
if self._proposal_index < len(self._grouped_sharding_options):
|
|
149
|
+
return copy.deepcopy(self._grouped_sharding_options[self._proposal_index])
|
|
150
|
+
else:
|
|
151
|
+
return None
|
|
152
|
+
|
|
153
|
+
def feedback(
|
|
154
|
+
self,
|
|
155
|
+
partitionable: bool,
|
|
156
|
+
plan: Optional[List[ShardingOption]] = None,
|
|
157
|
+
perf_rating: Optional[float] = None,
|
|
158
|
+
) -> None:
|
|
159
|
+
# static strategy, ignore feedback and just provide next proposal
|
|
160
|
+
self._proposal_index += 1
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class GridSearchProposer(Proposer):
|
|
164
|
+
def __init__(self, max_proposals: int = MAX_PROPOSALS) -> None:
|
|
165
|
+
self._max_proposals: int = max_proposals
|
|
166
|
+
self._sharding_options_by_fqn: Dict[str, List[ShardingOption]] = {}
|
|
167
|
+
self._proposal_index: int = 0
|
|
168
|
+
self._proposals: List[List[int]] = []
|
|
169
|
+
|
|
170
|
+
def load(self, search_space: List[ShardingOption]) -> None:
|
|
171
|
+
self._reset()
|
|
172
|
+
for sharding_option in search_space:
|
|
173
|
+
fqn = sharding_option.fqn
|
|
174
|
+
if fqn not in self._sharding_options_by_fqn:
|
|
175
|
+
self._sharding_options_by_fqn[fqn] = []
|
|
176
|
+
self._sharding_options_by_fqn[fqn].append(sharding_option)
|
|
177
|
+
|
|
178
|
+
for sharding_options in self._sharding_options_by_fqn.values():
|
|
179
|
+
sharding_options.sort(key=lambda x: _sharding_option_score(x))
|
|
180
|
+
|
|
181
|
+
total_proposals = prod(
|
|
182
|
+
[
|
|
183
|
+
len(sharding_options)
|
|
184
|
+
for sharding_options in self._sharding_options_by_fqn.values()
|
|
185
|
+
]
|
|
186
|
+
)
|
|
187
|
+
if total_proposals > self._max_proposals:
|
|
188
|
+
total_proposals = (
|
|
189
|
+
"{:.2e}".format(total_proposals)
|
|
190
|
+
if total_proposals > 1e6
|
|
191
|
+
else total_proposals
|
|
192
|
+
)
|
|
193
|
+
logger.info(
|
|
194
|
+
"Skipping grid search proposer as there are too many proposals.\n"
|
|
195
|
+
f"Total proposals to search: {total_proposals}\n"
|
|
196
|
+
f"Max proposals allowed: {self._max_proposals}\n"
|
|
197
|
+
)
|
|
198
|
+
return
|
|
199
|
+
sharding_options_by_fqn_indices = [
|
|
200
|
+
range(len(sharding_options))
|
|
201
|
+
for sharding_options in self._sharding_options_by_fqn.values()
|
|
202
|
+
]
|
|
203
|
+
self._proposals = list(itertools.product(*sharding_options_by_fqn_indices))
|
|
204
|
+
|
|
205
|
+
def _reset(self) -> None:
|
|
206
|
+
self._sharding_options_by_fqn = {}
|
|
207
|
+
self._proposal_index = 0
|
|
208
|
+
self._proposals = []
|
|
209
|
+
|
|
210
|
+
def propose(self) -> Optional[List[ShardingOption]]:
|
|
211
|
+
if self._proposals and self._proposal_index < len(self._proposals):
|
|
212
|
+
proposal_indices = self._proposals[self._proposal_index]
|
|
213
|
+
return [
|
|
214
|
+
sharding_options[index]
|
|
215
|
+
for index, sharding_options in zip(
|
|
216
|
+
proposal_indices, self._sharding_options_by_fqn.values()
|
|
217
|
+
)
|
|
218
|
+
]
|
|
219
|
+
else:
|
|
220
|
+
return None
|
|
221
|
+
|
|
222
|
+
def feedback(
|
|
223
|
+
self,
|
|
224
|
+
partitionable: bool,
|
|
225
|
+
plan: Optional[List[ShardingOption]] = None,
|
|
226
|
+
perf_rating: Optional[float] = None,
|
|
227
|
+
) -> None:
|
|
228
|
+
# static strategy, ignore feedback and just provide next proposal
|
|
229
|
+
self._proposal_index += 1
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def _sharding_option_score(
|
|
233
|
+
sharding_option: ShardingOption, use_depth: bool = True
|
|
234
|
+
) -> float:
|
|
235
|
+
return (
|
|
236
|
+
max([cast(float, shard.perf) for shard in sharding_option.shards])
|
|
237
|
+
if use_depth
|
|
238
|
+
else sum([cast(float, shard.perf) for shard in sharding_option.shards])
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def proposers_to_proposals_list(
|
|
243
|
+
proposers_list: List[Proposer], search_space: List[ShardingOption]
|
|
244
|
+
) -> List[List[ShardingOption]]:
|
|
245
|
+
"""
|
|
246
|
+
only works for static_feedback proposers (the path of proposals to check is independent of the performance of the proposals)
|
|
247
|
+
"""
|
|
248
|
+
|
|
249
|
+
proposals_list = []
|
|
250
|
+
|
|
251
|
+
proposal_cache: Set[Tuple[int, ...]] = set()
|
|
252
|
+
|
|
253
|
+
for proposer in proposers_list:
|
|
254
|
+
proposer.load(search_space=search_space)
|
|
255
|
+
|
|
256
|
+
for proposer in proposers_list:
|
|
257
|
+
proposal = proposer.propose()
|
|
258
|
+
|
|
259
|
+
while proposal:
|
|
260
|
+
proposal_key = tuple(sorted(map(hash, proposal)))
|
|
261
|
+
proposer.feedback(partitionable=True)
|
|
262
|
+
if proposal_key in proposal_cache:
|
|
263
|
+
proposal = proposer.propose()
|
|
264
|
+
continue
|
|
265
|
+
|
|
266
|
+
proposals_list.append(proposal)
|
|
267
|
+
proposal_cache.add(proposal_key)
|
|
268
|
+
proposal = proposer.propose()
|
|
269
|
+
|
|
270
|
+
return proposals_list
|