Skip to content
Permalink
Browse files

Fix MXNet breaking change (#1031)

* use MXNDArrayReshape64 API

Signed-off-by: Yuxi Hu <darrenyxhu@gmail.com>

* fix compiler warning

Signed-off-by: Yuxi Hu <darrenyxhu@gmail.com>

* unpin MXNet nightly

Signed-off-by: Yuxi Hu <darrenyxhu@gmail.com>

* address comment

Signed-off-by: Yuxi Hu <darrenyxhu@gmail.com>
  • Loading branch information...
yuxihu authored and alsrgv committed Apr 29, 2019
1 parent d628989 commit 6bee3402439bc25dffa7a01e5ba5a0a41e00a527
Showing with 8 additions and 10 deletions.
  1. +4 −4 docker-compose.test.yml
  2. +4 −6 horovod/mxnet/tensor_util.cc
@@ -105,7 +105,7 @@ services:
KERAS_PACKAGE: git+https://github.com/keras-team/keras.git
PYTORCH_PACKAGE: torch-nightly
PYSPARK_PACKAGE: pyspark==2.4.0
MXNET_PACKAGE: mxnet==1.5.0b20190412 --pre
MXNET_PACKAGE: mxnet --pre
test-cpu-openmpi-py3_6-tfhead-kerashead-torchhead-mxnethead-pyspark2_4_0:
extends: test-cpu-base
build:
@@ -116,7 +116,7 @@ services:
KERAS_PACKAGE: git+https://github.com/keras-team/keras.git
PYTORCH_PACKAGE: torch-nightly
PYSPARK_PACKAGE: pyspark==2.4.0
MXNET_PACKAGE: mxnet==1.5.0b20190412 --pre
MXNET_PACKAGE: mxnet --pre
test-cpu-mpich-py2_7-tf1_12_0-keras2_2_2-torch1_0_0-mxnet1_5_0-pyspark2_4_0:
extends: test-cpu-base
build:
@@ -192,7 +192,7 @@ services:
TENSORFLOW_PACKAGE: tf-nightly-gpu
KERAS_PACKAGE: git+https://github.com/keras-team/keras.git
PYTORCH_PACKAGE: torch-nightly
MXNET_PACKAGE: mxnet-cu100==1.5.0b20190413 --pre
MXNET_PACKAGE: mxnet-cu100 --pre
PYSPARK_PACKAGE: pyspark==2.4.0
test-gpu-openmpi-py3_6-tfhead-kerashead-torchhead-mxnethead-pyspark2_4_0:
extends: test-gpu-base
@@ -206,7 +206,7 @@ services:
TENSORFLOW_PACKAGE: tf-nightly-gpu
KERAS_PACKAGE: git+https://github.com/keras-team/keras.git
PYTORCH_PACKAGE: torch-nightly
MXNET_PACKAGE: mxnet-cu100==1.5.0b20190413 --pre
MXNET_PACKAGE: mxnet-cu100 --pre
PYSPARK_PACKAGE: pyspark==2.4.0
test-gpu-mpich-py2_7-tf1_12_0-keras2_2_2-torch1_0_0-mxnet1_5_0-pyspark2_4_0:
extends: test-gpu-base
@@ -45,7 +45,7 @@ const DataType TensorUtil::GetDType(NDArray* tensor) {
const TensorShape TensorUtil::GetShape(NDArray* tensor) {
TensorShape shape;
TShape mx_shape = tensor->shape();
for (unsigned idx = 0; idx < mx_shape.ndim(); idx++) {
for (int idx = 0; idx < (int)mx_shape.ndim(); idx++) {
shape.AddDim(mx_shape[idx]);
}
return shape;
@@ -135,11 +135,9 @@ void TensorUtil::Free(NDArray* tensor) { delete tensor; }

// Resize tensor to nDimension with length size[i] in dimension i
void TensorUtil::ResizeNd(NDArray* tensor, int nDimension, int64_t* size) {
TShape mx_shape(nDimension);
for (int idx = 0; idx < nDimension; ++idx) {
mx_shape[idx] = size[idx];
}
tensor->Reshape(mx_shape);
void* temp_out;
MXNDArrayReshape64(tensor, nDimension, size, false, &temp_out);
tensor = static_cast<NDArray*>(temp_out);
}

// Copy from tensor to output

0 comments on commit 6bee340

Please sign in to comment.
You can’t perform that action at this time.