-
Notifications
You must be signed in to change notification settings - Fork 1
/
neon.patch
66 lines (59 loc) · 3.2 KB
/
neon.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/neon/backends/kernels/maxas/MaxAs/MaxAsGrammar.pm b/neon/backends/kernels/maxas/MaxAs/MaxAsGrammar.pm
index 3475bed..7863cac 100644
--- a/neon/backends/kernels/maxas/MaxAs/MaxAsGrammar.pm
+++ b/neon/backends/kernels/maxas/MaxAs/MaxAsGrammar.pm
@@ -236,7 +236,7 @@ my $shfl = qr"\.(?<mode>IDX|UP|DOWN|BFLY)";
my $bar = qr"\.(?<mode>SYNC|ARV|RED)(?:\.(?<red>POPC|AND|OR))? (?:$i8w4|$r8)(?:, (?:$i20w12|$r20))?(?(<r20>)|(?<nor20>))(?(<red>), $p39|(?<nop39>))"o;
my $b2r = qr"\.RESULT $r0(?:, $p45|(?<nop45>))"o;
my $dbar = qr"(?<SB>SB0|SB1|SB2|SB3|SB4|SB5)";
-my $dbar2 = qr" {(?<db5>5)?,?(?<db4>4)?,?(?<db3>3)?,?(?<db2>2)?,?(?<db1>1)?,?(?<db0>0)?}";
+my $dbar2 = qr" \{(?<db5>5)?,?(?<db4>4)?,?(?<db3>3)?,?(?<db2>2)?,?(?<db1>1)?,?(?<db0>0)?}";
my $mbar = qr"\.(?<mode>CTA|GL|SYS)";
my $addr = qr"\[(?:(?<r8>$reg)|(?<nor8>))(?:\s*\+?\s*$i20w24)?\]"o;
my $addr2 = qr"\[(?:(?<r8>$reg)|(?<nor8>))(?:\s*\+?\s*$i28w20)?\]"o;
@@ -1432,6 +1432,3 @@ sub getAddrVecRegisters
}
__END__
-
-
-
diff --git a/neon/layers/layer.py b/neon/layers/layer.py
index 247b41a..06360da 100644
--- a/neon/layers/layer.py
+++ b/neon/layers/layer.py
@@ -831,13 +831,14 @@ class Convolution(ParameterLayer):
pad_tuple = tuple(self.convparams[k] for k in ['pad_' + d for d in padstr_dim])
str_tuple = tuple(self.convparams[k] for k in ['str_' + d for d in padstr_dim])
dil_tuple = tuple(self.convparams[k] for k in ['dil_' + d for d in padstr_dim])
+ shp_tuple = tuple(self.fshape[:input_spatial_dim])
fmt_tuple = (self.name,) + self.in_shape + self.out_shape + (
- pad_tuple + str_tuple + dil_tuple)
+ pad_tuple + str_tuple + dil_tuple + shp_tuple)
fmt_string = "Convolution Layer '%s': " + \
input_spatial_str + " inputs, " + output_spatial_str + " outputs, " + \
padstr_str + " padding, " + padstr_str + " stride, " + \
- padstr_str + " dilation"
+ padstr_str + " dilation, " + padstr_str + " shape"
return ((fmt_string % fmt_tuple))
diff --git a/neon/models/model.py b/neon/models/model.py
index 04eb7e1..c61fc4c 100644
--- a/neon/models/model.py
+++ b/neon/models/model.py
@@ -388,6 +388,10 @@ class Model(NervanaObject):
pdict['model'] = self.layers.get_description(get_weights=get_weights,
keep_states=keep_states)
+
+ # xxx - watkinspv, hack to save some data meta
+ if hasattr(self, 'batch_meta'): pdict['batch_meta'] = self.batch_meta
+
return pdict
def save_params(self, param_path, keep_states=True):
@@ -485,6 +489,9 @@ class Model(NervanaObject):
# could come about when switching backend types (ex GPU to CPU)
logger.warning("Problems restoring existing RNG state: %s", str(e))
+ # xxx - watkinspv, hack to load some data meta
+ if 'batch_meta' in model_dict: self.batch_meta = model_dict['batch_meta']
+
# serialize tells how to write out the parameters we've learned so
# far and associate them with layers. it can ignore layers with no
# learned parameters. the model stores states to pass to the