Skip to content

JVM, .NET Language Support #3

Description

@sirinath

Your website says "... contribute SWIG interfaces to your favorite language ...". It will be good if yo have pure implementations in other languages like JVM and .NET without having to use SWIG.

Activity

  1. sheepdreamofandroids commented on Nov 9, 2015

    @sheepdreamofandroids

    Since raw performance is one of the goals of this library I think that pure implementations don't make too much sense.
    A prettier API on top of the generated interfaces would be nice though.

  2. girving commented on Nov 9, 2015

    @girving
    Contributor

    Although we may not pursue this ourselves, the internal formats used for communication (GraphDef, etc.) are all platform independent protobuf. Thus, it is possible to implement all or part of the tensorflow API in Java while preserving communication compatibility with the existing code. Since a Java version would likely be slower, one useful bit would be a pure inference layer that evaluates graphs but isn't necessarily able to build them; this would allow graphs built in Python and trained in Python / C++ on GPUs to be run from Java servers.

  3. edblackburn commented on Nov 9, 2015

    @edblackburn

    Is there a canonical / repeatable test suite, so language bindings can have a target and level of confidence? Is there a build server? Could there be a build server?

  4. girving commented on Nov 9, 2015

    @girving
    Contributor

    There's a testsuite with fairly good converge, but currently it's mostly Python with a few C++ tests. There's also a lot of functionality for building graphs that's currently Python only, in particular the automatic differentiation functionality, though that doesn't matter for evaluation of graphs in Java. There are plans to move this functionality into the underlying C++ in future, at which point Java SWIG bindings would be more useful for creating graphs.

    If someone takes up the Java SWIG challenge, we'd be happy to accept it upstream pending review, etc., at which point it would be part of our continuous testing. The details of accepting contributions is in flux at the moment, but that will stabilize.

  5. sirinath commented on Nov 10, 2015

    @sirinath
    Author

    Also perhaps https://github.com/bytedeco/javacpp can be used to generate bindings.

  6. kovasb commented on Dec 10, 2015

    @kovasb

    @girving What aspect of automatic differentiation is not available from other languages? Is that just for defining new ops?

  7. girving commented on Dec 10, 2015

    @girving
    Contributor

    If you search for RegisterGradient in the python directory, you'll see all the places we define the gradients of various ops. The gradients are defined by Python code, so they aren't available from pure C++ as yet (we hope to change this at some point).

  8. kovasb commented on Dec 10, 2015

    @kovasb

    I don't fully grasp the architecture/order of operations, but could one populate the gradients using python, while still calling into the C++ code via a bridge?

    Alternatively: Run the python code once to generate the gradients for every op, serialize all those gradients to a file, and then other runtimes can read them off and register them?

  9. girving commented on Dec 10, 2015

    @girving
    Contributor

    Both of those might work, but I don't know how much of a savings they are compared to doing it the right way and porting the code to C++.

  10. kovasb commented on Dec 10, 2015

    @kovasb

    I fully agree, just sounding out a temporary solution so I'm not blocked (I imagine it might be a while before all that code is ported)

  11. sirinath commented on Dec 11, 2015

    @sirinath
    Author

    If all the functionality is not available in the C++ core then porting will be very difficult and some cases not possible (with respect to a fully functional version). Also I opened this: #476

  12. ieee8023 commented on Jan 1, 2016

    @ieee8023

    +1 for Java

  13. added a commit that references this issue on Mar 9, 2016
  14. 121 remaining items

  15. added 2 commits that reference this issue on Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions