-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add Scala 2.12 and 2.13 cross-compilation (#16438) #17503
base: master
Are you sure you want to change the base?
Conversation
Just FYI, there are currently some issues with the CI. So not every failure of the tests you observe is due to your changes. I suggest you also take a look at #16167 (comment) . For example, the Module "Examples" you mention above would likely be rendered obsolete as part of MXNet 2.
|
Examples do not compile because I've updated |
Please CC the persons who contributed the respective example (see git history of the file) in this issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fomkin Removing the examples may fix the CI now, but it will be bad for the project down the line as those examples would no longer be maintained. It is odd that those examples were not working. I looked at the current problem. In BertQA.java lines 77 and 79, try to use null
as the second argument to the softmaxParam constructor. If this doesn't work or other examples are broken, I can help fix them or you can ask whoever created the example (see git blame).
@gigasquid Would this affect clojure at all?
@@ -26,7 +26,7 @@ | |||
<relativePath>../pom.xml</relativePath> | |||
</parent> | |||
|
|||
<artifactId>mxnet-full_2.11</artifactId> | |||
<artifactId>mxnet-full</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you are removing the _{scala.binary.version} from the internal artifactId? This could end up breaking other users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an artifactId in the Maven reactor scope. Concrete Scala version suffix adds on deploy phase (see deploy/pom.xml
). It means that artifact published to the Central will have proper Scala version suffix. So it shouldn't break other users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When install scala-package locally, ~/.m2/repository
will contain artifact without suffix. I sure that it advanced usage option, and user know what he or she doing. At least he or she explicitly sets profile with Scala version.
.flatMap(x => Array.fill[Float](repeat)(x.toFloat)) | ||
val range2 = NDArray.arange(stop, step = step, repeat = repeat) | ||
assert(CheckUtils.reldiff(result2.toArray, range2.toArray) <= 1e-4f) | ||
|
||
val result3 = 0f to stop by 1f | ||
val result3 = (BigDecimal(0) until BigDecimal(stop) by BigDecimal(1)).map(_.toFloat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BigDecimal(0) to BigDecimal(stop)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -423,23 +590,11 @@ | |||
<version>1.7.7</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.scalatest</groupId> | |||
<artifactId>scalatest_2.11</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try to keep the dependencies in the dependency section so it is easier to keep track of them. For scalatest, you could just use <artifactId>scalatest_${scala.binary.version}</artifactId>
. If you need to vary the version, you could use a property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to do this. But it doesn't working. Looks like maven-remote-resources-plugin
doesn't understand profile-depended properties in dependencies. Here is error log https://gist.github.com/fomkin/a26aefc59eaca1148dfed3719a8144f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well. It solves by removing default properties: maven-remote-resources-plugin
ignores the property from a profile if it has default values.
Thanks. Now it compiles. |
But throws exception 🤕 |
* Add Maven profiles * Prepare FFI to work with Scala 2.13 collections * Modify code to support Scala 2.13 * Modify CI scripts to run test with all Scala versions
No - That shouldn't affect Clojure. Thanks for thinking about us though :) |
@gigasquid May you look at this http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Funix-cpu/detail/PR-17503/7/pipeline#step-600-log-1655 ? What I had do wrong? |
@lanking520 may you look at |
I stand corrected. It does affect the Clojure package as well. A library we use depends on the old version of scala and would need to be forked/upgraded to work https://github.com/t6/from-scala/blob/master/project.clj |
You may also want to set |
@gigasquid Looks like it simpler to downgrade Scala 2.11 back to 2.11.8. Upgrading minor Scala version is not the purpose of this PR. |
@TaoLv Is something wrong with the softmax operator? It says that the length argument is required, but I think it is supposed to be optional (and used to be optional). The examples in the documentation you linked to don't include a length argument. The current problem is that one of our java examples originally called |
Description
Currently, MXNet supports only ancient Scala 2.11. This prevents using the library in the Scala community. I found mentions of try to add support of Scala 2.12 but looks like the trial was failed, although PR was merged. This PR is another try.
Comments
scala-2.11
,scala-2.12
andscala-2.13
Maven profiles. Now one of the profiles should be active. This condition is checked bymaven-enforcer-plugin
Seq
is immutable now, so I need to ivoketoSeq
for eachArrayBuffer
to copy it to immutable sequenceChecklist
Essentials
Please feel free to remove inapplicable items for your PR.
To solve
BertQA
starts to compile (looks like it was ignored before). It breaks compilation of examples. I don't know what to do. I'm nood in neural networks and not know how no modify the code to make it compile.