Current state of Gust?

63 views
Skip to first unread message

Alexander Demidko

unread,
May 7, 2015, 12:30:28 PM5/7/15
to scala-...@googlegroups.com
Hi,

Have used Breeze in few pet or proof of concept projects and should say it’s a great library! Next interesting thing is running linalg computations on GPU. I know there is Gust and would be glad to understand its current state and evolution direction. Could you please throw in some information on that?

Beyond that, few more specific questions:

- Can/Will Breeze and Gust be seamlessly interchanged with no/little dependent code modification? It looks that CuMatrix and Matrix share at least NumericOps so seems it’s possible at least for some operations. In this case already written Breeze tests could be reused to test Gust functionality – well, considering GPU floating point precision.

- What do you think about adding pointer autorelease functionality? For example, if we perform operations like pinv(X.t * X) * X.t * y there will be created matrices (X.t * X), (pinv(X.t * X)) , (pinv(X.t * X) * X.t) and finally (pinv(X.t * X) * X.t * y), where only the latter will be accessible and release-able by the user. To solve this there could be smth like withAutorelease { … } which would implicitly register every CuTensor created inside of the scope and release them on the end, except maybe return value.

- What do you think of ND4J? Frankly, I’m little hesitant what to use - Breeze+Gust or ND4Jt. On one hand, they kind of claim production level GPU support and seamless CPU<->GPU switch, on the other – they are originally written in Java and their Scala API might need some improvements. Haven’t looked too deep but not sure if they have broadcast operations, for example.

- Do you accept contributions to Gust? I’m mostly interested in machine learning rather than linear algebra library itself but might want to PR if some needed functionality will be missing.

Thanks,
Alex

David Hall

unread,
May 7, 2015, 12:35:29 PM5/7/15
to scala-...@googlegroups.com
On Wed, May 6, 2015 at 11:46 PM, Alexander Demidko <dral...@gmail.com> wrote:
Hi,

Have used Breeze in few pet or proof of concept projects and should say it’s a great library! Next interesting thing is running linalg computations on GPU. I know there is Gust and would be glad to understand its current state and evolution direction. Could you please throw in some information on that?

Thanks!  and sure. Gust is kind of on hold right now. I'm pretty busy with other stuff and haven't had much of a chance to work on it. That said:

 

Beyond that, few more specific questions:

- Can/Will Breeze and Gust be seamlessly interchanged with no/little dependent code modification? It looks that CuMatrix and Matrix share at least NumericOps so seems it’s possible at least for some operations. In this case already written Breeze tests could be reused to test Gust functionality – well, considering GPU floating point precision.

- What do you think about adding pointer autorelease functionality? For example, if we perform operations like pinv(X.t * X) * X.t * y there will be created matrices (X.t * X), (pinv(X.t * X)) , (pinv(X.t * X) * X.t) and finally (pinv(X.t * X) * X.t * y), where only the latter will be accessible and release-able by the user. To solve this there could be smth like withAutorelease { … } which would implicitly register every CuTensor created inside of the scope and release them on the end, except maybe return value.

Right now, Gust keeps track of how much free memory there is, and runs System.gc() if it thinks it can't allocate enough GPU memory. (The JVM GC doesn't care how much GPU memory there is, so you have to force the GC, or keep track of pointers using a mechanism like you suggest.) This usually works to free up temporaries.

In practice, this can be slow, and what would be better is coming up with a good syntax for doing operations that have dedicated "sinks", or, more ambitiously, using expression trees to rewrite the expression to minimize allocations/operations.

withAutorelease would also be nice. Probably needs to be macro based to be truly safe.
 

- What do you think of ND4J? Frankly, I’m little hesitant what to use - Breeze+Gust or ND4Jt. On one hand, they kind of claim production level GPU support and seamless CPU<->GPU switch, on the other – they are originally written in Java and their Scala API might need some improvements. Haven’t looked too deep but not sure if they have broadcast operations, for example.

Haven't looked at it closely.
 

- Do you accept contributions to Gust? I’m mostly interested in machine learning rather than linear algebra library itself but might want to PR if some needed functionality will be missing.

Of course, that would be great.
 

Thanks,
Alex

--
You received this message because you are subscribed to the Google Groups "Scala Breeze" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-breeze...@googlegroups.com.
To post to this group, send email to scala-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-breeze/7a5e5c40-4d55-45ff-b2be-50a69e3a8ddd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Hall

unread,
May 7, 2015, 12:53:52 PM5/7/15
to scala-...@googlegroups.com
On Wed, May 6, 2015 at 11:46 PM, Alexander Demidko <dral...@gmail.com> wrote:
Hi,

Have used Breeze in few pet or proof of concept projects and should say it’s a great library! Next interesting thing is running linalg computations on GPU. I know there is Gust and would be glad to understand its current state and evolution direction. Could you please throw in some information on that?

Beyond that, few more specific questions:

- Can/Will Breeze and Gust be seamlessly interchanged with no/little dependent code modification? It looks that CuMatrix and Matrix share at least NumericOps so seems it’s possible at least for some operations. In this case already written Breeze t 
ests could be reused to test Gust functionality – well, considering GPU floating point precision.

Forgot to answer this. Yes. Gust works on the same principles as Breeze. If you write code in a "Breeze-y" generic way, UFunc impls, then a lot of Breeze algorithms work automatically for free. As an example, GPU-side LBFGS already works.
 

- What do you think about adding pointer autorelease functionality? For example, if we perform operations like pinv(X.t * X) * X.t * y there will be created matrices (X.t * X), (pinv(X.t * X)) , (pinv(X.t * X) * X.t) and finally (pinv(X.t * X) * X.t * y), where only the latter will be accessible and release-able by the user. To solve this there could be smth like withAutorelease { … } which would implicitly register every CuTensor created inside of the scope and release them on the end, except maybe return value.

- What do you think of ND4J? Frankly, I’m little hesitant what to use - Breeze+Gust or ND4Jt. On one hand, they kind of claim production level GPU support and seamless CPU<->GPU switch, on the other – they are originally written in Java and their Scala API might need some improvements. Haven’t looked too deep but not sure if they have broadcast operations, for example.

- Do you accept contributions to Gust? I’m mostly interested in machine learning rather than linear algebra library itself but might want to PR if some needed functionality will be missing.

Thanks,
Alex

Reply all
Reply to author
Forward
0 new messages