-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
@@ -67,7 +67,7 @@ | |||
<linkerMiddleOption>-Wl,-x</linkerMiddleOption> | |||
<linkerMiddleOption>${lddeps}</linkerMiddleOption> | |||
<linkerMiddleOption>-force_load ../../../lib/libmxnet.a</linkerMiddleOption> | |||
<linkerMiddleOption>-force_load ../../../3rdparty/tvm/nnvm/lib/libnnvm.a</linkerMiddleOption> | |||
<linkerMiddleOption>-force_load ../../../3rdparty/nnvm/lib/libnnvm.a</linkerMiddleOption> |
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.
Why is this required? ${lddeps}
should already have these ? see how it is setup
https://github.com/apache/incubator-mxnet/blob/master/Makefile#L386
https://github.com/apache/incubator-mxnet/blob/master/Makefile#L581
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 am not sure, it just live there for a long time. And do you know who change that line of code. I pulled from master and see that addition
e9ab9d7
to
4d1954f
Compare
@@ -823,7 +823,7 @@ class Symbol private(private[mxnet] val handle: SymbolHandle) extends WarnIfNotD | |||
} | |||
|
|||
@AddSymbolFunctions(false) | |||
object Symbol { | |||
object Symbol extends SymbolBase { |
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.
please add comments to all class/object/method definitions.
@@ -37,6 +37,8 @@ private[mxnet] object APIDocGenerator{ | |||
val FILE_PATH = args(0) | |||
absClassGen(FILE_PATH, true) | |||
absClassGen(FILE_PATH, false) | |||
oldAPIClassGen(FILE_PATH, true) |
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.
oldAPIClassGen->NonTypeSafeClassGen
@@ -61,8 +63,35 @@ private[mxnet] object APIDocGenerator{ | |||
pw.close() | |||
} | |||
|
|||
def oldAPIClassGen(FILE_PATH : String, isSymbol : Boolean) : Unit = { |
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.
nonTypeSafeAPIClassGen
// Generate ScalaDoc type | ||
def generateAPIDocFromBackend(func : absClassFunction) : String = { | ||
def generateAPIDocFromBackend(func : absClassFunction, withParam : Boolean = true) : String = { |
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.
could you please make sure that the documentation matches what we have today, i think we follow Java doc style and not Scala doc style..make sure its consistent as well. I can't tell from the text
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 followed this guideline: https://docs.scala-lang.org/style/scaladoc.html
<artifactId>scalastyle-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> |
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.
why are we using the plugin from this group? we use it from this group org.scala-tools. Please check pom file on scala-package.
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.
Currently I cannot find a better approach to generate a doc jar rather than this plugin. As we discovered before, the Javadoc plugin that Scala Package originally have did not compile the Scala code and generate jars.
Currently, I created a file called |
Currently, I cannot make it pass the GPU test even if the MD5 is guaranteed unchanged. I cannot reproduce the problem even if I open a GPU instance and build all over again. In this case, I decided to remove |
@@ -0,0 +1,4 @@ | |||
309G_O39xojNEt3DXVWNDQ |
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 this meant to be checked in? what files does this hash represent? how are they going to be updated?
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.
Good question. The hashfile contains the signature files that on Scala package not uploaded here. It follows the following format:
abstract class SymbolAPIBase {
/**
* Comments
*/
def Activation(...Args...) : Symbol
}
I used md5 hash in here:
def MD5Generator(input : String) : String = {
val md = MessageDigest.getInstance("MD5")
md.update(input.getBytes("UTF-8"))
val digest = md.digest()
org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(digest)
}
It basically take the Generated string into hash and store in this file. It should be the same across the different platform. The reason to do is is to avoid operator changes in Symbol and NDArray. One example, if one contributor changed the operators in NDArray and Symbol, he/she should comment the require
line explained before in Scala package and update this file and also tag Scala Contributors to let them know there is a change in operator so we can determine if this will influence the user experience on Scala.
167dacf
to
980109b
Compare
9d4f790
to
7d74310
Compare
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 @lanking520. Great effort, one last request to change.
def nonTypeSafeClassGen(FILE_PATH : String, isSymbol : Boolean) : String = { | ||
// scalastyle:off | ||
val absClassFunctions = getSymbolNDArrayMethods(isSymbol) | ||
val absFuncs = absClassFunctions.filterNot(_.name.startsWith("_")).map(absClassFunction => { |
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 move this filter to the getSymbolNDArrayMethods, so we have one place to change in when start adding support for _sparse_
etc.,
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 think we should also do this for the NDArrayMacro/SymbolMacro in a separate PR
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.
@lanking520 please change the filter location, so i can merge. I meant in APIDocGenerator
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.
Hi @nswamy I have done that, please double check in the code
Attempt to create universal solution to all platforms: https://stackoverflow.com/questions/3077196/messagedigest-hashes-differently-on-different-machines
* Create Interface for Symbol and NDArray APIs, enable JavaDoc jar building for Scala Package.
Description
This is the second proposed solution to this: #11123
Add Java doc support.
@nswamy @yzhliu @andrewfayres
Be aware, I have imported a third party library to generate the Scala doc. Please check the pom file carefully.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.