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

Sequence last fix #16156

Merged
merged 10 commits into from
Sep 16, 2019
Merged

Sequence last fix #16156

merged 10 commits into from
Sep 16, 2019

Conversation

ChaiBapchya
Copy link
Contributor

@ChaiBapchya ChaiBapchya commented Sep 12, 2019

Description

Pass dtype to sequence_last operator.

Why?
Unless explicitly specified, default MXNet implementation turns NDArray into dtype=Float32
However, indices need to support int64 (>2**32)

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Code is well-documented:
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Fix dtypes

Comments

Hopefully, for v2.0 of MXNet, we introduce API breaking change of ensuring NDArray for indices are either int32 or int64

@ChaiBapchya
Copy link
Contributor Author

@mxnet-label-bot add [pr-awaiting-review]

@ChaiBapchya
Copy link
Contributor Author

@access2rohit @apeforest take a look. Thanks.

@ChaiBapchya
Copy link
Contributor Author

nosetests -s -v tests/nightly/test_large_vector.py:test_sequence_last
test_large_vector.test_sequence_last ... ok

----------------------------------------------------------------------
Ran 1 test in 5.177s

OK

@access2rohit
Copy link
Contributor

access2rohit commented Sep 12, 2019

@ChaiBapchya Can you also run the full suite of tests again and paste the results here once they are done

@ChaiBapchya
Copy link
Contributor Author

ChaiBapchya commented Sep 12, 2019

For C5.18xl instance (similar to the one used to run Nightly build)

topk,argsort,sort - ERROR
mxnet.base.MXNetError: [21:29:51] src/storage/./cpu_device_storage.h:75: Failed to allocate CPU Memory

multinomial - fails due to memory shortage

nosetests -s -v tests/nightly/test_large_vector.py
test_large_vector.test_slice ... ok
test_large_vector.test_ndarray_zeros ... ok
test_large_vector.test_ndarray_ones ... ok
test_large_vector.test_ndarray_random_uniform ... ok
test_large_vector.test_ndarray_random_randint ... [INFO] Setting test np/mx/python random seeds, use MXNET_TEST_SEED=1806641233 to reproduce.
FAIL
test_large_vector.test_ndarray_empty ... ok
test_large_vector.test_elementwise ... ok
test_large_vector.test_clip ... ok
test_large_vector.test_argmin ... ok
test_large_vector.test_take ... ok
test_large_vector.test_slice_assign ... ok
test_large_vector.test_expand_dims ... ok
test_large_vector.test_squeeze ... ok
test_large_vector.test_broadcast_div ... ok
test_large_vector.test_Dense ... ok
test_large_vector.test_argsort ... ERROR
test_large_vector.test_sort ... ERROR
test_large_vector.test_topk ... ERROR
test_large_vector.test_mean ... ok
test_large_vector.test_ndarray_random_exponential ... ok
test_large_vector.test_ndarray_random_gamma ... ok
test_large_vector.test_ndarray_random_generalized_negative_binomial ... ok
test_large_vector.test_ndarray_random_multinomial ... *** Error in `/home/ubuntu/anaconda3/bin/python': double free or corruption (fasttop):

Upon running multinomial individually it passes

nosetests -s -v tests/nightly/test_large_vector.py:test_ndarray_random_multinomial
test_large_vector.test_ndarray_random_multinomial ... ok

----------------------------------------------------------------------
Ran 1 test in 50.371s

OK

@ChaiBapchya
Copy link
Contributor Author

ChaiBapchya commented Sep 12, 2019

Subsequent run (commenting the ones already tested)

nosetests -s -v tests/nightly/test_large_vector.py
test_large_vector.test_ndarray_random_negative_binomial ... ok
test_large_vector.test_ndarray_random_normal ... ok
test_large_vector.test_ndarray_random_poisson ... ok
test_large_vector.test_ndarray_random_randn ... ok
test_large_vector.test_ndarray_random_shuffle ... ok
test_large_vector.test_exponent_logarithm_operators ... ok
test_large_vector.test_power_operators ... ok
test_large_vector.test_sequence_mask ... ERROR
test_large_vector.test_sequence_reverse ... ok
test_large_vector.test_sequence_last ... ok
test_large_vector.test_layer_norm ... ok
test_large_vector.test_batchnorm ... ok
test_large_vector.test_add ... ERROR
test_large_vector.test_sub ... ok
test_large_vector.test_rsub ... ok
test_large_vector.test_neg ... ok
test_large_vector.test_mul ... ok
test_large_vector.test_div ... ok
test_large_vector.test_rdiv ... ok
test_large_vector.test_mod ... ok
test_large_vector.test_rmod ... ok
test_large_vector.test_pow ... ok
test_large_vector.test_rpow ... ok
test_large_vector.test_shape ... ok
test_large_vector.test_size ... ok
test_large_vector.test_copy ... ok
test_large_vector.test_copy_to ... ok
test_large_vector.test_zeros_like ... ok
test_large_vector.test_ones_like ... ok
test_large_vector.test_concat ... ok
test_large_vector.test_sum ... ERROR
test_large_vector.test_prod ...
ok
test_large_vector.test_min ... ok
test_large_vector.test_max ... ok
test_large_vector.test_argmax ... ok
test_large_vector.test_iadd ... ok
test_large_vector.test_isub ... ok
test_large_vector.test_imul ... ok
test_large_vector.test_idiv ... ok
test_large_vector.test_imod ... ok
test_large_vector.test_eq ... ok
test_large_vector.test_neq ... Killed

Individually all the error tests work

nosetests -s -v tests/nightly/test_large_vector.py:test_sequence_mask
test_large_vector.test_sequence_mask ... ok

----------------------------------------------------------------------
Ran 1 test in 93.567s

OK
nosetests -s -v tests/nightly/test_large_vector.py:test_add
test_large_vector.test_add ... ok

----------------------------------------------------------------------
Ran 1 test in 7.926s

OK
nosetests -s -v tests/nightly/test_large_vector.py:test_neq
test_large_vector.test_neq ... ok

----------------------------------------------------------------------
Ran 1 test in 10.074s

OK
nosetests -s -v tests/nightly/test_large_vector.py:test_sum
test_large_vector.test_sum ... ok

----------------------------------------------------------------------
Ran 1 test in 175.573s

OK

Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

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

LGTM

@apeforest apeforest merged commit 692f49f into apache:master Sep 16, 2019
access2rohit pushed a commit to access2rohit/incubator-mxnet that referenced this pull request Sep 25, 2019
* seq last fix

* index tensor to have int64

* fix dtypes

* revert unnecessary changes

* if seq len not passed, pass int64 dtype

* dtype comment

* use int32 or int64 as index dtype based on build flag

* Trigger notification

* Trigger notification

* lint fix
access2rohit pushed a commit to access2rohit/incubator-mxnet that referenced this pull request Sep 25, 2019
* seq last fix

* index tensor to have int64

* fix dtypes

* revert unnecessary changes

* if seq len not passed, pass int64 dtype

* dtype comment

* use int32 or int64 as index dtype based on build flag

* Trigger notification

* Trigger notification

* lint fix
access2rohit pushed a commit to access2rohit/incubator-mxnet that referenced this pull request Sep 25, 2019
* seq last fix

* index tensor to have int64

* fix dtypes

* revert unnecessary changes

* if seq len not passed, pass int64 dtype

* dtype comment

* use int32 or int64 as index dtype based on build flag

* Trigger notification

* Trigger notification

* lint fix
larroy pushed a commit to larroy/mxnet that referenced this pull request Sep 28, 2019
* seq last fix

* index tensor to have int64

* fix dtypes

* revert unnecessary changes

* if seq len not passed, pass int64 dtype

* dtype comment

* use int32 or int64 as index dtype based on build flag

* Trigger notification

* Trigger notification

* lint fix
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