Skip to content

Commit

Permalink
Drop support for nxsdk<0.8.0
Browse files Browse the repository at this point in the history
Update installation instructions

Update hardware script to test against 0.8.1
  • Loading branch information
drasmuss committed May 6, 2019
1 parent f9e2068 commit 331c2c4
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .ci/hardware.sh.template
Expand Up @@ -20,7 +20,8 @@
pip install nengo-dl jupyter
pip install -e .[tests]
pip install $NENGO_VERSION --upgrade
pip install ~/travis-ci/nxsdk-0.8.0.tar.gz
cp /nfs/ncl/releases/$NXSDK_VERSION/nxsdk-$NXSDK_VERSION.tar.gz .
pip install nxsdk-$NXSDK_VERSION.tar.gz
SLURM=1 pytest --target loihi --no-hang -v --durations 50 --color=yes -n 1 --cov=nengo_loihi --cov-report=xml --cov-report=term-missing || HW_STATUS=1
exit \$HW_STATUS
EOF
Expand Down
1 change: 1 addition & 0 deletions .nengobones.yml
Expand Up @@ -16,6 +16,7 @@ travis_yml:
- script: hardware
env:
NENGO_VERSION: git+https://github.com/nengo/nengo.git#egg=nengo
NXSDK_VERSION: 0.8.1
- script: docs
env:
NENGO_VERSION: git+https://github.com/nengo/nengo.git#egg=nengo
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -45,6 +45,7 @@ jobs:
-
env:
NENGO_VERSION="git+https://github.com/nengo/nengo.git#egg=nengo"
NXSDK_VERSION="0.8.1"
SCRIPT="hardware"
-
env:
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -42,6 +42,8 @@ Release history
(`#202 <https://github.com/nengo/nengo-loihi/pull/202>`__,
`#208 <https://github.com/nengo/nengo-loihi/issues/208>`__,
`#209 <https://github.com/nengo/nengo-loihi/issues/209>`__)
- Nengo Loihi now requires at least NxSDK version 0.8.0.
(`#218 <https://github.com/nengo/nengo-loihi/pull/218>`__)

**Fixed**

Expand Down
14 changes: 6 additions & 8 deletions docs/installation.rst
Expand Up @@ -31,8 +31,7 @@ for running Nengo Loihi,
as well as for running models
using the NxSDK directly.

Note, you *must* use Python 3.5.2 and NumPy 1.14.3
when working with NxSDK.
Note, you *must* use Python 3.5.2 when working with NxSDK.
The easiest way to satisfy those constraints is to use `Miniconda
<https://conda.io/projects/conda/en/latest/user-guide/install/index.html>`_
to set up an isolated environment
Expand Down Expand Up @@ -94,11 +93,10 @@ for running Loihi models.
you log onto the superhost.

4. Install NumPy and Cython with conda.
Note, you *must* use NumPy 1.14.3 when working with NxSDK.

.. code-block:: bash
conda install numpy=1.14.3 cython
conda install numpy cython
The NumPy provided by conda is usually faster
than those installed by other means.
Expand All @@ -108,25 +106,25 @@ for running Loihi models.
.. note:: The location of NxSDK may have changed.
Refer to Intel's documentation to be sure.
The most recent release and NxSDK location
are current as of September 2018.
are current as of May 2019.

If you are logged into INRC:

.. code-block:: bash
cp /nfs/ncl/releases/0.7/nxsdk-0.7.tar.gz .
cp /nfs/ncl/releases/0.8.1/nxsdk-0.8.1.tar.gz .
If you are setting up a non-INRC superhost:

.. code-block:: bash
scp <inrc-host>:/nfs/ncl/releases/0.7/nxsdk-0.7.tar.gz .
scp <inrc-host>:/nfs/ncl/releases/0.8.1/nxsdk-0.8.1.tar.gz .
6. Install NxSDK.

.. code-block:: bash
pip install nxsdk-0.7.tar.gz
pip install nxsdk-0.8.1.tar.gz
7. Install Nengo Loihi.

Expand Down
6 changes: 2 additions & 4 deletions nengo_loihi/hardware/interface.py
Expand Up @@ -87,8 +87,8 @@ def check_nxsdk_version():

# if installed, check version
version = LooseVersion(getattr(nxsdk, "__version__", "0.0.0"))
minimum = LooseVersion("0.7.0")
max_tested = LooseVersion("0.8.0")
minimum = LooseVersion("0.8.0")
max_tested = LooseVersion("0.8.1")
if version < minimum:
raise ImportError("nengo-loihi requires nxsdk>=%s, found %s"
% (minimum, version))
Expand Down Expand Up @@ -383,8 +383,6 @@ def create_io_snip(self):
max_error_len=max_error_len,
cores=cores,
probes=probes,
time_step=('time' if nxsdk_version < LooseVersion('0.8.0')
else 'time_step'),
)
with open(c_path, 'w') as f:
f.write(code)
Expand Down
8 changes: 1 addition & 7 deletions nengo_loihi/hardware/nxsdk_shim.py
Expand Up @@ -24,13 +24,7 @@ def assert_nxsdk(exception=exception):
raise exception


if HAS_NXSDK and nxsdk_version < LooseVersion("0.8.0"): # pragma: no cover
import nxsdk.arch.n2a.compiler.microcodegen.interface as microcodegen_uci
from nxsdk.arch.n2a.compiler.tracecfggen.tracecfggen import TraceCfgGen
from nxsdk.arch.n2a.graph.graph import N2Board
from nxsdk.arch.n2a.graph.inputgen import BasicSpikeGenerator
from nxsdk.arch.n2a.graph.probes import N2SpikeProbe
elif HAS_NXSDK:
if HAS_NXSDK:
import nxsdk.compiler.microcodegen.interface as microcodegen_uci
from nxsdk.compiler.tracecfggen.tracecfggen import TraceCfgGen
from nxsdk.graph.nxboard import N2Board
Expand Down
10 changes: 5 additions & 5 deletions nengo_loihi/hardware/snips/nengo_io.c.template
Expand Up @@ -36,8 +36,8 @@ void nengo_io(runState *s) {
return;
}

if (s->{{ time_step }} % 100 == 0) {
printf("time %d\n", s->{{ time_step }});
if (s->time_step % 100 == 0) {
printf("time %d\n", s->time_step);
}

readChannel(in_channel, count, 1);
Expand All @@ -59,9 +59,9 @@ void nengo_io(runState *s) {
core_id.id, axon_id, axon_type, atom);
}
if (axon_type == 0) {
nx_send_discrete_spike(s->{{ time_step }}, core_id, axon_id);
nx_send_discrete_spike(s->time_step, core_id, axon_id);
} else if (axon_type == 32) {
nx_send_pop32_spike(s->{{ time_step }}, core_id, axon_id, atom, 0, 0, 0);
nx_send_pop32_spike(s->time_step, core_id, axon_id, atom, 0, 0, 0);
} else {
printf("Got invalid axon_type: %d\n", axon_type);
return;
Expand All @@ -82,7 +82,7 @@ void nengo_io(runState *s) {
error_index += ERROR_INFO_SIZE + error_info[1];
}

output[0] = s->{{ time_step }};
output[0] = s->time_step;
{% for n_out, core, cx, key in probes %}
{% if key == 'u' %}
output[{{ n_out }}] = core{{ core }}->cx_state[{{ cx }}].U;
Expand Down

0 comments on commit 331c2c4

Please sign in to comment.