an introduction to julia

24
A introduction to Jiahao Chen MIT CSAIL Alan Edelman Jeff Bezanson Stefan Karpinski Viral B. Shah Andreas Noack Jake Bolewski

Upload: jiahao-chen

Post on 07-Aug-2015

55 views

Category:

Software


1 download

TRANSCRIPT

Page 1: An introduction to Julia

A introduction to

Jiahao Chen MIT CSAIL

Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah Andreas Noack Jake Bolewski

Page 2: An introduction to Julia

720 contributors + package writers

Page 3: An introduction to Julia

https://github.com/jiahao/ijulia-notebooks

The world of557 packages, 720 authors

345 contributors to julia repo5,239 stargazers436 watchers

Page 4: An introduction to Julia

What’s the big deal about Julia ?

A high level languagewith C-like speed

julialang.org/benchmarks

Page 5: An introduction to Julia

What’s the big deal about Julia ?

Normalized average lines of code (shortest = 0, longest = 1)

Execution time (C = 1)

https://groups.google.com/d/msg/julia-users/BYRAeQJuvTw/O7VK7-vp1EEJ

fast and expressive

Page 6: An introduction to Julia

A simple example

Page 7: An introduction to Julia

It bridges the divide between computer science and computational science

What’s the big deal about Julia ?

data abstraction

performance

What if you didn’t have to choose between data abstraction and performance?

Page 8: An introduction to Julia

Take home message

Types helps users express scientific computations and helps the compiler specialize code for performance

Page 9: An introduction to Julia

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

top uppay fare

lose

buyclasses are more fundamental than methods

top uppay fare

lose

buy

pay farelose

buy

Page 10: An introduction to Julia

OOP with classes multi-methods

What can I do with/to a thing?

top up

pay fare

lose

buy

generic function

objectsmethods

multimethods

relationships between objects and functions

Page 11: An introduction to Julia

Multi-methods for linear algebra

What can I do with/to a thing?

compute spectral factorization

compute singular values

compute singular values and vectors

compute eigenvalues

generic function objectsmethods

Methods can take advantage of special matrix structures

eigvals

eigfact

svdvals

svdfact

Matrix

SymTridiagonal

Bidiagonal

Page 12: An introduction to Julia
Page 13: An introduction to Julia
Page 14: An introduction to Julia

easy to call external C functions, e.g. CLAPACK

sstev, dstev…

Page 15: An introduction to Julia

So how does this help us with linear algebra?

Multi-method dispatch with generic fallbacks

Matrix operations on general rings textbook algorithm

Page 16: An introduction to Julia

So how does this help us with linear algebra?

Multi-method dispatch with generic fallbacks

Matrix operations on general rings

Page 17: An introduction to Julia

Native parallelism constructs

Page 18: An introduction to Julia

JuMP: a domain specific language

Iain Dunning Miles LubinMIT

Operations Research

Page 19: An introduction to Julia

http://github.com/JuliaLang/IJulia.jl

Page 20: An introduction to Julia
Page 21: An introduction to Julia

In summary,

Types helps users express scientific computations and helps the compiler specialize code for performance

Other advanced features for performance: code generation, native parallel computing, …

try it today! juliabox.org

JuliaCon - June 24-28 at MIT juliacon.org

Page 22: An introduction to Julia
Page 23: An introduction to Julia
Page 24: An introduction to Julia

Pure-­‐Julia  FFT  performance

2 4 8 16 32 64 128

256

512

1024

2048

4096

8192

16384

32768

65536

131072

262144

0

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

11000

12000

13000

14000

spee

d (m

flops

)

intel-mkl-dfti in-placeintel-mkl-dfti out-of-placefftw3 out-of-placefftw3 in-placefftw3-no-simd out-of-placefftw3-no-simd in-placedfftpackemayerjuliabloodworthcrosscwplibesrfft

double-precision complex, 1d transformspowers of two

already  comparable  to  FFTPACK  

[  actually  was  even  a  bit  better;        some  recent  inlining        regressions  in  Julia  snapshots  ]

Steven Johnson, 2014-06 Presented at NAIS Codegen workshop