technical computing in julia
TRANSCRIPT
![Page 1: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/1.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/2.jpg)
720 contributors + package writers
![Page 3: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/3.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/4.jpg)
What’s the big deal about Julia ?
A high level languagewith C-like speed
julialang.org/benchmarks
![Page 5: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/5.jpg)
It bridges the divide between computer science and computational science
What’s the big deal about Julia ?
![Page 6: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/6.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/7.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/8.jpg)
Object-oriented programming with classes
What can I do with/to a thing?
![Page 9: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/9.jpg)
methods objects
Object-oriented programming with classes
What can I do with/to a thing?
![Page 10: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/10.jpg)
methods objects
Object-oriented programming with classes
What can I do with/to a thing?
![Page 11: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/11.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/12.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/13.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/14.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/15.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/16.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/17.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/18.jpg)
![Page 19: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/19.jpg)
![Page 20: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/20.jpg)
![Page 21: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/21.jpg)
![Page 22: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/22.jpg)
![Page 23: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/23.jpg)
![Page 24: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/24.jpg)
easy to call external C functions, e.g. CLAPACK
sstev, dstev…
![Page 25: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/25.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/26.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/27.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/28.jpg)
Native parallelism constructs
![Page 29: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/29.jpg)
Native parallelism constructs
![Page 30: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/30.jpg)
Native parallelism constructs
![Page 31: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/31.jpg)
JuMP: a domain specific language
Iain Dunning Miles LubinMIT
Operations Research
![Page 33: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/33.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/34.jpg)
![Page 35: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/35.jpg)
![Page 36: Technical computing in Julia](https://reader034.vdocument.in/reader034/viewer/2022051516/55a785161a28abea0b8b45d7/html5/thumbnails/36.jpg)
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