Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

RowSparse pull/push #7015

Closed

Conversation

eric-haibin-lin
Copy link
Member

@eric-haibin-lin eric-haibin-lin commented Jul 12, 2017

Opening this PR for interface review:

  • Added row_sparse_pull python API to kvstore and c_api, which requires providing row_id for each row_sparse value to pull. The row_ids are sorted in backend to contain only unique elements. The old pull API will not accept pulling a value stored in row_sparse storage
  • Added kRowSparsePushPull type to kvstore server. When received data request of this type, keys are encoded as key, row_id1, row_id2 ... row_idn.
  • Added temporary support for SparseNDArray inplace add/mul/div/sub by making an extra copy in frontend explicitly
  • See regression example using row_sparse_pull in regression_example.py

Note:

TODOs for next PR:

  • row_ids aggregation for multi-device row_sparse_pull in dist-kvstore
  • lazy initialization for large weights

@mli @reminisce @piiswrong @madjam @stefanhenneking

@reminisce
Copy link
Contributor

Same test failure happened here. It is using the source code of this PR #6955. Such a strange behavior...

zippath = os.path.join(data_dir, data_origin_name)
urllib.urlretrieve(url, zippath)
os.system("bzip2 -d %r" % data_origin_name)
os.chdir("..")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using test_utils.download

@eric-haibin-lin
Copy link
Member Author

@reminisce

fix bug in rsp add

rsp sync push

race condition for push

fix bug in rsp pull. refactor test

cleanup comments

refactor dist server

fix lint

fix storage shape issue with the new ndarray constructor

data sharding draft;

fix lint. add comment

add support for zeros gradients

use std::upper_bound/lower_bound

remove special init function for rowsparse dist kvstore

temporary support for inplace operators for sparse

add test. fix return type

store kRowSparseNDArray in kv server

remove fcomp_ex sgd with dns weight and rsp gradient

bug fix in sparse retain

sparse pull c_api

revise rowsparse pull api

use engine to compute unique to ensure thread safety

add rowsparse pull to dist-kv

fix lint

add example for rsp_pull

remove name2idx;

add sparse_pull_dict param to module

fix unit test and  c rowid conversion
* update kvstore unit test

* update model/module.py

* fix lint

* remove int keys in kvstore

* update cast to str function

* remove _cast_to_str_keys

* fix lint

* always cast to str

Conflicts:
	include/mxnet/c_api.h
	include/mxnet/kvstore.h
	python/mxnet/kvstore.py
	python/mxnet/model.py
	python/mxnet/module/module.py
	src/c_api/c_api.cc
	src/kvstore/kvstore_local.h
	tests/python/unittest/test_kvstore.py
update stypes in kvstore after refactoring

change type of size from size_t to int64_t

add sparse linear regression example

remove sparse_pull_dict from module

fix init_optim for seq_module. update sparse example

resolve conflict for binary add rsp rsp
@eric-haibin-lin eric-haibin-lin force-pushed the pull-rsp-rebase branch 2 times, most recently from 60cac0b to 1c3895a Compare July 26, 2017 04:34
@eric-haibin-lin eric-haibin-lin deleted the pull-rsp-rebase branch October 18, 2017 17:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants