Previous | Next --- Slide 55 of 60
Back to Lecture Thumbnails
shivalgo

Is there a dominant DSL that is emerging? Looks like the three main PLs of C++, Java, and Python are the underlying languages in which emerging DSLs maybe embedded. What about emerging languages like Rust or Golang? Are they optimal for parallelization?

fromscratch

I really like the example PyTorch sets for "embedded" DSLs. The abstraction it creates is quite intuitive and performant. PyTorch provides a data-parallel abstraction that permits highly-efficient vectorized numerical computations on CPUs and GPUs (and also TPUs) with support for automatic differentiation for arbitrary computational graphs. So far, this is not special. But every once in a while, there are operations that are difficult to express using the built-in bulk operations. For those, you can simply use Python code (e.g., loops) as appropriate, respecting some mild constraints, and PyTorch's tracer can see the sequence of operations you're performing in order to allow computing gradients internally. This offers the flexibility/dynamism of languages like Python as needed, while allowing most operations to be aggressively optimized in our familiar ways (e.g., large kernel launches on GPUs and SIMD+multi-core on CPUs). For this nice picture to be possible, one has to remember that the typical applications (deep neural networks) tend to be inherently accepting of parallelization and uniform SIMD-style computations.

minglotus

What about emerging languages like Rust or Golang? Are they optimal for parallelization?

Based on my experience, the semantics of Go are friendly for parallelization, in the sense that Go natively supports multi-threading via channel go routine, etc.

On the other hand, C++ compilers and libraries have been optimized for many many years by many people, and Go is relatively new (yet gaining popularity quickly and being optimized greatly), so C++ is considered more compute efficient in general.

yarrow2

For embedded DSLs, I wonder if there are any performance bounds given the current implementation of the host language

Please log in to leave a comment.