* Increase timeouts for 2 tests occasionally failing on CI

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Explicitly set character encoding via argline for maven surefire tests

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* CUDA gradient check timeout fix + simple rnn masking fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>
master
Alex Black 2020-02-05 17:07:36 +11:00 committed by GitHub
parent 5d28e6143d
commit 569a46f87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 49 additions and 29 deletions

View File

@ -192,7 +192,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>-Ddtype=double -Xmx3024m -Xms3024m</argLine>
<argLine>-Ddtype=double -Dfile.encoding=UTF-8 -Xmx3024m -Xms3024m</argLine>
<!--
By default: Surefire will set the classpath based on the manifest. Because tests are not included
in the JAR, any tests that rely on class path scanning for resources in the tests directory will not

View File

@ -148,7 +148,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>-Ddtype=float</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8</argLine>
<!--
By default: Surefire will set the classpath based on the manifest. Because tests are not included
in the JAR, any tests that rely on class path scanning for resources in the tests directory will not

View File

@ -56,6 +56,11 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
Nd4j.setDataType(DataType.DOUBLE);
}
@Override
public long getTimeoutMilliseconds() {
return 90000L;
}
private static class GradientCheckSimpleScenario {
private final ILossFunction lf;
private final Activation act;
@ -159,9 +164,8 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
.updater(new NoOp())
.dataType(DataType.DOUBLE)
.dist(new NormalDistribution(0, 1.0)).seed(12345L).list()
.layer(0, new GravesBidirectionalLSTM.Builder().nIn(nIn).nOut(layerSize)
.activation(Activation.TANH).build())
.layer(1, new GravesBidirectionalLSTM.Builder().nIn(layerSize).nOut(layerSize)
.layer(0, new SimpleRnn.Builder().nIn(nIn).nOut(2).activation(Activation.TANH).build())
.layer(1, new GravesBidirectionalLSTM.Builder().nIn(2).nOut(layerSize)
.activation(Activation.TANH).build())
.layer(2, new RnnOutputLayer.Builder(LossFunctions.LossFunction.MCXENT)
.activation(Activation.SOFTMAX).nIn(layerSize).nOut(nOut).build())
@ -390,24 +394,24 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
Nd4j.getRandom().setSeed(12345);
//Idea: RNN input, global pooling, OutputLayer - with "per example" mask arrays
int mb = 10;
int mb = 4;
int tsLength = 5;
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.dataType(DataType.DOUBLE)
.weightInit(new NormalDistribution(0,2))
.updater(new NoOp())
.list()
.layer(new LSTM.Builder().nIn(10).nOut(10).build())
.layer(new LSTM.Builder().nIn(3).nOut(3).build())
.layer(new GlobalPoolingLayer.Builder().poolingType(PoolingType.AVG).build())
.layer(new OutputLayer.Builder().nIn(10).nOut(10).activation(Activation.SOFTMAX).build())
.setInputType(InputType.recurrent(10))
.layer(new OutputLayer.Builder().nIn(3).nOut(3).activation(Activation.SOFTMAX).build())
.setInputType(InputType.recurrent(3))
.build();
MultiLayerNetwork net = new MultiLayerNetwork(conf);
net.init();
INDArray f = Nd4j.rand(new int[]{mb, 10, tsLength});
INDArray l = TestUtils.randomOneHot(mb, 10);
INDArray f = Nd4j.rand(new int[]{mb, 3, tsLength});
INDArray l = TestUtils.randomOneHot(mb, 3);
INDArray lm = TestUtils.randomBernoulli(mb, 1);
assertTrue(lm.sumNumber().intValue() > 0);
@ -449,18 +453,18 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
.updater(new NoOp())
.graphBuilder()
.addInputs("in")
.layer("0", new LSTM.Builder().nIn(10).nOut(10).build(), "in")
.layer("0", new LSTM.Builder().nIn(3).nOut(3).build(), "in")
.layer("1", new GlobalPoolingLayer.Builder().poolingType(PoolingType.AVG).build(), "0")
.layer("out", new OutputLayer.Builder().nIn(10).nOut(10).activation(Activation.SOFTMAX).build(), "1")
.layer("out", new OutputLayer.Builder().nIn(3).nOut(3).activation(Activation.SOFTMAX).build(), "1")
.setOutputs("out")
.setInputTypes(InputType.recurrent(10))
.setInputTypes(InputType.recurrent(3))
.build();
ComputationGraph net = new ComputationGraph(conf);
net.init();
INDArray f = Nd4j.rand(new int[]{mb, 10, tsLength});
INDArray l = TestUtils.randomOneHot(mb, 10);
INDArray f = Nd4j.rand(new int[]{mb, 3, tsLength});
INDArray l = TestUtils.randomOneHot(mb, 3);
INDArray lm = TestUtils.randomBernoulli(mb, 1);
assertTrue(lm.sumNumber().intValue() > 0);

View File

@ -37,7 +37,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Ddtype=float -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
<includes>
<!-- Default setting only runs tests that start/end with "Test" -->
<include>*.java</include>

View File

@ -33,7 +33,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Ddtype=float -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
<includes>
<!-- Default setting only runs tests that start/end with "Test" -->
<include>*.java</include>

View File

@ -36,7 +36,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Ddtype=float -Xmx8g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
<includes>
<!-- Default setting only runs tests that start/end with "Test" -->
<include>*.java</include>

View File

@ -38,6 +38,11 @@ public class KMeansTest extends BaseDL4JTest {
private boolean[] useKMeansPlusPlus = {true, false};
@Override
public long getTimeoutMilliseconds() {
return 60000L;
}
@Test
public void testKMeans() {
Nd4j.getRandom().setSeed(7);

View File

@ -282,6 +282,12 @@ public class SimpleRnn extends BaseRecurrentLayer<org.deeplearning4j.nn.conf.lay
a.getActivation(currOut, training);
if( maskArray != null){
//If mask array is present: Also need to zero out errors to avoid sending anything but 0s to layer below for masked steps
INDArray maskCol = maskArray.getColumn(i, true).castTo(dataType);
currOut.muliColumnVector(maskCol);
}
prevStepOut = currOut;
}

View File

@ -380,7 +380,7 @@
-->
<useSystemClassLoader>true</useSystemClassLoader>
<useManifestOnlyJar>false</useManifestOnlyJar>
<argLine>-Ddtype=float -Xmx8g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
<includes>
<!-- Default setting only runs tests that start/end with "Test" -->
<include>*.java</include>

View File

@ -60,7 +60,7 @@
Maximum heap size was set to 6g, as a minimum required value for tests run.
Depending on a build machine, default value is not always enough.
-->
<argLine>-Ddtype=float -Xmx8g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
</configuration>
</plugin>
<plugin>

View File

@ -117,7 +117,7 @@
Maximum heap size was set to 8g, as a minimum required value for tests run.
Depending on a build machine, default value is not always enough.
-->
<argLine>-Ddtype=float -Xmx8g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
</configuration>
</plugin>
<plugin>

View File

@ -224,7 +224,7 @@
Depending on a build machine, default value is not always enough.
-->
<skip>false</skip>
<argLine>-Xmx6g</argLine>
<argLine>-Xmx6g -Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
</plugins>
@ -296,7 +296,7 @@
Maximum heap size was set to 6g, as a minimum required value for tests run.
Depending on a build machine, default value is not always enough.
-->
<argLine>-Xmx6g</argLine>
<argLine>-Xmx6g -Dfile.encoding=UTF-8</argLine>
<skipTests>false</skipTests>
<skip>false</skip>
</configuration>

View File

@ -252,7 +252,7 @@
Maximum heap size was set to 6g, as a minimum required value for tests run.
Depending on a build machine, default value is not always enough.
-->
<argLine>-Ddtype=float -Xmx6g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx6g</argLine>
</configuration>
</plugin>
</plugins>

View File

@ -44,6 +44,11 @@ public class TestOpMapping extends BaseNd4jTest {
return 'c';
}
@Override
public long getTimeoutMilliseconds() {
return 60000L;
}
@Test
public void testOpMappingCoverage() throws Exception {
Reflections reflections = new Reflections("org.nd4j");

View File

@ -91,7 +91,7 @@
For testing large zoo models, this may not be enough (so comment it out).
-->
<argLine>-Ddtype=float -Xmx8g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
</configuration>
</plugin>
</plugins>

View File

@ -109,7 +109,7 @@
For testing large zoo models, this may not be enough (so comment it out).
-->
<argLine>-Ddtype=float -Xmx8g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
</configuration>
</plugin>
</plugins>

View File

@ -100,7 +100,7 @@
For testing large zoo models, this may not be enough (so comment it out).
-->
<argLine>-Ddtype=float -Xmx8g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
</configuration>
</plugin>
</plugins>

View File

@ -220,7 +220,7 @@
Maximum heap size was set to 6g, as a minimum required value for tests run.
Depending on a build machine, default value is not always enough.
-->
<argLine>-Ddtype=float -Xmx6g</argLine>
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx6g</argLine>
</configuration>
</plugin>
</plugins>