Skip to content

Commit

Permalink
Merge branch 'master' of github.com:andrewmzhang/cirrus-1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmzhang committed Aug 9, 2018
2 parents 7b4acd2 + e1058e3 commit 2e522da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/MultiplePSSparseServerInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ void MultiplePSSparseServerInterface::get_lr_sparse_model(

// Split the dataset based on which server data belongs to.
// XXX consider optimizing this


for (const auto& sample : ds.data_) {
for (const auto& w : sample) {
int server_index = w.first % num_servers;
int data_index = (w.first - server_index) / num_servers;
uint32_t server_index = w.first % num_servers;
uint32_t data_index = (w.first - server_index) / num_servers;
store_value<uint32_t>(msg_lst[server_index], data_index);
num_weights_lst[server_index]++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/PSSparseServerInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void PSSparseServerInterface::get_lr_sparse_model_inplace(const SparseDataset& d
#endif
// build a truly sparse model and return
// XXX this copy could be avoided
lr_model.loadSerializedSparse((FEATURE_TYPE*)buffer, (uint32_t*)msg, num_weights, config);
lr_model.loadSerializedSparse((FEATURE_TYPE*)buffer, (uint32_t*)msg_begin, num_weights, config);

delete[] msg_begin;
delete[] buffer;
Expand Down
1 change: 0 additions & 1 deletion src/SparseLRModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ void SparseLRModel::loadSerializedSparse(const FEATURE_TYPE* weights,
int server_id,
int num_ps) {
is_sparse_ = true;

assert(num_weights > 0 && num_weights < 10000000);
load_value<uint32_t>(weight_indices);
weights_sparse_.reserve((1 << config.get_model_bits()));
Expand Down

0 comments on commit 2e522da

Please sign in to comment.