Skip to content

Commit

Permalink
update intro
Browse files Browse the repository at this point in the history
  • Loading branch information
kazewong committed Nov 15, 2023
1 parent 64c7112 commit 5581a30
Showing 1 changed file with 95 additions and 52 deletions.
147 changes: 95 additions & 52 deletions reveal/SciwareJax2023/intro.html
Original file line number Diff line number Diff line change
@@ -1,72 +1,115 @@
<section>
<h2> Jax - </h2>
<h3> Jax - Good, Better, Atrocious </h3>
<h4> Kaze Wong </h4>
<div style="position: fixed; bottom: 0; right: -600;">
<img data-src="../../asset/images/CCA_logo_color.png" width="20%"/>
<div style="position: fixed; bottom: 0; right: -400;">
<img data-src="../../asset/images/NewSimsLOGO_withOld_transparent.png" width="50%"/>
</div>
<!-- <img style="position: fixed; bottom: 0; right: 800;" data-src="./images/qrcode_amaldi1.png" width="30%"/> -->
</section>

<section>
<div class="column">
<h4 class="header"> O4 has started a couple months ago</h4>
<blockquote class="twitter-tweet tw-align-center" height="360">
<p lang="en" dir="ltr">Welcome to the fourth observing run! <a href="https://twitter.com/hashtag/O4IsHere?src=hash&amp;ref_src=twsrc%5Etfw">#O4IsHere</a><br><br>O4 will last 20 months, with <a href="https://twitter.com/ego_virgo?ref_src=twsrc%5Etfw">@ego_virgo</a> and <a href="https://twitter.com/KAGRA_PR?ref_src=twsrc%5Etfw">@KAGRA_PR</a> joining us in the run. We expect the detection rate will be roughly twice in our past observing run<br><br>More news linked from <a href="https://t.co/kHnyuP8I2I">https://t.co/kHnyuP8I2I</a> <a href="https://twitter.com/hashtag/ObservingRun4?src=hash&amp;ref_src=twsrc%5Etfw">#ObservingRun4</a> <a href="https://t.co/B9fhEG96r0">pic.twitter.com/B9fhEG96r0</a></p>&mdash; LIGO (@LIGO) <a href="https://twitter.com/LIGO/status/1661388186042417152?ref_src=twsrc%5Etfw">May 24, 2023</a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8">
</script>
</div>
<h4 class="header">Infrastructure around AI is just as cool</h4>
<img class="row" data-src="https://blogs.nvidia.com/wp-content/uploads/2012/09/gorpycuda3.png" style="margin-top: 0; margin-left: 20px;">
</section>

<section>
<h4 class="header">Jax</h4>
<div class="column">
<h4 class="header"> Events are coming in hot!</h4>
<iframe src="https://gracedb.ligo.org/superevents/public/O4/" style="background: #FFFFFF;" title="Gracedb" width=1080 height=560></iframe>
<div class="row" style="justify-content: space-evenly;">
<img class="row fragment" data-src="../scma8/images/Jax.png">
<ol class="bright fragment">
<li>Autodiff</li>
<li>JIT compilation</li>
<li>Simple vectorization</li>
<li>GPU with XLA</li>
</ol>
</div>
<div class="row fragment" style="justify-content: space-evenly;">
<img class="row" data-src="../scma8/images/jax_grad.png" width="360px;" style="padding-right: 20px;">
<img class="row" data-src="../scma8/images/jax_compile.png" width="360px;">
</div>
</div>
</section>

<section>
<h4 class="header">The future is on the horizon</h4>
<div class="row" style="justify-content: space-evenly;">
<div class="r-stack">
<div class="fragment" data-fragment-index="2">
<img data-src="../scma8/images/3GHorizon.png" width="360px">
</div>
<div class="column fragment fade-in-then-out" data-fragment-index="1">
<img data-src="../scma8/images/ET.jpg" width="360px">
<img data-src="../scma8/images/CE.png" width="360px">
</div>
</div>
<div class="r-stack">
<div class="fragment" data-fragment-index="2">
<img data-src="../scma8/images/LISA_detector.png" width="480px">
</div>
<div class="fragment fade-in-then-out" data-fragment-index="1">
<img data-src="../scma8/images/LISA.png" width="480px">
</div>
</div>
</div>
<h4 class="header">Jax basic - your normal python</h4>
<pre><code data-trim data-noescape>
import jax.numpy as jnp

def f(x):
return x ** x

x = jnp.arange(1, 10)
f(x)
</code></pre>
</section>

<section>
<h4 class="header"> Machine learning in GW</h4>
<div class="r-stack">
<div class="fragment fade-in-then-out">
<div class="column">
<p style="padding:0%; margin:0%;"> Search </p>
<img data-src="../scma8/images/GravitySpy.png" width="720px">
</div>
</div>
<div class="fragment fade-in-then-out">
<div class="column">
<p style="padding:0%; margin:0%;"> Simulation </p>
<iframe width="640px" height="480px" src="https://www.youtube.com/embed/c-2XIuNFgD0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>
</div>
<div class="fragment fade-in">
<p style="padding:0%; margin:0%;"> Inference </p>
<img data-src="../scma8/images/InferenceMeme.jpg" width="720px">
</div>
</div>
<h4 class="header">Jax basic - grad</h4>
<pre><code data-trim data-noescape>
import jax.numpy as jnp
import jax

def f(x):
return x ** x

x = jnp.arange(1,10.)
df = jax.grad(f)
print("Check grad(f): ",df(3.) == (1+jnp.log(3.))*f(3.))
print("Try grad of f on array: ", df(x))
</code></pre>
</section>

<section>
<h4 class="header">Jax basic - vmap</h4>
<pre><code data-trim data-noescape>
import jax.numpy as jnp
import jax

def f(x):
return x ** x

x = jnp.arange(1, 10.)
df = jax.vmap(jax.grad(f))
print("Try grad of f on array: ", df(x))
</code></pre>
</section>

<section>
<h4 class="header">Jax basic - jit</h4>
<pre><code data-trim data-noescape>
import jax.numpy as jnp
import jax

def f(x):
return x * x + 2 * x

x = jnp.ones((5000,5000))
fast_f = jax.jit(f)
print("Bechmarking f(x)...")
%timeit f(x)
print("Bechmarking fast_f(x)...")
%timeit fast_f(x)
</code></pre>
</section>

<section>
<h4 class="header">Jax basic - EZ GPU</h4>
<pre><code data-trim data-noescape>
import jax.numpy as jnp
import jax

def f(x):
return x * x + 2 * x

x = jnp.ones((5000,5000))
cpu_f = jax.jit(f, backend="cpu")
gpu_f = jax.jit(f, backend="gpu")

print("Bechmarking cpu_f(x)...")
%timeit cpu_f(x)

print("Bechmarking gpu_f(x)...")
%timeit gpu_f(x)
</code></pre>
</section>

0 comments on commit 5581a30

Please sign in to comment.