Skip to content

Commit

Permalink
v1.3.0 release bump.
Browse files Browse the repository at this point in the history
- pad tolerance for lstm test
- deprecate deterministic argument
- Fix py test to use 2x2 winograd
  • Loading branch information
apark263 committed Mar 3, 2016
1 parent dfcaa0c commit bb338f7
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 21 deletions.
13 changes: 12 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# ChangeLog

## v1.2.2 (2106-02-24):
## v1.3.0 (2016-02-29):

### Modifications

* benchmarking scripts
* winograd kernels and associated autotuning routines
* deprecation of deterministic argument for backend constructor
* improve batch norm stability with fp16 backend
* allow strided support for dimshuffle kernel
* speed up zero momentum gradient descent

## v1.2.2 (2016-02-24):

### Modifications

Expand Down
2 changes: 2 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def backend_default(request):
datatype=np.float32,
batch_size=128,
rng_seed=0)
if request.param == 'gpu':
be.enable_winograd = 2 if be.enable_winograd else be.enable_winograd

# add a cleanup call - will run after all test in module are done
def cleanup():
Expand Down
10 changes: 5 additions & 5 deletions neon/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
def gen_backend(backend='cpu', rng_seed=None, datatype=np.float32,
batch_size=0, stochastic_round=False, device_id=0,
max_devices=get_device_count(), compat_mode=None,
deterministic_update=False, deterministic=True,
deterministic_update=None, deterministic=None,
cache_dir=os.path.join(os.path.expanduser('~'), 'nervana/cache')):
"""
Construct and return a backend instance of the appropriate type based on
Expand Down Expand Up @@ -81,9 +81,10 @@ def gen_backend(backend='cpu', rng_seed=None, datatype=np.float32,
# NervanaObject.be instead of a global
atexit.register(cleanup_backend)

if deterministic_update:
deterministic = True
logger.warning("--deterministic_update is deprecated in favor of --deterministic")
if deterministic_update is not None or deterministic is not None:
logger.warning('deterministic_update and deterministic args are deprecated in favor of '
'specifying random seed')
deterministic = None

if backend == 'cpu' or backend is None:
from neon.backends.nervanacpu import NervanaCPU
Expand Down Expand Up @@ -115,7 +116,6 @@ def gen_backend(backend='cpu', rng_seed=None, datatype=np.float32,
num_devices=max_devices,
compat_mode=compat_mode,
deterministic=deterministic,
# TODO add cache_dir to mgpu
cache_dir=cache_dir)
except ImportError:
logger.error("Multi-GPU support is a premium feature "
Expand Down
7 changes: 5 additions & 2 deletions neon/backends/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ class Backend(object):
backends.
"""
def __init__(self, rng_seed=None, default_dtype=np.float32,
compat_mode=None, deterministic=False):
compat_mode=None, deterministic=None):
# dtype
self.default_dtype = default_dtype

Expand All @@ -451,7 +451,10 @@ def __init__(self, rng_seed=None, default_dtype=np.float32,
else:
self.compat_mode = None

self.deterministic = deterministic
if deterministic is not None:
logger.warning('deterministic arg is deprecated in favor of specifying random seed')

self.deterministic = self.rng_seed is not None

def output_dim(self, X, S, padding, strides, pooling=False):
"""
Expand Down
3 changes: 1 addition & 2 deletions neon/backends/nervanagpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def __init__(self,
rng_seed=None,
default_dtype=np.float32,
stochastic_round=False,
deterministic=True,
deterministic=None,
device_id=0,
bench=False,
scratch_size=0,
Expand Down Expand Up @@ -707,7 +707,6 @@ def __init__(self,
stochastic_round = 0

# attributes
self.deterministic = deterministic
self.scratch_size = scratch_size
self.scratch_offset = 0
self.round_mode = stochastic_round
Expand Down
6 changes: 4 additions & 2 deletions neon/util/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ def parse_args(self, gen_be=True):
else:
args.compat_mode = None

if args.deterministic:
logger.warn('--deterministic flag is deprecated. Specify random seed for '
'deterministic behavior.')
# extended parsers may need to generate backend after argparsing
if gen_be:
# generate the backend
Expand All @@ -321,8 +324,7 @@ def parse_args(self, gen_be=True):
batch_size=args.batch_size,
datatype=args.datatype,
max_devices=args.max_devices,
compat_mode=args.compat_mode,
deterministic=args.deterministic)
compat_mode=args.compat_mode)

# display what command line / config options were set (and from where)
logger.info(self.format_values())
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import subprocess

# Define version information
VERSION = '1.2.2'
VERSION = '1.3'
FULLVERSION = VERSION
write_version = True

Expand Down
14 changes: 7 additions & 7 deletions tests/test_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,19 @@ def check_lstm(seq_len, input_size, hidden_size,
allclose_with_out(lstm.ifog_buffer.get(),
IFOGf_ref,
rtol=0.0,
atol=1.0e-5)
atol=1.5e-5)

print '====Verifying cell states===='
allclose_with_out(lstm.c_act_buffer.get(),
Ct_ref,
rtol=0.0,
atol=1.0e-5)
atol=1.5e-5)

print '====Verifying hidden states===='
allclose_with_out(lstm.outputs.get(),
Hout_ref,
rtol=0.0,
atol=1.0e-5)
atol=1.5e-5)

print 'fprop is verified'

Expand Down Expand Up @@ -182,25 +182,25 @@ def check_lstm(seq_len, input_size, hidden_size,
assert allclose_with_out(dWrecur_neon,
dWrecur_ref.T,
rtol=0.0,
atol=1.0e-5)
atol=1.5e-5)

print '====Verifying update on W_input===='
assert allclose_with_out(dWinput_neon,
dWinput_ref.T,
rtol=0.0,
atol=1.0e-5)
atol=1.5e-5)

print '====Verifying update on bias===='
assert allclose_with_out(db_neon.flatten(),
db_ref,
rtol=0.0,
atol=1.0e-5)
atol=1.5e-5)

print '====Verifying output delta===='
assert allclose_with_out(lstm.out_deltas_buffer.get(),
dX_ref,
rtol=0.0,
atol=1.0e-5)
atol=1.5e-5)

print 'bprop is verified'

Expand Down
2 changes: 1 addition & 1 deletion tests/test_mergesum_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_proj_upsample():


def mergesum_test_config(modfunc, use_stride=1):
NervanaObject.be = gen_backend("gpu", batch_size=64)
NervanaObject.be = gen_backend("gpu", batch_size=64, rng_seed=0)
be = NervanaObject.be
l1 = Conv(**conv_params(3, 16))
neon_layer = modfunc(16, use_stride)
Expand Down

0 comments on commit bb338f7

Please sign in to comment.