Skip to content

Commit

Permalink
[MXNET-978] Support higher order gradient for log. (apache#14992)
Browse files Browse the repository at this point in the history
* add higher order gradient support for log, log10, log2

* add tests

* address comments

* simplify NodeEntry creation.

* address comments

* update comment to avoid confusion.

add nano cross compile

add nano dockerfile

workaround build error

workaround build error - attempt 2

workaround build error - attempt 3

add jetson nano instructions; java api for jetson

fix ci side for jetson build

revert cmake updates not needed

fix website build error and opencv error for arm8

make executable

workaround apt install issue

update python setup; remove java setup

removed unneeded changes

add a gpu test for verification

remove scala setup step for now

get rid of apt-get update since it fails every time
  • Loading branch information
kshitij12345 authored and aaronmarkham committed May 31, 2019
1 parent bbab527 commit 4aa0fe6
Show file tree
Hide file tree
Showing 10 changed files with 537 additions and 90 deletions.
10 changes: 8 additions & 2 deletions ci/docker/Dockerfile.build.armv8
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ RUN /work/arm_openblas.sh
ENV OpenBLAS_HOME=${CROSS_ROOT}
ENV OpenBLAS_DIR=${CROSS_ROOT}

COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh
COPY install/arm_openblas.sh /work/
RUN /work/arm_openblas.sh

COPY install/arm8_core.sh /work/
RUN /work/arm8_core.sh

COPY install/arm8_python.sh /work/
RUN /work/arm8_python.sh

ARG USER_ID=0
ARG GROUP_ID=0
Expand Down
30 changes: 30 additions & 0 deletions ci/docker/install/arm8_core.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -ex

# Avoid interactive package installers such as tzdata.
export DEBIAN_FRONTEND=noninteractive

apt-get install -y --force-yes --no-install-recommends \
build-essential \
git \
graphviz \
libatlas-base-dev \
libopencv-dev
36 changes: 36 additions & 0 deletions ci/docker/install/arm8_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -ex
apt-get update || true

# Avoid interactive package installers such as tzdata.
export DEBIAN_FRONTEND=noninteractive

apt-get -y install python-pip

pip install --upgrade \
pip \
setuptools

pip install \
graphviz \
jupyter \
opencv-python \
numpy==1.15.2
28 changes: 28 additions & 0 deletions ci/docker/install/arm8_scala.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -ex
apt-get update || true

# Avoid interactive package installers such as tzdata.
export DEBIAN_FRONTEND=noninteractive

apt-get -y install \
maven \
openjdk-8-java
1 change: 0 additions & 1 deletion ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ build_armv8() {
build_wheel
}


#
# ANDROID builds
#
Expand Down
84 changes: 3 additions & 81 deletions docs/install/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
c_plus_plus.md
centos_setup.md
download.md
install-jetson.md
java_setup.md
osx_setup.md
raspbian_setup.md
Expand Down Expand Up @@ -1444,88 +1445,9 @@ You are now ready to run MXNet on your Raspberry Pi device. You can get started

<div class="nvidia-jetson">

# Nvidia Jetson TX family
# NVIDIA Jetson Devices

MXNet supports the Ubuntu Arch64 based operating system so you can run MXNet on NVIDIA Jetson Devices.

These instructions will walk through how to build MXNet for the Pascal based [NVIDIA Jetson TX2](http://www.nvidia.com/object/embedded-systems-dev-kits-modules.html) and install the corresponding python language bindings.

For the purposes of this install guide we will assume that CUDA is already installed on your Jetson device.

**Install MXNet**

Installing MXNet is a two-step process:

1. Build the shared library from the MXNet C++ source code.
2. Install the supported language-specific packages for MXNet.

**Step 1** Build the Shared Library

You need the following additional dependencies:

- Git (to pull code from GitHub)

- libatlas (for linear algebraic operations)

- libopencv (for computer vision operations)

- python pip (to load relevant python packages for our language bindings)

Install these dependencies using the following commands in any directory:

```
sudo apt-get update
sudo apt-get -y install git build-essential libatlas-base-dev libopencv-dev graphviz python-pip
sudo pip install pip --upgrade
sudo pip install setuptools numpy --upgrade
sudo pip install graphviz jupyter
```

Clone the MXNet source code repository using the following `git` command in your home directory:
```
git clone https://github.com/apache/incubator-mxnet.git --recursive
cd incubator-mxnet
```

Edit the Makefile to install the MXNet with CUDA bindings to leverage the GPU on the Jetson:
```
cp make/crosscompile.jetson.mk config.mk
```

Edit the Mshadow Makefile to ensure MXNet builds with Pascal's hardware level low precision acceleration by editing 3rdparty/mshadow/make/mshadow.mk and adding the following after line 122:
```
MSHADOW_CFLAGS += -DMSHADOW_USE_PASCAL=1
```

Now you can build the complete MXNet library with the following command:
```
make -j $(nproc)
```

Executing this command creates a file called `libmxnet.so` in the mxnet/lib directory.

**Step 2** Install MXNet Python Bindings

To install Python bindings run the following commands in the MXNet directory:

```
cd python
pip install --upgrade pip
pip install -e .
```

Note that the `-e` flag is optional. It is equivalent to `--editable` and means that if you edit the source files, these changes will be reflected in the package installed.

Add the mxnet folder to the path:

```
cd ..
export MXNET_HOME=$(pwd)
echo "export PYTHONPATH=$MXNET_HOME/python:$PYTHONPATH" >> ~/.rc
source ~/.rc
```

You are now ready to run MXNet on your NVIDIA Jetson TX2 device.
To install MXNet on a Jetson TX or Nano, please refer to the [Jetson installation guide](install-jetson.html).

</div> <!-- End of jetson -->
</div> <!-- End of devices -->
Expand Down
Loading

0 comments on commit 4aa0fe6

Please sign in to comment.