Commit Graph
61 Commits
Author SHA1 Message Date
Alexander Zai 92edca81ea set bind flag after bind completes (#12155) 2018-08-13 18:48:28 -07:00
Przemyslaw Tredak b0f4bbb739 Support for data iterators returning lists of batches (#11112)
* Making list of DataBatches work

* Fix a bug in score

* Fix test_io option in image-classification example

* Fix pylint
2018-06-11 17:23:03 -07:00
Rahul Huilgol 9a8c16427f [MXNET-120] Float16 support for distributed training (#10183)
* send as char

* fix bug on pull response, and rowsparse on worker side

* three modes

* default to mode 0 and add support for row sparse

* refactor sparse

* rowsparse numbytes fixes

* WIP tests

* update test sync

* remove prints

* refactoring

* Revert "refactoring"

This reverts commit 05ffa1bf254057ec70ca6ec1a1deb3b072c31538.

* undo refactoring to keep PR simple

* add wait to stored in pull default

* lint fixes

* undo static cast for recvblob

* lint fixes

* mode 1 changes

* sparse bug fix dtype

* mshadow default

* remove unused var

* remove debug statements

* clearer variables, reduced multiplication, const vars

* add const for more vars, comments

* comment syntax, code watcher, test default val

* remove unnecessary print in test

* trigger ci

* multi precision mode (debugging race condition)

* working rsp pushes

* finish multiprecision for row sparse

* rename num-bytes

* fix bug due to rename of numbytes, and remove debug logs

* address comments

* add integration test

* trigger ci

* integration test

* integration test

* fix path of script

* update mshadow

* disable f16c for amalgamation

* fix amalgamation build

* trigger ci

* disable f16c for jetson
2018-04-11 10:20:56 -07:00
Haibin Lin f60094053e [MXNET-241] Module API for distributed training w/ row_sparse weight (#10285)
* initial commit

update example

update MF example

+deterministic

update LR"

revert

* fix lint

* fix lint 2

* update doc

* update doc

* fix lint

* replace row-id-fn with sparse_row_id_fn. and update doc
2018-04-05 17:52:29 -07:00
Haibin Lin 846f269441 Update module.py (#9658) 2018-01-31 21:06:55 -08:00
Ziyue Huang ec6144f87b a user friendly way to use g2c in module and an example of g2c (#8632)
* a user friendly way to use g2c in module

* also support g2c to be list

* update

* update test

* g2c example

* Update matrix_factorization_model_parallel.py

* address comments

* update

* update

* remove fc

* debug g2c

* Revert "debug g2c"

This reverts commit caabdc5c5fa8618d3ed4db2cbad4e807b63c211e.

* update

* move g2c example to another folder

* update

* readme
2017-11-21 17:15:14 -08:00
Rahul Huilgol cd47962fc4 2bit gradient compression (#8728)
* 2bit gradient compression

* trigger CI
2017-11-20 19:20:50 -08:00
Sheng Zha 504f42ffc5 Revert "2bit gradient compression (#8662)" (#8711)
This reverts commit a499f892c9.
2017-11-19 15:51:42 -08:00
Rahul Huilgol a499f892c9 2bit gradient compression (#8662)
* update two bit compression

* Update trainer.py

* Update test_operator.py

* update two bit compression

* update two bit compression

* update two bit compression

* update

* update

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* update two bit compression

* Update comm.h

* add original size in comrpessed array

* update comm.h

* update distributed training

* update distributed training

* Update ndarray_function.cu

* Update kvstore_dist.h

* Update kvstore_dist.h

* update

* update

* update

* fix bug

* fix

* add GC test

* fix bug in push

* fix push and pull

* fix

* fix

* uncompiled

* kvstore dist changes. added cpp_package. changed strtof function calls

* fix usage of keys in dict

* fix push and pull

* fix

* fix_test

* fix_test

* fix_test

* add print statements

* more print statements and move send command to server

* set compress handling

* kvstore dist changes

* working kvstore push and pull. not sure if I commited that. from this commit removing mutable variable changes for residual array gives working push and pull

* cleanup test

* debug prints

* working kvstore dist. includes mutation of inputs and setting threshold array dtype properly

* fix operator

* kvstore dist changes

* fix compress kvstore issues. non compress is broken

* fix sparse push issue

* fix read lock issue

* optimizer is the only issue now?

* fix all issues with gc dist

* fix read lock issue

* pushing sharded data works

* works most times. sometimes val instead of 0 has parts of 1 or 1.5...

* fix read lock issue

* prev commit fixed seg fault issue on pull without push in a server

* add waittowrite to fix pull before push problems

* refactor quantizing for sharded data

* redo break up of data across servers,clearer split

* refactor to use param for thresholds.
also cleans up code

* Added many checks for 0

* cmake changes

* formatting issues for easier merge

* fix rate

* fix compilation errors after merge

* fix compile error and ndarray thresholds in dequantize

* fix compile error and ndarray thresholds in dequantize

* fix compile error

* fix compile error, and add comments

* update operator comments

* comment checks

* comment checks

* compile error

* working on local kvstore compress test

* fix module api compressparams, and change quantize tblob to inside engine

* 2bit arg wrong kvstore

* remove log

* fix gpu dequantize and tests

* fix seg fault in quantize and test indent

* tests print more info
order of params corrected

* assert almost equal

* more debug stuff
correct profiler message

* intermediate test rewrite

* small change in pushing op to engineh

* fix concurrency of quantization

* wait on kernel

* updated tests and removed prints

* comment unnecessary stuff

* fix test

* remove print

* Update dist_sync_kvstore.py

fix random dist sync test

* remove slow kernel launch init

* cleanup

* undo changes in submodule

* submodule reset

* remove files

* undo changes unrelated to project

* undo changes unrelated to project

* Comments and cleanup.
Remaining are src/kvstore, src/operator and tests

* more cleanup and comments

* comments for tests

* lint changes and comments

* speed up operator test by reducing asnumpy() calls

* random data for test_kvstore_local

* fix variable confusion error in test

* fix randomized data test for local kvstore

* add nrepeat for test_kvstore

* change keys after merge from master introduced same keys

* correct test which fails because grad changes

* change to bit ops

* change to bit ops

* use bit array and revert sign changes

* correct bits setting to 10 as 2

* remove switch in dequantize

* image classification example changes and remove cpp-api

* merge all quantize, and new type in dist server

* fix ndarray dequantize

* debug stuff

* fix bug

* trying merge dequntize

* Frmework and validation tests for operator validation and performance-testing in C++
Normally used for gtest tests.

* Remove obsolete file

* Fix compile error for non-CUDA build

* tweaks in quantize

* Allow for no backward pass

* Remove unused var

* making quantize all compatible as operators

* separate mshadow and loop operators

* working profiler, dequantize mshadow is slow

* fix mshadow dequantize

* fix quantize call by kvdist

* making quantize all compatible as operators

* add profile to measure.py

* minor profiler changes

* timing print in cpp operator

* time quantize

* saving data feature added

* cleanup test

* small updates

* cleanup

* minor fix

* passing additional environment variables through launch.py

* update local test

* update dmlc with pass-env

* fix launch pass env issue

* update with pass-env changes

* fix operator increment of block, remove unncessary commented code

* fix operator increment of block, remove unncessary commented code

* fix operator increment of block, remove unncessary commented code

* fix operator increment of block, remove unncessary commented code

* bring back quantize

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix test

* fix bug with increment of char pointer

* fix bug with increment of char pointer

* debug module

* update test

* comment all debug statements

* change init to normal for now

* remove debug changes

* reorg to create gc class, add delayed start to gc, untested: causing segfault

* redo header files

* remove ps

* remove unused header

* fix compile issues

* remove multiple delete of gc

* add expected to local kvstore test

* fix operator compile issues

* fix operator compile issues

* fix operator compile and link issues

* remove gc.cpp

* add split function

* move setting of active gc

* move all to gc.cpp, compile works for cpu

* WIP gpu compile

* compiles and links on both cpu and gpu

* move prototypes to header

* add split function

* undo changes from master

* remove cpp perf quantize

* undo more changes

* add inactive function so that multiple kvstore dist inits have no compression
fix tests

* undo some formatting changes

* make sharding same when inactive and active

* remove counts and get_active_type

* remove print

* add train caltech

* increase size of mlp

* update to alexa mlp

* pass-env changes

* add bucketing module compression

* attempts for alexnet training

* prepare for merge

* fix lint issues

* fix lint issues

* remove caltech

* address some comments: shared_ptr, documentation, indentaion, new functions, check_eq

* move header

* include header corrected

* include header corrected

* indents, documentation and test update

* lint

* pylint

* rename class, fix local kvstore test, remove confusing active method

* fix importing of compute expected in test_kvstore

* fix bug in device kvstore

* remove active comment in pull

* docstring

* use dmlc params, enums,

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* doc updates

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* lint

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* typo

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* rename field to type

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix distributed kvstore stopping issue.
frontend was sending command with id=stopServer in old enum

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Trigger CI

* trigger CI
2017-11-18 21:16:20 -08:00
Ziyue Huang c9bde1b02b expose group2ctx to module (#8539)
* expose group2ctx to module

* Update test_module.py

* address comments

* update
2017-11-10 12:40:51 -08:00
formath fbfff666ed shared module bug fix (#8185) 2017-10-09 07:31:33 -05:00
Haibin Lin 0b1363116c Sparse Tensor: request for reviews (#7082)
* [WIP] Sparse Tensor  (#5800)

* squash

merge with 38f7c55840

compiles on GPU

update check alloc:

Checkpoint. Pass elem-sum gpu test

bug fix for copyfromto. sparse sgd test pass on gpu

inefficient implementation for csr copy

update submodule

fix lint

Simple bind with infer storage type (#32)

* Symbol binding for sparse tensor development. (#31)

* Initial checkin

* Add init functions for simple bind in graph_executor

* Add simple_bind c_api

* Add simple bind c-api

* Assign zeros to in_args, arg_grads, and aux_states

* Add simple_bind2 python interface

* Fix python interface bugs

* Interface changes

* Fix

* Fix core dump

* Add bind_ith_exec c_api

* Change simple_bind2

* Fix seg fault

* Finish simple_bind

* Change _bind_ith_exec

* Refactor simple_bind initialization flow for bind

* Consolidate bind and simple_bind graph init flow

* Fix bug

* Clean up

* Add comments

* Clean up

* Clean up

* Minor correction

* Rename APIs in graph executor

* Refactor

* Rebase

* Delete deprecated functions

* Move more front-end work to backend

* Bug fix

* Fix failed tests

* Minor fix

* Fix lint

* Fix lint

* Revert unnecessary changes

* Revert

* Revert

* Clean up

* Fix lint

Conflicts:
	python/mxnet/symbol.py
	src/executor/graph_executor.cc

* Add inferstorage to graph executor

* re-enable tests for sparse embedding with simple_bind

* type switch fix in sparse embedding"
;

change `default` to `default_storage` for cast storage op (#33)

* change default to default_storage

* disable cpp test build temporarily

attempt to fix windows build error, and fix lint (#34)

update nnvm submodule (#37)

Scipy build (#38)

* update nnvm submodule

* add scipy pip install for dockerfile

Python3 unit tests (#39)

* change xrange to range for python3 compatiblity"

* remove more xrange from tests

replace long with int for python3 (#40)

fix the rest of TShape constructor errors (#41)

fix lint (#42)

fix wrong usage of mshadow::Shape1" (#43)

implementation for Csr slice on cpu (#36)

* CPU implementation for CSR

remove seg_len from csr slice

add some docs for slice csr

change indptr, values, etc to be private member

bug fix in sparse embedding

update nnvm submoduel

fix lint

update unit test for sparse nd"

* add const for SliceCsrIndPtr kernel

Fix sparse dot according to the new RSP definition (#35)

* Fix csr dot dns

* Fix sparse dot

* Add fallback and test cases for dot(csr, dns)=dns

* Add int type switch

* Fix

* Fix

* Fix

update mshadow submodule (#44)

Fix dns to rsp (#46)

fix lint (#47)

add runtime storage fallback detection" (#48)

* add runtime storage fallback detection"

* replace cast storage ex with cast storage impl

Fm example (#45)

* update csr slice logic to avoid confusion. add more exmaples.

* add hint to module.update

* more testcases(fallback) for sparse_nd

* add to_csr() and to_rsp() method. More unit test (fallback now)

* add fm test. fix lint

* register sparse sgd under Optim.SGD

* update dmlc-core submoduel

* change indptr to _indptr temporarily. add const ref to fname

fix lint

fix lint; (#51)

Guard gpu cast storage (#50)

* Clean up

* Fix typo

Rearrange unit test files (#52)

fix lint. add scipy for python_test. fix scipy.sparse import error. fix truediv for python3

fix travis test (#54)

* remove pyc files

* add verbose for travis nosetests

cleanup some testing code and enums (#57)

* update Makefile

* refactor test_sparse_operator

* change `default_storage` back to `default`

* remove unused cpp tests

port libsvm parser to mxnet as libsvm iter (#55)

* copied csv iter to libsvm iter

test

libsvm iter draft

handle round batch == false for csr batch loader

code refactoring

add get stype, shape interface to iiter

separate class for sparse iter

add missing file

fix mem corruption'

rename variables

add comments

also read label from libsvm

add test. update docs. update submodule

Conflicts:
	python/mxnet/sparse_ndarray.py

* update submodule

* fix lint

* update test

* revert naming change

add benchmark scritp for dot (#59)

* add benchmark scritp for dot

add gpu option for bench

add get_data funciton for benchmark

print t_sparse, too;

add comment

change nnz to dnesity

add backward

* add comment

update fm test (#62)

introduce CSRNDarray and rowsparseNDarray to python frontend api (#58)

* introduce CSRNDarray and rowsparseNDarray to python frontend api

* temporarily disable fm_module test

fix lint (#64)

fix typo. disable libsvm io test (#65)

Improve dot (#61)

* Init checkin

* Fix

* Adjust dot parallelization methods

* Set num_omp_threads for benchmark from command line

* Fix omp thread number

* Clean up

* Add scipy as dot baseline

* Fix format

sparse_retain op (#66)

* Initial checkin

* Fix bugs

* Add unit test for sparse_retain

* Add example and modify test

add storage cast for outputs that have non-default storage (#67)

fix gpu build (#69)

Fix test_sparse_retain python3 issue (#68)

revert nnvm version

* draft for sgd rsp rsp (#75)

support sgd(rsp, rsp)

support dot(csr, rsp) when rsp is full

add ref to const ndarray params

support sparse embedding with rsp weight'

fix lint

modify embedding backward to produce dense grad

remove invalid_rid for rsp->dns

remove previous embedding op changes

pass sparse embedding test

add STORAGE_TYPE_ASSIGN_CHECK

remove backward storage infer

* fix lint (#78)

* fix lint (#79)

* serial elemwise sum impl (#80)

update module kvstore interface

add other missing params and functions

revert some interface changes

revert some more changes

reomve explicit casting for gradients on kvstore

update Comm interface

update fm example

Conflicts:
	python/mxnet/model.py
	python/mxnet/ndarray.py

* bug fix for initializing module with row_sparse weight (#81)

* bug fix for initializing module with row_sparse weight

* update log message

* Sparse ndarray serialization and deserialization (#77)

* Initial checkin

* Add unit tests

* Fix lint

* Fix lint (#84)

* Sgd with row_sparse weight, dns gradient (#83)

* sgd rsp dns draft

* support sgd_mom(rsp, dns, rsp)

* update doc

* remove cast storage for kv updater

* code refactoring

* update mshadow version (#88)

* csr slice bug fix (#90)

* benchmark dot code refactor (#87)

* q^x6x add some code in benchmark

* refactor

* minor fixes

* fix

* lint fix

* Add unit test (#91)

* add unittest

* minor fix

* remove commented lines

* change test func name

* add test rsp

* kvstore push row sparse (#93)

* Add multi-thread cpu elemwise sum for rsps

* Minor fix

* Add flag to switch between serial and multi-thread kvstore push

* Fix lint in sparse_ndarray.py

* Revert "Fix lint in sparse_ndarray.py"

This reverts commit d7225ec267a1e8c0c3c8074d25af5844ed39a14d.

* Fix ndarray init in copy(ctx)

* Add env var to control the flow of serial/parallel reduce

* Refactor

* Fix copy ndarray bug

* Fix lint

* Refactor

* Fix windows openmp build failure (#94)

* update mshadow submoduel (#95)

* Revert "update mshadow submoduel (#95)" (#96)

This reverts commit 1a129e4cc39514a6c7b3aa1189949969b818aec3.

* Refactor sparse tensor code (#99)

* Initial checkin test_sparse_ndarray passes

* Fix test failure

* Clean up

* Clean up

* Move init backend op to ndarray_utils

* Fix lint

* Eliminate circular dependency on headers

* More refactor

* Fix gpu build and consolidate Slice for dense and sparse

* Clean up

* More refactor

* Clean up

* Fix gpu build

* Fix comment

* fix pylint (#100)

* Fix refactor sparse gpu test (#104)

* Fix gpu build

* Fix

* Fix gpu test failure

* change idx types from int32 to int64 (#101)

Conflicts:
	python/mxnet/test_utils.py
	tests/python/unittest/test_sparse_operator.py

update mshadow submodule

fix extra quotes in test script

change indptr type to int64

better err message for rsp"

* revert LOG(DEBUG) change (#105)

* fix undefined zeros in optimizer.py (#106)

* move init dns zeros to init_op.h for kvstore to use (#107)

* Refactor cast storage (#109)

* Refactor cast_storage

* Add cast_storage cc and cu files

* Remove redundant comments

* Replace std::accumulate with ParallelAccumulate

* Clean up

* Fix windows build

* Rowsparse kv (#111)

* update kvstore unit test

Conflicts:
	tests/python/unittest/test_kvstore.py

update model/module.py

Conflicts:
	python/mxnet/model.py
	python/mxnet/module/module.py

fix lint

resolve conflict

remove int keys in kvstore

update cast to str function

* fix failed dist_sync_kv test

* bug fix in comm to ensure merged gradient is of the right type

bug fix in comm

* row sparse dist kvstore draft (push only)

row_sparse pull

* add ndarray row sparse shared mem constructor

* code refactoring

* add test for row_sparse weight

bug fix for kv server slicing

add async support

rsolve race condition in kvstore

* resolve error after reb ase

* fix lint (#113)

* rename some python funciton (#114)

* _to_rsp

* _to_csr. raise NotImplementedError

* todense

* fix lint (#115)

enable libsvm uniit test (#6839)

remove shared mem slice for csr

add csr ndarray iter test

make osx nose test verbose

disable libsvm iter test

Move InferAttr to mxnet from nnvm (#6830)

* Move InferAttr to mxnet from nnvm

Replace nnvm infer attr functions in c_api

Initial checkin

Clean up

Remove nnvm namespace for FInferShape, FInferType, and FInferStorageType

Add new interface for InferStorageType

Revert "Remove nnvm namespace for FInferShape, FInferType, and FInferStorageType"

This reverts commit 8aedf054bfe29b076c6fcb6f54d996fd2752e4de.

Fix and clean up

Fix lint

Add nnvm changes

Change infer function interface to accept only rvalue reference of graph

Clean up

Flush commits to show up in PR

Add error handling for storage type inference failure

Update nnvm

* Fix pylint

Change idx type switch for aux data (#6860)

* Change idx type switch for aux data

* Add mshadow commit

Sparse dot enhancement (#6842)

* Initial checkin

Initial checkin

Fix sparse dot test

Fix unitest and add fallback for sparse dot

* Add benchmark code

* Revert "Add benchmark code"

This reverts commit be009fe4c5a2a321aa92e99ac6e9cc511198c742.

* Fix bug

* Fix storage shape

* Remove unnecessary test code

* Use idx type switch

Implement dot(csr, rsp)=dns and dot(csr.T, rsp)=rsp and refactor (#6902)

* Initial checkin

Add dot(csr.T, rsp)=rsp2

Add infer storage for dot(csr, rsp)=dns and dot(csr.T, rsp)=rsp2

* Fix comments

* Replace std::lower_bound with own impl for gpu use too

* Add time profiling

* Revert "Add time profiling"

This reverts commit 8f5bb982867731df0305148b1b150b05661f8529.

* Move dot and batch_dot to a single file

* Move dot gpu impl to a .cuh file

* More refactor

* Fix include error

LibsvmIter fix (#6898)

* fix bug in libsvm iter which causes mem corruption

* add test for news dataset

* fix wrong path in test

* fix import error for urllib

* update url

* replace bz command with bz module

Optimized gpu dot kernels (#6937)

* pulled update to mshadow

* mshadow update

* added optimized gpu kernels for dot(csr,dns)=dns and dot(csr.T,dns)=dns, and unit test

* added __syncwarp to vector kernel and reduced number of writes to shared memory

Refactor sparse tensor code (#6955)

* Save stype in frontend to avoid c-api call for stype

* Change storage_type to stype

* Revert "Change storage_type to stype"

This reverts commit 90db7d18b624f3ee4ffd37bf5680205e77ca2763.

* Revert "Revert "Change storage_type to stype""

This reverts commit 09328382e926b92a42ba5b3df6f169f825975d88.

Move ndarray.py, sparse_ndarray.py, ndarray_utils.py, and _ndarray_internal to ndarrary folder

More refactor

Move elementwise sum for rsp to ndarray_function.cc

Remove unnecessary import in ndarray module

Fix pylint

Remove redundant code

Remove _stype from slots

Fix cpp-package build error caused by the change to imperative invoke interface

Use relative import

Remove print line

Rename _ndarray_internal.py to _internal.py

* Relaunch test...

minor bug fix in warp synchronous code (#7029)

* move storage type vector from nnvm to mxnet (#7054)

* move storage type vector from nnvm to mxnet

* update nnvm

* update nnvm

* Improve copy sparse tensors (#7003)

* Use cast_storage when copying ndarrays of different stypes on same context

* Relaunch test

* fix failed tests. add back 64bit support for dot

fix lint

* bug fix for IdentityComputeRsp

* fix lint

fix lint

fix lint

* add data partition for libsvm iter (#7027)

* remove sparse embedding (#7165)

* fix ndarray namespace

* remove untested gpu operators (#7172)

* skip sparse dot gpu tset. add sparse_nd_zeros gpu test

* remove sparse_retain gpu

Conflicts:
	tests/python/gpu/test_operator_gpu.py

* Fix ndarray aux data issue (#7098)

* Fix getting sparse ndarray data/aux_data issues

* Add tests for func csr and row_sparse

* Make get/set data/aux_data thread safe

* Fix a bug

* Fix typo and comment

* More comments

* Correct comment

Conflicts:
	tests/python/gpu/test_operator_gpu.py

* Support K-dimensional row-sparse tensor (#7179)

* remove check for k dimensional rowsparse tensor

* change var name for rsp sgd operator

* add checks for sparse dot

* bug fix for kdim rowsparse cast storage cpu

* update IdentityLikeRhsComputeEx interface

* remove set_storage_shape from ndarray. support elemwise_add with kdim row_sparse tensor

* use get_with_shape instead of reshape

* update according to comments

Conflicts:
	src/operator/tensor/elemwise_unary_op.h

* Improve sparse ndarray error message (#7181)

* add test for broadcast_to

* add comments

Conflicts:
	python/mxnet/base.py

* construct row_sparse ndarray for dist-async

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

support str key type in kvstore (#6765)

* 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 module API for other submodules

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

Conflicts:
	python/mxnet/kvstore.py
	tests/python/unittest/test_kvstore.py

* fix DotCsrRspRspImpl error message (#7191)

* GPU implementation of cast_storage (dense to csr) (#7081)

* Added gpu implementation for cast_storage dense to csr, unit tests, and benchmark. Additionally, cast_storage interface change to accommodate the need of temporary storage in cuda kernels.

* fixed whitespace

* minor unittest update

* removed whitespace

* add cast storage benchmark params info

Conflicts:
	tests/python/gpu/test_operator_gpu.py

* Sparse square sum (#7206)

* Add square_sum op

* Add unit test and fix check_numeric_gradient

* Add .cu file and example

* Fix lint

* Remove gpu registration

* Use square_sum in test_module_fm

* Modify and Add documentation for mx.nd.zeros (#7197)

* Modify and Add documentation for mx.nd.zeros

* Change context to cpu

* Change stype to optional

* Change ordering and remove optional for _zeros_sparse_ndarray

* Expose kWriteInplace for imperative execution (fcompute_ex and fstatefulcompute_ex) (#133)

* expose kWriteInplace to FComputeEx and FStatefulComputeEx

* refactor ccode

* remove duplicated test

* Operator add_n for row sparse ndarrays (#7244)

* Add add_n op for row-sparse ndarrays and identity FComputeEx

* Fix bug in square_sum

* Remove test_cast_storage_ex from gpu test since it's not implemented yet

* Fix according to the cr

Conflicts:
	src/operator/tensor/elemwise_sum.cc
	src/operator/tensor/elemwise_unary_op.cc
	tests/python/gpu/test_operator_gpu.py

resolve conflict

* GPU implementation of cast_storage (dense to rsp) (#7223)

* CastStorageDnsRsp GPU Implementation

* updating function doc and some variable types and names

* adding cuda_get_device_prop() util function

* added rand_shape function for n-dimensional tensors

* updated cast storage unit test

* added dns_to_rsp to cast storage benchmark script

* removing redundant unit test

* fix lint

* minor change in benchmark script

* fix lint

* correct function description

* change storage_type to stype

* changed scope of using namespaces

* changed variable types from index_t to dim_t

* resolve merge conflict in ndarray.load

* Improve StatefulOp/FCompute storage fallback (#134)

* test for fcomp fallback

add storage fallback test and optimize fallback logic

rename function, add comments

use std size()

* add autograd test with sparse inputs

* update sparse ndarray api (#139)

* support mx.nd.empty for sparse ndarray

Change SparseNDArray to BaseSparseNDArray

support mx.nd.array with BaseSparseNDArray inputs. Update documentation with explicit subclasses of NDArrays

Conflicts:
	python/mxnet/ndarray/__init__.py
	python/mxnet/ndarray/ndarray.py
	python/mxnet/ndarray/sparse_ndarray.py
	tests/python/unittest/test_sparse_ndarray.py

* fix print msg in test

* Handle ograd_stype='row_sparse' for square_sum backward (#143)

* Add one kernel for square_sum backward pass to take rsp ograd

* Add kNullOp and change to use type_assign in infer stype fallback

* Sparse retain improvement (#138)

* Add one more kernel for sparse retain

* Fix compile

* Change STORAGE_TYPE_ASSIGN_CHECK to type_assign for fallback

* Fix

* Add gpu compile

* ignoring variables in SimpleBind that is used on python's sparse branch for now. (#135)

* add bias term to fm test (#145)

* update ndarray.nd, remove `invoke` from excluded members (#137)

remove __weakref__ from SparseNDArray

add data indice to doc

revert dlpack update

revert mxdoc changes

move methods from BaseSparseNDarray to csrndarray and rwosparse ndarray

* support storage fallback with mutable inputs (#147)

* include mutatable inputs in storage fallback. refactor executor

add fallback test for rms prop and adam

fix lint

fix lint

fix test in optimizer

*  update according to comments

* fix unit tests

* fix gpu compilation err

* Code changes based on reviews (#144)

* code changes according to review comments

remove executor debug. add doc to optimizer

update sparse sgd test

add dtype option to rand_sparse_ndarray

* overhauled reqs for sparse operators

* patch FCompExFallback with mutable inputs. update test_optimizer with more fallback cases

* change executor debug macro to env var

* add comment

* update doc

* change ndarray.aux_shape() to return const reference

* remove todense to_rsp to_csr. replace with tostype

* replace manual calls to cast_storage with tostype

* disable gpu fallback test for optimizer

* fix lint

* add backward pass for cast_storage. refactor cast_storage test

* rand_sparse_ndarray bug fix

* fix cast_storage for gpu

* disable csr test for fp16

* update row sparse ndarray doc

* update doc

* small edits according to reviews (#151)

* fix lint (#152)

* add license to all new files in sparse brnach (#154)

* Allocate temp data on the fly for some casting operations (#149)

* fix utf8 encoding in sparse ndarray

* Extending the GPU dot operator (#7226)

* Added GPU DotCsrRspDnsImpl declaration and TODOs

* cleaning up function doc, variable types, and code-style

* minor bug fixes

* enable GPU dot(csr,rsp)=dns unit test

* extend sparse dot unit test

* adding GPU impl of DotCsrRspDns and its kernels

* add TODO

* changed variable types from index_t to dim_t

* fix function description

* added DotCsrRspRspImpl and its kernels (baseline, functionality)

* added DotCsrDnsRspImpl and its kernels (baseline, functionality); plus code documentation

* refactored dot benchmark

* optimized DotCsrTransDnsRsp GPU kernel

* change of dot impl interface to include OpContext, for temp storage

* removing __device__ flag from CPU kernels

* minor fixes and changing variable data types

* minor fixes based on code reviews

Conflicts:
	benchmark/python/sparse_op.py
	tests/python/gpu/test_operator_gpu.py
	tests/python/unittest/test_sparse_operator.py

* Add get_synthetic_dataset function to util (#146)

* Add get_synthetic_datasets

* Move to test_utils

* Remove _get_uniform_dataset

* Move validation to its own function

* Refactor the validation code for csr generation

* Make test_powerlaw a nested function

* Change SparseNDArray to CSRNDArray

* Merge with dtype specific changes in test_utils

* temporary fix for batch norm storage fallback (#156)

* support random_uniform/normal/gamma with row_sparse output (#155)

* add support for initilazer with rowsparse output

* add scalar assignment to row_sparse

* add setitem test to gpu

* Revert "add scalar assignment to row_sparse"

This reverts commit 8aef7a56c44038f67bbec93811977ea2f9fa3c30.

* Revert "add setitem test to gpu"

This reverts commit 3b969ac0980e8d7166a1cf46878ed2bd457986ed.

* Square sum backward support one more case (#161)

* Add documentation for sparse ops (#148)

*  draft doc for sparse op

* add more stype doc for operators

* add doc for cast_storage

* see also cast_storage. remove base sparse ndarray. fix aux_types comemtn

* grammar / spelling fix

* A few fixes (#163)

* fix batch norm gpu kernel. register random operators on gpu

* register sparse random op on gpu, too

* Minor fixes sparse ops (#160)

* change CPU kernel inline directives, data types, and function doc

* update dot dtype switch to use 32 and 64bit floating point only

* use type_assign instead of STORAGE_TYPE_ASSIGN_CHECK

* added tensor_util-inl.cuh file for common tensor operator GPU kernels

* sparse Adam optimizer (#164)

*  add sparse adam

* register gpu op

* add comments

* cr comments

* kvstore.row_sparse_pull for GPU and end-to-end benchmark: CPU vs. multi-GPUs (#150)

* Add gpu support for BroadcastRowSparse

* Fix bugs

* Add benchmark script

* Increase output dim size

* Update weight on CPU using single GPU for sparse tensors

* More fix

* Optimize sparse_retain for special case

* Change row sparse pull locations

* Avoid sparse retain on cpu if possible

* Use acc for metric

* Fix misc

* fix bug in adam update (#167)

fix a bug in adam update

* change sparse example from regression to classification (#165)

* fix python import (#166)

* Add waitall to sparse_end2end.py (#169)

* Add waitall()

* Add dummy metric option

* Add header license

* Dot script changes (#159)

* Add get_synthetic_datasets

* Move to test_utils

* Remove _get_uniform_dataset

* Move validation to its own function

* Refactor the validation code for csr generation

* Make test_powerlaw a nested function

* Change SparseNDArray to CSRNDArray

* Refactoring changes to dot.py

* Fix mxnet test_utils changes

* Remove pdb statement

* Add distribution parameter

* Refactor benchmarking script

* Remove unused code

* Make style changes and remove unused code

* Change typo in comment

* Add transpose support

* Change typo

* 4 decimal points needed for density

* Add rsp support for real datasets

* Correct variable name mini_file_name

* Move wait_to_read outside if

* Seperate out scipy and mxnet logic in bench_dot

* Fix lhs_trans issue

* Move transpose outside measure_cost

* Compute transpose inside measure_cost

* Remove unused variables

* Transpose only if trans_lhs (#171)

* fix default val for distribution (#172)

* fix lint (#175)

* avoid cast_storage in dist-kvstore-server (#174)

* avoid cast_storage in dist-kvstore-server

* add stream arg to mshadow;;copy

* fix copy order

* Add sparse namespace to ndarray and symbol (#177)

* Register dot, cast_storage, and sparse_retain under mxnet.ndarray.sparse

* Add sparse to symbol namespace

* Delete commented code

* mv sparse_ndarray.py sparse.py

* Clean up

* Change docstring

* changes based on code reviews (#176)

* remove scipy dependency

* move kvstore checks to backned

* add const to lambda

* temp fix to ndarray.md (#178)

* Fix sparse namespace pylint (#179)

* add comments and error msg (#181)

* add clarification for csr (#182)

* add clarification for csr

* cr comments

* revert change in test util (#183)

* fix amalgamation (#184)

* fix lint
2017-08-22 14:56:33 -07:00
Mu Li 251ae71a20 Add license header (#7379)
* add

* add .py and ci

* fix pylint

* update
2017-08-08 16:36:23 -07:00
formath 1f0b8130db assert size eq between shared_module.execs and context (#7233) 2017-08-03 13:01:44 -07:00
Eric Junyuan Xie 4747c6b567 revert module changes (#7055) 2017-07-14 23:11:23 -07:00
Eric Junyuan Xie b88e0d4752 nn interface (#6501)
* mixed nn interface

* fix loss

* fix

* fix prefix kwargs

* refactor names

* fix

* fix

* rnn lint

* fix

* fix

* ignore invalid grad in optimizer

* fix loss shape

* fix

* fix

* post rebase fix

* move nn to mxnet.

* fix

* use cached

* dcgan

* fix

* fix

* lint
2017-07-12 12:27:32 -07:00
Liangfu Chen 2c7f1d85e0 convert to long int for direct comparison (#6869)
* convert to long int for direct comparison

```self._data_shapes[0].shape``` is ```int``` based shape, and ```data_batch.data``` is ```long int``` base shape result.
The change converts both shape variables into ```long int``` for direct comparison.

* Update module.py
2017-07-04 12:20:09 -07:00
Yao Wang ff96822516 Module forward reshape resolving conflicts (#6805)
* Add module reshape

* Module forward reshape

* Small fix

* Pass dtype

* Resolve conflict

* More fix

* Fix lint
2017-06-27 10:15:12 -07:00
Jameson d6d61915aa allow extra params in module set params (#6753)
* allow extra params in Module Loading

* fix lint + one missing init_param

* allow_extra_params -> allow_extra

* added tests
2017-06-22 17:32:09 -07:00
Haibin Lin 1621b76005 support str key type in kvstore (#6765)
* 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
2017-06-22 17:28:58 -07:00
Roshani Nagmote ee918e088e module api formatting fixes (#6406)
* module api formatting fixes

* space added before

* minor fix
2017-05-23 13:38:00 -07:00
Roshani Nagmote 94a429440a Module api page cleanup (#6258)
* Module and Symbol API minor improvements

* link to basemodule

* minor change

* link formatting corrected

* Module class methods linked to BaseModule.

* lint error

* fix

* changes after review

* formatting fixes

* removing sys import
2017-05-19 08:55:25 -07:00
Anirudh Subramanian 5d0767946a Correct typo in set_params doc (#6230) 2017-05-13 11:54:12 +08:00
Zack Chase Lipton b3b21e4e20 Python API revisions (#5687)
* python -> Python (fixed capitalization typo)

* flavours -> flavors for internal consistency with American spellings. Changed 'good flabors' to specify imperative and symbolic programming, better not to tease the reader

* Improved writing of 'History' section

* Improved writing of 'History' section

* fixed symbol.md doc which previously used deprecated / incorrect mxnet.sym.var instead of the real/working mxnet.sym.Variable

* fixed typos and readability in parts of the README.md

* removed awkward phrasing about 'flavours'

* typo cleanup

* Update NEWS.md

Fixed typos

* adding eval function for combining  with , makes for quicker introspection in interactive interpreters

* fixed docstrig

* fixed docstring, cleaned up whitespace

* clean up

* Changed code to work with **kwargs, doesn't require dictionary explicitly. This also removes need for clumsy code to handle the case where there are no arguments

* fixed too-long lines in the docstring

* Update symbol.py

* heavily revised docs in symbol.py

* lightly revised content in ndarray.py

* Update symbol.py

* heavier pass for language on ndarray.py

* fixed docstring line lengths per lint

* fixed string continuation error

* Improved docs for (alphabetically) model.py through visualization.py

* fixing line-too-long pylint bugs

* fixes pylint line length error

* improved documentation further by making cosmetic edits to all other files in the Python API

* edited module .py documents, also modified all .py docs to comply with numpy doc standard and to use double backticks around True, False, and None values

* adding a few files that escaped last commit

* Update name.py

fixed speciry -> specify

* changing binded to bound everywhere, warning for using old attribute name

* debugging indentation error in base_module and Non-ASCII character in rtc.py

* fixed pylint line-too-long errors

* fixing docstring line in bucketing module

* fixing docstring line in bucketing module

* changed 'bound' back to 'binded' in code so that doc changes could be merged in without breaking code
2017-04-10 14:26:59 -07:00
Yao Wang dd51ca3e11 Synchronize parameters to CPU before creating kvstore (#5522) 2017-03-21 15:03:27 -07:00
fukatani d2fc1e6e5e Refactoring about None, spacing and indent. (#5477) 2017-03-18 23:16:06 -07:00
Mu Li 55bb4cd2e0 [doc] refactored api/python/module.py (#5265)
* update navbar, toc, and python api index

* update module
2017-03-06 11:36:12 -08:00
Eric Junyuan Xie 4961c9a66b add data_shapes check (#5190) 2017-02-28 20:39:08 -08:00
Haibin Lin 884b50a1c3 Memory allocator bug fix #5035 (#5133)
* Always pass in the bucket with default_bucket_key as the shared_module while binding new buckets

* Imbalance version of shared pool during plan memory

* Auto search and updated shared mem pool

* Cleanup unused code

* Sort new pool before memory matching. Remove shared pool in PlanMemory. Add test case for bucketing

* Remove itoa().

* Fix lint warnings

* Change total_exec_bytes to private.
2017-02-28 09:25:16 -08:00
Eric Junyuan Xie 0ce9c69ec5 partial set params (#5167)
* partial set params

fix get params

* fix

* fix
2017-02-27 20:33:04 -08:00
Eric Junyuan Xie fa80891c48 add states to modules (#5104)
* add states to modules

* fix
2017-02-27 15:20:22 -08:00
Eric Junyuan Xie dc47e06f6f add api symbol.get_children (#5141) 2017-02-25 14:02:08 -08:00
Eric Junyuan Xie a2730787b1 Refactor initializer (#4644)
* refactor initializer

* fix

* fix

* bump version

* fix

* fix
2017-02-04 23:04:42 -08:00
Eric Junyuan Xie c414f7eabb Keras support (#4690)
* Support incomplete shape in infershape

* add null gradients for logic ops

* Support incomplete shape in infershape

* add null gradients for logic ops

* Update elemwise_binary_broadcast_op.h

* Update elemwise_binary_broadcast_op.h

* fix'

* fix

* module reshape

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2017-01-22 22:49:45 -08:00
zhangjie 1ae2905cc3 logging when save params and optimizer states (#4534) 2017-01-05 12:40:51 -08:00
Eric Junyuan Xie 528dee0903 [Module] add save load optimizer states (#4408) 2016-12-29 01:37:46 -08:00
Eric Junyuan Xie 67061681a7 Layout (#3498)
* refactor layout support

* refactor layout support in module and convolution

* change auto tune strategy

* fix

* fix

* fix
2016-12-29 01:37:46 -08:00
Eric Junyuan Xie 9a6ebe186c refactor test util (#3861) 2016-11-17 22:19:38 -08:00
Yifeng 6f3845091a DType support for data iterator (#3640)
* support global shuffling for image data

* pull latest dmlc-core

* DType support for data iterator

* fix DType for python module

* fix lint and small changes

* revert module bind interface

* trigger ci

* small changes

* small change

* trigger ci

* rename type to dtype

* remove provide_data_types and provide_label_types

* check DataDesc for customered data iter

* support legacy custom iter and add test case

* fix label's tuple(name, shape)

* fix test case

* fix cifar data path

* add legacy tuple test case and fix legacy tuple for prediction

* fix zip in test casefor python3

* fix test case for python3

* disable test

* use a tiny network for test

* add invalid enum for Prefetcher param's dtype
2016-11-13 23:19:19 -08:00
Eric Junyuan Xie 37abdac862 Upmaster (#3597)
* grad weight for softmax

* grad_req for module

* dtype support for variable

* fix lint
2016-10-23 18:44:53 -07:00
Chiyuan Zhang fbef78d5fd fix #3542: move layout_mapper argument out of existing API (#3565) 2016-10-19 00:14:20 -04:00
Chiyuan Zhang 23bf60cab8 Time major data layout support for RNN (#3497)
* rnn-cell demo (push to server for testing)

* a running example with cuDNN RNN cell

* ndarray concatenate

* fix lint errors

* allow batch_axis in executor_group

* add batch_axis parameter for all modules

* fix bug in copy slice implementation

* fix module examples

* use batch_axis if data iterator provided such information

* rnn cell example in time major

* fix init state names in rnn cell bucketing example

* sanity check stochastic depth mnist

* a cifar10 example (not tested)

* add description for sd cifar

* add doc for sd module

* add a simple random number queue

* add final numbers

* fix typo

* default layout mapper

* fix other modules for layout mapper

* fix typo

* softmax output mode that preserves the shape

* comments on run-time speed of time-major

* extend layout mapper to include other information

* fix data layout API change

* fix lint errors

* fix Travis CI numpy error on unit test
2016-10-13 22:54:01 -04:00
Jian Guo fc0bb3920e extend Module to fix_param_names that saves gradient computation and update faster rcnn example (#2794)
* extend Module to fix_param_names that saves gradient computation and update faster rcnn example

* update faster rcnn example to full module api usage

* fix lint

* fix faster rcnn training script

* faster rcnn example remove imcompatible old solver
2016-07-25 20:04:05 -07:00
Eric Junyuan Xie f3cc5b179c Update module.py (#2721) 2016-07-15 14:28:05 -07:00
Junyuan Xie b40ec35779 module monitor 2016-07-03 17:34:10 -07:00
Tianqi Chen 474f74b4b4 [EXEC] More generic segment training api (#2551) 2016-06-28 15:10:32 -07:00
Bing Xu 04754548f3 allow partial set paramter in module (#2482)
allow partial set parameter in module
2016-06-20 14:31:22 -07:00
answeror a77d47d5ec Correct init idx2name on mult-CPU/GPU training
In Module.init_optimizer, idx2name has duplicated items when multiple
contexts are provided.
But _update_params_on_kvstore will be used in this case, and the
duplication of items will cause wrong indexing in Optimizer._get_lr and
Optimizer._get_wd.
2016-06-04 23:58:52 +08:00
Chiyuan Zhang 9e242bc900 a separate config_util module 2016-05-05 16:54:49 -04:00
yzhang87 e2a475f584 Bug fix for BPTT. Remove the rescale_grad in Module (too confusing). 2016-05-05 16:28:24 -04:00