Wat, Julia?

By: Chris von Csefalvay

Re-posted from: http://doodlingindata.com/2015/06/16/wat-julia/

One of my favourite videos on programming is the famous WAT? talk by Gary Bernhardt. It’s a masterpiece of making fun of languages’ idiosyncrasies while at the same time making a profound point (whether Gary intended that or not): programming languages have their own way of dealing with marginal situations, and some make sense in […]

JuliaCon 2015 Preview – Deep Learning, 3D Printing, Parallel Computing, and so much more

By: Julia Developers

Re-posted from: http://feedproxy.google.com/~r/JuliaLang/~3/z-Evw2AMzvU/juliacon-preview

JuliaCon 2015 is being held at the Massachusetts Institute of Technology from June 24th to the 28th. Get your tickets and book your hotel before June 4th to take advantage of early bird pricing.


The first ever JuliaCon was held in Chicago last year and was a great success. JuliaCon is back for 2015, this time in Cambridge, Massachusetts at MIT’s architecturally-delightful Stata Center, the home of computer science at MIT. Last year we had a single-track format, but this year we’ve expanded into a four-day extravaganza:
* On Wednesday 24th there will an introduction to Julia workshop run by David P. Sanders (@dpsanders) as well as a Julia hackathon – a great chance to get some help for your new Julia projects, or to begin contributing to Julia or its many packages.
* On Thursday 25th and Friday 26th we will be having speakers talking about a range of topics – we were fortunate to have so many fantastic submissions that we had to open up a second track of talks. The near-final schedule is on the main page. We’ll be alternating between ~40 minute long “regular” talks, and ~10 minute long “lightning” talks across all the sessions.
* On Saturday 27th we will finish with a series of workshops on a range of topics: data wrangling and visualization, optimization, high-performance computing and more. These workshops run from 1.5 to 3 hours and will be a great way to rapidly boost your Julia skills.

Thursday’s Talks

After getting everyone settled in, we’ll start the conference proper with a session about the use of Julia in a wide variety of scientific applications. Many of the talks at the conference focus on Julia package organizations: groupings of similar packages that promote interoperability and focussing of efforts. In the session Daniel C. Jones (@dcjones), the creator of the visualization package Gadfly, will discuss the advances being made in the BioJulia bioinformatics organization, and Kyle Barbary (@kbarbary) will present JuliaAstro, a home for astronomy and astrophysics packages. Theres something for everyone: quantitative economic modeling (QuantEcon.jl), quantum statistical simulations, and how to fit Julia into a pre-existing body of code in other languages.

After lunch we’ll be splitting into two tracks: visualization and interactivity and statistics. The visualization track will be demonstrating some of the exciting advances being made that enable Julia to both produce high-quality visualizations, but also share them. Mike Innes (@one-more-minute), creator of the Juno IDE for Julia, will be sharing his working on building web-powered apps in Julia, while Viral B. Shah (@ViralBShah), one of the Julia founders, will be discussing more about the inner workings of and plans for JuliaBox. For a different take on “visualization”, Jack Minardi of Voxel8 will be sharing how Julia is powering their 3D printing work.

The statistics session covers some hot topics in the field, including two talks from researchers at MIT about how Julia is playing a big part: probabilistic programming (Sigma.jl) and deep learning (Mocha.jl). Facebooker John Myles White, author of “Machine Learning for Hackers” and a variety of packages in R and Julia, will share his thoughts on how statistics in Julia can be taken to the next stage in development, and Pontus Stenetop (@ninjin) will educate and entertain in his talk “Suitably Naming a Child with Multiple Nationalities using Julia”.

We’ll come together at the end of Thursday to learn more about how to write good Julia code, how to write packages that Just Work on Windows, and how wrappers around C libraries can be made easier than you might think through the magic of Clang.jl. Iain Dunning (@IainNZ), maintainer of Julia’s package listing and test infrastructure will follow up on last years talk by giving a brief history and updated status report on Julia’s package ecosystem. Finally current Googler Lean Hanson (@astrieanna) will share some of her tips for people looking to get started with contributing to Julia and to open-source projects.

Whatever you get up to after the talks end on Thursday, make sure you are up in time for…

Friday’s talks

If you are interested in learning how Julia works from the people who work on it every day, then Friday morning’s session is for you. The morning will kick off with newly-minted-PhD and Julia co-founder Jeff Bezanson (@JeffBezanson), who is still recovering from his defense and will be updating us on the title of his talk soon. We’ll be learning more about different stages of the compilation process from contributors Jake Bolewski (@jakebolewski) and Jacob Quinn (@quinnj), and we’ll be covering a miscellany of other cutting-edge topics for Julia like tuning LLVM, debugging, and interfaces.

In the afternoon we’ll have four sessions split across two rooms. In the second scientific applications session we’ll be learning more about how Julia is being used to prevent airborne collisions from Lincoln Lab’s Robert Moss, and Iain Dunning (@IainNZ) will give a sequel to last years JuliaOpt talk to update us on how Julia is becoming the language of choice for many for optimization. We’ll also hear how Julia is enabling rapid development of advanced algorithms for simulating quantum systems, evolving graphs, and analyzing seismic waves.

The numerical computing track kicks of with Stanford’s Prof. Jack Poulson (@poulson), creator of the Elemental library for distributed-memory linear algebra. Right after, the linear algebra wizard Zhang Xianyi (@xianyi) will give a talk about OpenBLAS, the high-performance linear algebra library Julia ships with. After a break, we’ll hear Viral’s thoughts on how sparse matrices currently and should work in Julia, before finishing off with lightning talks about validated numerics and Taylor series.

We’ll see out the day with two sessions that hit some topics of interest to people deploying Julia into larger systems: data and parallel computing. In the data session we’ll learn how about the nuts and bolts of sharing and storing data in Julia and hear more about plans for the future by the contributors working in these areas. Make sure to check out the talk by Avik Sengupta (@aviks) about his real-world industry experiences about putting Julia code behind a web-accessible API.

The parallel computing session will tackle parallelism at all levels. Contributor Amit Murthy (@amitmurthy) will open the session with a discussion of his recent work and plans for managing Julia in a cluster. We’ll also hear about work being done to make Julia multithreaded at Intel, and about running Julia on a Cray supercomputer.

After all that you will surely be inspired to hack on Julia projects all night, but make sure to wake up for a full day of workshops on Saturday!

Remember to get your tickets and book your hotel before June 4th to take advantage of early bird pricing. We’d also like to thank our platinum sponsors: the Gordon and Betty Moore Foundation, BlackRock, and Julia Computing. We can’t forget out silver sponsors either: Intel and Invenia. We’re looking forward to seeing you there!

GLVisualize Benchmark

By: Simon Danisch

Re-posted from: http://randomfantasies.com/2015/05/glvisualize-benchmark/

This is a benchmark comparing GLVisualize against some popular scientific visualization libraries, namely Mayavi, Vispy and Matlab.

There is also a chapter on IJulia, which is not really a plotting library, but can incorporate plots from other libraries.

The biggest problem with bench marking 3D rendering speed is, that there is no library which will allow to exactly reproduce similar conditions and measures.
Additionally, without extensive knowledge of the library, it is difficult to foresee what gets bench marked.
As an example of why it is difficult to measure the frame rate we can look at Vispy. When you enable to measure the frame rate, it will show very low frame rates, as it only creates a new frame on demand.
In contrast, GLVisualize has a fixed render loop, which renders as much frames as possible, leading to totally different amount of rendered frames per second (which is admittedly a total waste of GPU time and will change in the future).
This is why it was decided, to use the threshold at which a similar 3D scene is still conceived as enjoyable and interactive. Usually the minimal amount of frames per second for perceiving movements as smooth is roughly around 25.
So the benchmark was executed in the way, that the number regulating the complexity of the 3D scene was increased until one could not move the camera without stutters. The recorded last enjoyable threshold is than the result of the Benchmark.

vispy_mayavi_romeo

First benchmark is an animated and still 3D surface plot. The libraries offering this functionality where Vispy, Mayavi and Matlab.

Library Still Animated
Vispy  300  80
Mayavi 800 150
Matlab 800 450
GLVisualize 900 600
Speed up Vispy 9x  56x
Speed up Mayavi 1.26x 16x
Speed up Matlab 1.26x 1.7x

(Speed up of GLVisualize)
Vispy had some issues, as the camera was never really smooth for the surface example. Also the normals were missing and there was no option to colorize the surface depending on the height.
It was decided to use the threshold of going from a little stutter to unpleasant stutters, making vispy not completely fail this benchmark.
For Vispy it was found out, that the normals where calculated on the CPU resulting in a major slow down. The same can be expected for Mayavi, but Mayavi seems to be faster at calculating the normals.
There is not much information available on how Matlab renders their visualization, as it is closed source. It has to be noted, that Matlab did some additional calculations to always fit the drawing ideally into the borders.

On the other hand, Matlab is using a gouraud shading model, which needs quite a bit less processing power than phong-blinn shading, which is used by GLVisualize.


 

romeo_mayavi_particles2

The next benchmark is only between GLVisualize and Mayavi, as the other libraries did not offer a comparable solution. Matlab does not allow to use cubes as particle primitives and Vispy only had an example, where you needed to write your own shader, which can not be seen as a serious option. This is a benchmark for easy to use and high level plotting libraries. It is always possible to write an optimal version yourself in some framework, but what really interesting is, how well you can solve a problem with the tools the library has readily available.

Library  Still  Animated
Mayavi 90000 2500
GLVisualize 1000000 40000
Speed up 11x 16x

GLVisualize is an order of magnitude faster in this specific benchmark. This is most likely due to the fact that GLVisualize uses OpenGL’s native instance rendering.

On a side note, GLVisualize was the only library that allowed to use any arbitrary mesh as a particle.


 

IJulia

It was not possible to compare IJulia directly with GLVisualize, as the feature set for plotting is too different.

But there are certain factors, which indicate, that is hard to reach optimal performance with IJulia.
First of all, IJulia uses ZMQ to bridge the web interface with the Julia kernel.
ZMQ is a messaging system using different sockets for communication like inproc, IPC, TCP, TIPC and multicas.
While it is very fast at it’s task of sending messages, it can not compete with the native performance of staying inside one language.
This is not very important as long as there does not have to be much communication between Julia and the IPython kernel.

This changes drastically for animations, where big memory chunks have to be streamed to the rendering engine of the browser. It can be expected, that this will always be a weakness of IJulia.
On the other hand, GPU accelerated rendering in a web browser is also limited.
It relies on WebGL, which offers only a subset of OpenGL’s functionality. So while the execution speed of OpenGL can be expected to be similar, there are a lot of new techniques missing, which can speed up rendering.

To investigate this another benchmark has been created.
It is between GLVisualize and Compose3D, which was the only library found to be able to display 3D models created with Julia directly from the IJulia notebook.
This benchmark is not entirely fair, as Compose3D is just a rough prototype so far which wasn’t even published yet.
But there seems to be no other library with which you can easily create and display interactive 3D graphics in the IJulia or IPython notebook.
This benchmark creates a sierpinsky gasket and Compose3D displays it in the IJulia notebook while GLVisualize displays it natively in a window.

sierpinsky - Copy

Compose3D 15625
GLVisualize 1953125
Speed up 125x

Again, GLVisualize is an order of magnitude faster. This can change in the future when Compose3D matures.
But one needs to notice, that GLVisualize utilizes OpenGL’s instancing to gain this speed. Native instancing is not yet available in WebGL, which means that this optimization will not be available for the IPython notebook in the near future.

 

All in all, this looks pretty promising for GLVisualize.

It must be said though, that the numbers need to be treated with care, as it is quite hard to benchmark 3D scenes without the full control over the libraries. It might be, that I did something wrong in the setup, or that the library actually offers a lot more than GLVisualize, which in turn slows it down.

But it can definitely be said, that these are solid results for a pretty fresh prototype, competing with pretty mature libraries.

 

The Code is in my Github repository.