diff --git a/.nojekyll b/.nojekyll index 23242d7..277d949 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -2721a612 \ No newline at end of file +5bf69be5 \ No newline at end of file diff --git a/marseille2024/assets/FastPM_Init.gif b/marseille2024/assets/FastPM_Init.gif new file mode 100644 index 0000000..40f08d0 Binary files /dev/null and b/marseille2024/assets/FastPM_Init.gif differ diff --git a/marseille2024/assets/FastPM_LPT.gif b/marseille2024/assets/FastPM_LPT.gif new file mode 100644 index 0000000..00defe4 Binary files /dev/null and b/marseille2024/assets/FastPM_LPT.gif differ diff --git a/marseille2024/assets/FastPM_ODE.gif b/marseille2024/assets/FastPM_ODE.gif new file mode 100644 index 0000000..ab49d3b Binary files /dev/null and b/marseille2024/assets/FastPM_ODE.gif differ diff --git a/marseille2024/assets/FastPM_ODE3D.gif b/marseille2024/assets/FastPM_ODE3D.gif new file mode 100644 index 0000000..c6588fa Binary files /dev/null and b/marseille2024/assets/FastPM_ODE3D.gif differ diff --git a/marseille2024/assets/JaxLogo.png b/marseille2024/assets/JaxLogo.png new file mode 100644 index 0000000..b99535d Binary files /dev/null and b/marseille2024/assets/JaxLogo.png differ diff --git a/marseille2024/assets/github_logo.png b/marseille2024/assets/github_logo.png new file mode 100644 index 0000000..506690e Binary files /dev/null and b/marseille2024/assets/github_logo.png differ diff --git a/marseille2024/index.html b/marseille2024/index.html index ad98257..6dcafe1 100644 --- a/marseille2024/index.html +++ b/marseille2024/index.html @@ -29,6 +29,71 @@ margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ vertical-align: middle; } + /* CSS for syntax highlighting */ + pre > code.sourceCode { white-space: pre; position: relative; } + pre > code.sourceCode > span { line-height: 1.25; } + pre > code.sourceCode > span:empty { height: 1.2em; } + .sourceCode { overflow: visible; } + code.sourceCode > span { color: inherit; text-decoration: inherit; } + div.sourceCode { margin: 1em 0; } + pre.sourceCode { margin: 0; } + @media screen { + div.sourceCode { overflow: auto; } + } + @media print { + pre > code.sourceCode { white-space: pre-wrap; } + pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } + } + pre.numberSource code + { counter-reset: source-line 0; } + pre.numberSource code > span + { position: relative; left: -4em; counter-increment: source-line; } + pre.numberSource code > span > a:first-child::before + { content: counter(source-line); + position: relative; left: -1em; text-align: right; vertical-align: baseline; + border: none; display: inline-block; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; + } + pre.numberSource { margin-left: 3em; padding-left: 4px; } + div.sourceCode + { color: #f8f8f2; } + @media screen { + pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } + } + code span { color: #f8f8f2; } /* Normal */ + code span.al { color: #f07178; background-color: #2a0f15; font-weight: bold; } /* Alert */ + code span.an { color: #d4d0ab; } /* Annotation */ + code span.at { color: #00e0e0; } /* Attribute */ + code span.bn { color: #d4d0ab; } /* BaseN */ + code span.bu { color: #abe338; } /* BuiltIn */ + code span.cf { color: #ffa07a; font-weight: bold; } /* ControlFlow */ + code span.ch { color: #abe338; } /* Char */ + code span.cn { color: #ffd700; } /* Constant */ + code span.co { color: #f8f8f2; font-style: italic; } /* Comment */ + code span.cv { color: #ffd700; } /* CommentVar */ + code span.do { color: #f8f8f2; } /* Documentation */ + code span.dt { color: #ffa07a; } /* DataType */ + code span.dv { color: #d4d0ab; } /* DecVal */ + code span.er { color: #f07178; text-decoration: underline; } /* Error */ + code span.ex { color: #00e0e0; font-weight: bold; } /* Extension */ + code span.fl { color: #d4d0ab; } /* Float */ + code span.fu { color: #ffa07a; } /* Function */ + code span.im { color: #abe338; } /* Import */ + code span.in { color: #d4d0ab; } /* Information */ + code span.kw { color: #ffa07a; font-weight: bold; } /* Keyword */ + code span.op { color: #ffa07a; } /* Operator */ + code span.ot { color: #00e0e0; } /* Other */ + code span.pp { color: #dcc6e0; } /* Preprocessor */ + code span.re { color: #00e0e0; background-color: #f8f8f2; } /* RegionMarker */ + code span.sc { color: #abe338; } /* SpecialChar */ + code span.ss { color: #abe338; } /* SpecialString */ + code span.st { color: #abe338; } /* String */ + code span.va { color: #00e0e0; } /* Variable */ + code span.vs { color: #abe338; } /* VerbatimString */ + code span.wa { color: #dcc6e0; } /* Warning */ @@ -430,94 +495,325 @@
Cloud in cell interpolation
+\(\begin{array}{c}{{\nabla^{2}\phi=-4\pi G\rho}}\\\\ {{f(\vec{k})=i\vec{k}k^{-2}\rho(\vec{k})}}\end{array}\)
+ +\(\begin{array}{c}{{\nabla^{2}\phi=-4\pi G\rho}}\\\\ {{f(\vec{k})=i\vec{k}k^{-2}\rho(\vec{k})}}\end{array}\)
\(\begin{array}{c}{{\nabla^{2}\phi=-4\pi G\rho}}\\\\ {{f(\vec{k})=i\vec{k}k^{-2}\rho(\vec{k})}}\end{array}\)
-
example of numpy code and grad
+
import numpy as np
+
+
+def multiply_and_add(a, b, c):
+ return np.dot(a, b) + c
+
+
+a, b, c = np.random.normal(size=(3, 32, 32))
+result = multiply_and_add(a, b, c)
import jax
+import jax.numpy as jnp
+
+@jax.jit
+def multiply_and_add(a, b, c):
+ return jnp.dot(a, b) + c
+
+
+key = jax.random.PRNGKey(0)
+a, b, c = jax.random.normal(key, (3, 32, 32))
+
+result = multiply_and_add(a, b, c)
+gradient = jax.grad(multiply_and_add)(a, b, c)
JAX : Numpy + Autograd + GPU
+example of JAXPM code
++ DifferentiableUniverseInitiative/JaxPM +
+mesh_shape = [64, 64, 64]
+box_size = [64., 64., 64.]
+snapshots = jnp.linspace(0.1, 1., 2)
+
+@jax.jit
+def run_simulation(omega_c, sigma8):
+ # Create a small function to generate the matter power spectrum
+ k = jnp.logspace(-4, 1, 128)
+ pk = jc.power.linear_matter_power(
+ jc.Planck15(Omega_c=omega_c, sigma8=sigma8), k)
+ pk_fn = lambda x: jc.scipy.interpolate.interp(x.reshape([-1]), k, pk
+ ).reshape(x.shape)
+
+ # Create initial conditions
+ initial_conditions = linear_field(mesh_shape,
+ box_size,
+ pk_fn,
+ seed=jax.random.PRNGKey(0))
+
+ # Create particles
+ particles = jnp.stack(jnp.meshgrid(*[jnp.arange(s) for s in mesh_shape]),
+ axis=-1).reshape([-1, 3])
+
+ cosmo = jc.Planck15(Omega_c=omega_c, sigma8=sigma8)
+
+ # Initial displacement
+ dx, p, f = lpt(cosmo, initial_conditions, particles, 0.1)
+ field = dx + particles
+
+ # Evolve the simulation forward
+ res = odeint(make_ode_fn(mesh_shape), [particles + dx, p],
+ snapshots,
+ cosmo,
+ rtol=1e-5,
+ atol=1e-5)
+
+ # Return the simulation volume at requested
+ return field, res, initial_conditions
+
+field, res, initial_conditions = run_simulation(0.25, 0.8)
Is everything solved ?
+➢ (Poqueres et al. 2021) : \(64^3\) mesh size, on a 1000 Mpc/h box
+➢ (Li et al. 2022) : \(512^3\) mesh size, on a 1000 Mpc/h box using pmwd
+512 image
+256 image
+128 image
+64 image
+512 PowerSpec
+256 PowerSpec
+128 PowerSpec
+64 PowerSpec
+512 image
+256 image
+128 image
+64 image
+512 image
+256 image
+128 image
+64 image
+Scaling
+We need a fast, differentiable and distributed Particle-Mesh simulation
+::: {fragment .fragment-index-1}
+image of vector field
+:::
+::: {fragment .fragment-index-2}
plot of GPUs memory per architecture
+plot of data size per simulation
+::::
+::: {fragment .fragment-index-3}
Single GPU 80 GB
+Single Node 8x80 GB
+Multi node infinite
+::::
➢ only operation that requires communication is the FFT
++ DifferentiableUniverseInitiative/jaxDecomp +
+add animation of the decomposition
+add plots of scallig
+jaxDecomp is also provided as a standalone library
+Rubin observatory will provide 18,000 square degrees, observed once every few days (few TBs of data per night)
-say that we need to make a cube of big part of the volume of the survey.
-High end GPUs have a reached 80 GBs A100 next generation H100
+➢ Built on top of jaxDecomp
+➢ Supports diffirentiable multi-host (multi-node) simulations
+image of 4000 mparsec box
+only operation that requires communication is the FFT
-we can also run multiple devices in a single controlle set up
-80 w=x 80
-Differentiable multi host distributed n body simulation that runs on GPUs
-Related work
-FastPM Poqueres nbody 64^3 pmwd 512^3
+built on top of JAXDECOMP
-example code of JAXPM
-Three steps
-Generate the linear field
-then LPT simulation
-then the final nbody simulation (use any differential equation solver like diffrax)
-Finally we put the final grid back to the particles
+➢
Unique solutions : no, two particles crossing each other yoy can’t tell which one is which
+image of with and without halo exchange