technical computing in julia

36
Technical computing in Jiahao Chen MIT CSAIL Alan Edelman Jeff Bezanson Stefan Karpinski Viral B. Shah Andreas Noack Jake Bolewski

Upload: jiahao-chen

Post on 16-Jul-2015

674 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Technical computing in Julia

Technical computing in

Jiahao Chen MIT CSAIL

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

Page 2: Technical computing in Julia

720 contributors + package writers

Page 3: Technical computing in Julia

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

The world of557 packages, 720 authors

345 contributors to julia repo5,239 stargazers436 watchers

Page 4: Technical computing in Julia

What’s the big deal about Julia ?

A high level languagewith C-like speed

julialang.org/benchmarks

Page 5: Technical computing in Julia

It bridges the divide between computer science and computational science

What’s the big deal about Julia ?

Page 6: Technical computing in Julia

It bridges the divide between computer science and computational science

What’s the big deal about Julia ?

data abstraction

performance

Page 7: Technical computing in 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: Technical computing in Julia

Object-oriented programming with classes

What can I do with/to a thing?

Page 9: Technical computing in Julia

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

Page 10: Technical computing in Julia

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

Page 11: Technical computing in Julia

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

top uppay fare

lose

buy

Page 12: Technical computing in Julia

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

top uppay fare

lose

buy

top uppay fare

lose

buy

Page 13: Technical computing in Julia

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

top uppay fare

lose

buy

top uppay fare

lose

buy

Page 14: Technical computing in Julia

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

top uppay fare

lose

buy

top uppay fare

lose

buy

pay farelose

buy

Page 15: Technical computing in 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 16: Technical computing in 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 17: Technical computing in 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 18: Technical computing in Julia
Page 19: Technical computing in Julia
Page 20: Technical computing in Julia
Page 21: Technical computing in Julia
Page 22: Technical computing in Julia
Page 23: Technical computing in Julia
Page 24: Technical computing in Julia

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

sstev, dstev…

Page 25: Technical computing in Julia

So how does this help us with linear algebra?

Multi-method dispatch with generic fallbacks

Matrix operations on general rings

Page 26: Technical computing in Julia

So how does this help us with linear algebra?

Multi-method dispatch with generic fallbacks

Matrix operations on general rings textbook algorithm

Page 27: Technical computing in Julia

So how does this help us with linear algebra?

Multi-method dispatch with generic fallbacks

Matrix operations on general rings

Page 28: Technical computing in Julia

Native parallelism constructs

Page 29: Technical computing in Julia

Native parallelism constructs

Page 30: Technical computing in Julia

Native parallelism constructs

Page 31: Technical computing in Julia

JuMP: a domain specific language

Iain Dunning Miles LubinMIT

Operations Research

Page 32: Technical computing in Julia

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

Page 33: Technical computing in Julia

Summary

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

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

MS246: High-level Technical Computing with Julia4:25 PM - 6:05 PM in Room 254 B

Page 34: Technical computing in Julia
Page 35: Technical computing in Julia
Page 36: Technical computing in 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