Skip to content

Commit

Permalink
Upgrade test suite java version to run on > 8, upgrade kotlin version
Browse files Browse the repository at this point in the history
  • Loading branch information
agibsonccc committed Oct 12, 2022
1 parent 6646f1c commit c1bf871
Show file tree
Hide file tree
Showing 21 changed files with 115 additions and 62 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -35,12 +35,12 @@ Deeplearning4J has quite a few dependencies. For this reason we only support usa
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-core</artifactId>
<version>1.0.0-M1.1</version>
<version>1.0.0-M2.1</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-native-platform</artifactId>
<version>1.0.0-M1.1</version>
<version>1.0.0-M2.1</version>
</dependency>
</dependencies>
```
Expand Down Expand Up @@ -110,6 +110,10 @@ mvn -B -V -U clean install -pl -Dlibnd4j.platform=linux-x86_64 -Dlibnd4j.chip=c

An example of GPU "CC" or compute capability is 61 for Titan X Pascal.

## Running project in Intellij IDEA:
1. Ensure you follow https://stackoverflow.com/questions/45370178/exporting-a-package-from-system-module-is-not-allowed-with-release on jdk 9 or later
2. Ignore all nd4j-shade submodules. Right click on each folder and click: Maven -> Ignore project


## License

Expand Down
7 changes: 4 additions & 3 deletions contrib/codegen-tools/codegen/pom.xml
Expand Up @@ -18,10 +18,10 @@
<junit.version>5.8.0-M1</junit.version>
<junit.platform.launcher.version>1.8.0-M1</junit.platform.launcher.version>
<junit-jupiter.version>5.4.2</junit-jupiter.version>
<java.version>1.8</java.version>
<java.version>11</java.version>
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<kotlin.version>1.3.50</kotlin.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<javapoet.version>1.13.0</javapoet.version>
</properties>
Expand Down Expand Up @@ -249,7 +249,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<version>3.8.1</version>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
Expand All @@ -275,6 +275,7 @@
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>

</configuration>
</plugin>
</plugins>
Expand Down
4 changes: 2 additions & 2 deletions contrib/codegen-tools/libnd4j-gen/pom.xml
Expand Up @@ -33,8 +33,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<nd4j.version>1.0.0-SNAPSHOT</nd4j.version>
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<javaparser.version>3.24.4</javaparser.version>
Expand Down
4 changes: 2 additions & 2 deletions contrib/version-updater/pom.xml
Expand Up @@ -13,8 +13,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<picocli.version>4.6.1</picocli.version>
</properties>

Expand Down
1 change: 1 addition & 0 deletions datavec/datavec-arrow/src/main/java9/module-info.java
@@ -1,4 +1,5 @@
open module datavec.arrow {
requires java.nio;
requires commons.io;
requires slf4j.api;
requires arrow.memory.core;
Expand Down
3 changes: 3 additions & 0 deletions datavec/datavec-data/datavec-data-image/pom.xml
Expand Up @@ -139,6 +139,9 @@
<classpathDependencyExclude>com.google.android:android
</classpathDependencyExclude>
</classpathDependencyExcludes>
<argLine>
--add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
@@ -1,4 +1,5 @@
open module nd4j.api {
requires java.nio;
requires byteunits;
requires commons.io;
requires commons.net;
Expand Down
10 changes: 8 additions & 2 deletions nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda-preset/pom.xml
Expand Up @@ -117,8 +117,14 @@
</execution>
</executions>
<configuration>
<source>8</source>
<target>8</target>
<source>11</source>
<target>11</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
Expand Down
13 changes: 10 additions & 3 deletions nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/pom.xml
Expand Up @@ -115,7 +115,8 @@
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 -Dfile.encoding=UTF-8 -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}</argLine>
<argLine>--add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Ddtype=float -Dfile.encoding=UTF-8 -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}
</argLine>

</configuration>
</plugin>
Expand Down Expand Up @@ -231,8 +232,14 @@
</execution>
</executions>
<configuration>
<source>8</source>
<target>8</target>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>

Expand Down
Expand Up @@ -173,8 +173,14 @@
</execution>
</executions>
<configuration>
<source>8</source>
<target>8</target>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
Expand Down
10 changes: 8 additions & 2 deletions nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/pom.xml
Expand Up @@ -159,8 +159,14 @@
</execution>
</executions>
<configuration>
<source>8</source>
<target>8</target>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
Expand Down
4 changes: 2 additions & 2 deletions nd4j/nd4j-backends/nd4j-backend-impls/pom.xml
Expand Up @@ -106,7 +106,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>-Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}</argLine>
<argLine>--add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}</argLine>
<forkedProcessTimeoutInSeconds>240</forkedProcessTimeoutInSeconds>
<forkedProcessExitTimeoutInSeconds>240</forkedProcessExitTimeoutInSeconds>
<parallelTestsTimeoutInSeconds>240</parallelTestsTimeoutInSeconds>
Expand Down Expand Up @@ -141,7 +141,7 @@
<activation>
<activeByDefault>false</activeByDefault>
</activation>

<modules>
<module>nd4j-native</module>
<module>nd4j-native-preset</module>
Expand Down
4 changes: 2 additions & 2 deletions nd4j/nd4j-common/pom.xml
Expand Up @@ -36,8 +36,8 @@
<name>nd4j-common</name>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<module.name>nd4j.common</module.name>
</properties>

Expand Down
18 changes: 12 additions & 6 deletions nd4j/samediff-import/pom.xml
Expand Up @@ -47,13 +47,13 @@

<properties>
<kotlin.version>1.4.30</kotlin.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<junit.version>5.8.0-M1</junit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>


<java.version>1.8</java.version>
<java.version>11</java.version>
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<test.heap.size>2g</test.heap.size>
<test.offheap.size>2g</test.offheap.size>
Expand Down Expand Up @@ -160,6 +160,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<arg>--add-exports</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
Expand All @@ -182,10 +192,6 @@
<goals> <goal>testCompile</goal> </goals>
</execution>
</executions>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Expand Down
27 changes: 17 additions & 10 deletions omnihub/pom.xml
Expand Up @@ -22,9 +22,9 @@
<junit.version>5.8.0-M1</junit.version>
<junit.platform.launcher.version>1.8.0-M1</junit.platform.launcher.version>
<junit-jupiter.version>5.4.2</junit-jupiter.version>
<java.version>1.8</java.version>
<java.version>11</java.version>
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<module.name>omnihub</module.name>
</properties>
Expand Down Expand Up @@ -157,10 +157,10 @@
<build>
<plugins>

<!-- <plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>-->
<!-- <plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>-->

<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -286,7 +286,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<version>3.8.1</version>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
Expand All @@ -306,12 +306,19 @@
<execution>
<id>java-test-compile</id>
<phase>test-compile</phase>
<goals> <goal>testCompile</goal> </goals>
<goals> <goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
Expand Down
20 changes: 13 additions & 7 deletions platform-tests/pom.xml
Expand Up @@ -56,14 +56,14 @@
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>

<kotlin.version>1.4.30</kotlin.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<junit.version>5.8.0-M1</junit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lz4.version>1.8.0</lz4.version>


<java.version>1.8</java.version>
<java.version>11</java.version>
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<log4j2.version>2.17.2</log4j2.version>
<netty.version>4.1.74.Final</netty.version>
Expand Down Expand Up @@ -658,6 +658,16 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens</arg>
<arg>java.base/java.nio=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
Expand All @@ -684,10 +694,6 @@
</goals>
</execution>
</executions>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>


Expand Down Expand Up @@ -823,7 +829,7 @@
</classpathDependencyExclude>
</classpathDependencyExcludes>
<useManifestOnlyJar>false</useManifestOnlyJar>
<argLine>-Dorg.nd4j.arraynogc=${test.nogc} -Dorg.bytedeco.javacpp.logger.debug=true -Dorg.bytedeco.javacpp.nopointergc=${test.nogc} -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size} </argLine>
<argLine> --add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dorg.nd4j.arraynogc=${test.nogc} -Dorg.bytedeco.javacpp.logger.debug=true -Dorg.bytedeco.javacpp.nopointergc=${test.nogc} -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size} </argLine>
<forkedProcessTimeoutInSeconds>240</forkedProcessTimeoutInSeconds>
<forkedProcessExitTimeoutInSeconds>240</forkedProcessExitTimeoutInSeconds>
<parallelTestsTimeoutInSeconds>240</parallelTestsTimeoutInSeconds>
Expand Down
Expand Up @@ -22,7 +22,6 @@

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import lombok.var;
import org.deeplearning4j.BaseDL4JTest;
import org.deeplearning4j.datasets.iterator.DummyBlockDataSetIterator;
import org.eclipse.deeplearning4j.dl4jcore.datasets.iterator.tools.SimpleVariableGenerator;
Expand Down
Expand Up @@ -22,7 +22,6 @@

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import lombok.var;
import org.datavec.api.records.reader.RecordReader;
import org.datavec.api.records.reader.impl.collection.CollectionRecordReader;
import org.datavec.api.writable.IntWritable;
Expand Down
Expand Up @@ -22,7 +22,6 @@

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import lombok.var;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.math3.stat.descriptive.rank.Percentile;
import org.apache.commons.math3.util.FastMath;
Expand Down

0 comments on commit c1bf871

Please sign in to comment.