-
Notifications
You must be signed in to change notification settings - Fork 77
Adding Hasktorch Proposal #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Two comments:
|
Thanks for the comments @jaspervdj. Regarding 1) - I'm not saying anything particularly novel when I say that numerical/scientific computing is one of the domains where dependent types can make a big difference in the utility of types. In the scientific computing community, one will often hear critiques of type systems along the lines of "what's the use of the type system when all the inputs and outputs are arrays?" Even in the pre-release phase of the project, we've seen advantages to being able to write in a more declarative style - specifying the intent in the form of an equation and having the compiler impute tensor dimensions that are needed to fulfill the computation. A small example that illustrates this - Regarding 2) - the Tensorflow bindings for Haskell are great, but just as Tensorflow for python and Pytorch coexist and occupy different design spaces, the same applies here. Although the project is motivated in part to enable new avenues for research, the scope of this project is concretely to write code for the hasktorch library - https://github.com/hasktorch/hasktorch. Note we haven't made a big push to publicize the library in the current pre-release phase, the 1.0 release and broader dissemination is what we intend to work towards to with this proposal. |
Given this project uses dependent types as well as backpack, I think "Advanced" would be a more appropriate description of its difficulty than "Intermediate". |
Hi @gwils, thanks for the note. Currently, our use of dependent types is for basic utilitarian purposes like typed dimensions. Most intro tutorials cover this topic as the first example, which is enough to contribute. Being an end-user of backpack isn't conceptually advanced, it just hasn't become mainstream yet. Just the other weekend Sam ran through a great intro tutorial for the other contributors (including myself), we would do the same for someone coming on board. |
Question: |
Hi @cartazio, version-wise - we're tracking the Pytorch repo master branch (last refresh was probably a month or two ago). We use the repo's ATen shared library with a focus on the functional-esque C core currently. Tracking upstream changes as they arrive has been a pretty lightweight process (usually ~ an hour or less) thanks to the core C libraries having a consistent, mostly-functional API and code generating the low-level raw bindings. It's nice to be able to do this because they're still adding functionality to the core, most recently vectorized probability functions like gamma/erf (they pulled in some contributions from the Pyro devs). We've been able to tag along and get those functions for almost free as they're being implemented by the Pytorch team. I haven't tried Blis so I can't make an informed comment, but the torch family of libraries is well regarded as having a very ergonomic API, and has been dog-fooded for a long time to build one of the most popular neural network libraries. Although not exactly identical, the C core is pretty close to what's surfaced by the lua torch API so you can get a sense of the usage from those docs: https://github.com/torch/torch7/blob/master/doc/maths.md It's fairly "batteries-included" as far as these types of libraries go, more so with time. |
@cartazio - Given a 30s overview, it looks like blis is also a blas-alternative, while Torch is generic across blas- and lapack- libraries (chosen at compile-time), but also includes operations on tensors. The torch interface is seamless across GPU and CPU backends using CuBlas and Magma for the GPU-based blas and lapack libraries, respectively, and adding a CPU version of the CuDNN library in THNN. @jaspervdj The motivation for torch vs tensorflow in haskell. From my perspective working with the python variants, tensorflow is even more "batteries included" while torch relies on the host language for its API. Haskell is excellent for parallel and concurrent execution in both CPU and GPU operations (props to accelerate here) and I see "production level torch" being able to leverage this. |
Okay, I think I'm happy to merge this, but:
|
Please send the contact details to the Haskell.org committee so that we all have them. |
Thanks! |
Some small comments on that last commit, given the feedback here:
|
Added proposal for Hasktorch - "Finalize the Hasktorch Library for a 1.0 Release".