|
1 | | ---- |
2 | | -template: home.html |
3 | | -hide: |
4 | | - - navigation |
5 | | - - toc |
6 | | ---- |
7 | | - |
8 | | -<section class="sweep-features-3"> |
9 | | - <a class="sweep-features-3__card" href="user-guide/propagators/"> |
10 | | - <div class="sweep-features-3__tag">DIFFERENTIABLE</div> |
11 | | - <h3 class="sweep-features-3__title">Gradients all the way down.</h3> |
12 | | - <p class="sweep-features-3__desc"> |
13 | | - Every <code>PropTorch</code> call is an autograd node. <code>loss.backward()</code> populates <code>vp.grad</code> as an ordinary torch Tensor — feed it to any optimizer. |
14 | | - </p> |
15 | | - <span class="sweep-features-3__link">Learn more <span aria-hidden="true">→</span></span> |
16 | | - </a> |
17 | | - <a class="sweep-features-3__card" href="notebooks/12_multi_gpu/"> |
18 | | - <div class="sweep-features-3__tag">HPC · MULTI-GPU</div> |
19 | | - <h3 class="sweep-features-3__title">Scale across GPUs.</h3> |
20 | | - <p class="sweep-features-3__desc"> |
21 | | - Wrap the inversion in <code>torchrun --nproc_per_node=4</code> and shots distribute themselves. Marmousi FWI hits <strong>3.79×</strong> on 4 × V100. |
22 | | - </p> |
23 | | - <span class="sweep-features-3__link">Learn more <span aria-hidden="true">→</span></span> |
24 | | - </a> |
25 | | - <a class="sweep-features-3__card" href="api/"> |
26 | | - <div class="sweep-features-3__tag">PHYSICS ZOO</div> |
27 | | - <h3 class="sweep-features-3__title">Acoustic to TTI, 2D and 3D.</h3> |
28 | | - <p class="sweep-features-3__desc"> |
29 | | - 33 equation classes across nine families — Acoustic, Elastic, VTI, TTI, LSRTM-Born, DAS. PML and sponge boundaries. Same solver API for all of them. |
30 | | - </p> |
31 | | - <span class="sweep-features-3__link">Learn more <span aria-hidden="true">→</span></span> |
32 | | - </a> |
33 | | -</section> |
34 | | - |
35 | | -<section class="sweep-onefile" markdown> |
36 | | -<div class="sweep-onefile__inner" markdown> |
37 | | -<div class="sweep-onefile__eyebrow">MINIFILM · HELLO · FWI</div> |
38 | | -<h2 class="sweep-onefile__title">One file.<br><span class="sweep-onefile__dim">Forward → loss → backward.</span></h2> |
39 | | -<p class="sweep-onefile__lede">A two-layer truth, one shot, sixty-four receivers — and a single <code>.backward()</code> hands you the velocity gradient.</p> |
40 | | - |
41 | | -```python |
42 | | -import numpy as np, torch |
43 | | -from sweep.equations import Acoustic |
44 | | -from sweep.propagator.torch import PropTorch |
45 | | -from sweep.signal import ricker |
46 | | - |
47 | | -dev = torch.device('cuda' if torch.cuda.is_available() else 'cpu') |
48 | | -solver = PropTorch(Acoustic(device=dev), |
49 | | - shape=(96, 128), dh=10.0, dt=2e-3, dev=dev) |
50 | | - |
51 | | -wavelet = ricker(np.arange(600) * 2e-3 - 0.12, f=10.0).astype(np.float32) |
52 | | -sources = np.array([[64, 2]], dtype=np.int64) |
53 | | -receivers = np.array([[[ix, 4] for ix in range(0, 128, 2)]], dtype=np.int64) |
54 | | - |
55 | | -vp = torch.tensor(vp_init, device=dev, requires_grad=True) |
56 | | -pred = solver(wavelet, sources, receivers, models=[vp]) |
57 | | -loss = 0.5 * (pred - obs).pow(2).sum() |
58 | | -loss.backward() # vp.grad ready for any torch.optim step |
59 | | -``` |
60 | | - |
61 | | -<a class="sweep-cta sweep-cta--ghost-dark" href="notebooks/00_hello_fwi/">Open the notebook →</a> |
62 | | -</div> |
63 | | -</section> |
64 | | - |
65 | | -<section class="sweep-features-2"> |
66 | | - <div class="sweep-feature-card"> |
67 | | - <div class="sweep-feature-card__tag">EQUATIONS</div> |
68 | | - <h3 class="sweep-feature-card__title">Acoustic. Elastic.<br>VTI. TTI.</h3> |
69 | | - <p class="sweep-feature-card__desc"> |
70 | | - Nine equation classes, one solver API. Swap <code>Acoustic</code> for <code>ElasticTTI</code> without touching your inversion loop. |
71 | | - </p> |
72 | | - <code class="sweep-feature-card__code">from sweep.equations import ElasticTTI</code> |
73 | | - <div class="sweep-feature-card__fig"> |
74 | | - <img src="figures/landing/feature_equations.png" alt="Wavefield from elastic equation"> |
75 | | - </div> |
76 | | - </div> |
77 | | - <div class="sweep-feature-card"> |
78 | | - <div class="sweep-feature-card__tag">OPTIMIZER</div> |
79 | | - <h3 class="sweep-feature-card__title">Adam, L-BFGS, or write<br>your own.</h3> |
80 | | - <p class="sweep-feature-card__desc"> |
81 | | - Gradients are torch Tensors. <code>eps=1e-16</code> on Adam keeps tiny FWI gradients from getting masked. |
82 | | - </p> |
83 | | - <code class="sweep-feature-card__code">torch.optim.Adam([vp], lr=25.0, eps=1e-16)</code> |
84 | | - <div class="sweep-feature-card__fig"> |
85 | | - <img src="figures/landing/feature_optimizer.png" alt="vp gradient image"> |
86 | | - </div> |
87 | | - </div> |
88 | | -</section> |
89 | | - |
90 | | -<section class="sweep-nb"> |
91 | | - <div class="sweep-nb__hd"> |
92 | | - <div class="sweep-nb__eyebrow">EXAMPLES</div> |
93 | | - <h2 class="sweep-nb__title">Pre-baked notebooks.</h2> |
94 | | - <p class="sweep-nb__lede">Every cell already executed. Read in the browser, or download to run locally.</p> |
95 | | - </div> |
96 | | - |
97 | | - <div class="sweep-nb__grid"> |
98 | | - <a class="sweep-nb__featured" href="notebooks/01_fwi_acoustic_marmousi/"> |
99 | | - <div class="sweep-nb__featured-media"> |
100 | | - <img src="figures/gallery/01_fwi_acoustic_marmousi.png" alt="Marmousi FWI"> |
101 | | - </div> |
102 | | - <div class="sweep-nb__featured-body"> |
103 | | - <span class="sweep-nb__chip teal">BENCHMARK · ACOUSTIC</span> |
104 | | - <h4>Marmousi FWI</h4> |
105 | | - <p>3.5 km × 17 km Marmousi at 25 m grid. 20 shots, 200 receivers, 4 s record. Adam (lr=25, eps=1e-16) on the compiled CUDA backend.</p> |
106 | | - <div class="sweep-nb__stats"> |
107 | | - <div><span>RUNTIME</span><strong>6.8 s</strong></div> |
108 | | - <div><span>ITERS</span><strong>30</strong></div> |
109 | | - <div><span>LOSS</span><strong>17× drop</strong></div> |
110 | | - </div> |
111 | | - </div> |
112 | | - </a> |
113 | | - |
114 | | - <div class="sweep-nb__side"> |
115 | | - <a class="sweep-nb__small" href="notebooks/05_wavefield_vti/"> |
116 | | - <span class="sweep-nb__chip amber">VTI · FORWARD</span> |
117 | | - <h4>Diamond qP wavefront</h4> |
118 | | - <p>Duveneck Fig. 2: ε = 0.25, δ = 0 on a 193 × 193 grid. Three VTI parameterizations side-by-side.</p> |
119 | | - <div class="sweep-nb__small-media"> |
120 | | - <img src="figures/gallery/05_wavefield_vti.png" alt="VTI wavefield"> |
121 | | - </div> |
122 | | - </a> |
123 | | - |
124 | | - <a class="sweep-nb__cta" href="examples/"> |
125 | | - <div class="sweep-nb__cta-num">21 notebooks · 9 equations</div> |
126 | | - <div class="sweep-nb__cta-title">See every<br><span class="sweep-nb__cta-italic">example.</span></div> |
127 | | - <div class="sweep-nb__cta-tags"> |
128 | | - <span>FWI</span><span>RTM</span><span>LSRTM</span><span>Elastic</span><span>VTI</span><span>TTI</span><span>DAS</span><span>3D</span><span>Multi-GPU</span> |
129 | | - </div> |
130 | | - <div class="sweep-nb__cta-arrow">Browse all examples →</div> |
131 | | - </a> |
132 | | - </div> |
133 | | - </div> |
134 | | -</section> |
135 | | - |
136 | | -<section class="sweep-stack"> |
137 | | -<div class="sweep-stack__eyebrow">THE STACK</div> |
138 | | -<h2 class="sweep-stack__title">Built on what you already trust.</h2> |
139 | | -<p class="sweep-stack__lede">Lazy imports — only the backend you actually use is loaded.</p> |
140 | | -<div class="sweep-stack__grid"> |
141 | | - <div class="sweep-stack__card"> |
142 | | - <div class="sweep-stack__head"><span class="sweep-stack__dot" style="background:#1AA690"></span><span class="sweep-stack__role">PRIMARY</span></div> |
143 | | - <div class="sweep-stack__name">PyTorch</div> |
144 | | - <div class="sweep-stack__version">≥ 2.1</div> |
145 | | - <div class="sweep-stack__desc">Default training backend. CUDA + CPU + MPS.</div> |
146 | | - </div> |
147 | | - <div class="sweep-stack__card"> |
148 | | - <div class="sweep-stack__head"><span class="sweep-stack__dot sweep-stack__dot--tri" style="border-bottom-color:#BCC83C"></span><span class="sweep-stack__role">PRIMARY</span></div> |
149 | | - <div class="sweep-stack__name">JAX</div> |
150 | | - <div class="sweep-stack__version">≥ 0.4.20</div> |
151 | | - <div class="sweep-stack__desc">Functional autograd, jit, vmap.</div> |
152 | | - </div> |
153 | | - <div class="sweep-stack__card"> |
154 | | - <div class="sweep-stack__head"><span class="sweep-stack__dot sweep-stack__dot--sq" style="background:#ED8B2E"></span><span class="sweep-stack__role">GPU</span></div> |
155 | | - <div class="sweep-stack__name">CUDA</div> |
156 | | - <div class="sweep-stack__version">11 / 12</div> |
157 | | - <div class="sweep-stack__desc">NVIDIA V100, A100, L40S, RTX 6000 Ada.</div> |
158 | | - </div> |
159 | | - <div class="sweep-stack__card"> |
160 | | - <div class="sweep-stack__head"><span class="sweep-stack__dot" style="background:#1AA690"></span><span class="sweep-stack__role">ALWAYS-ON</span></div> |
161 | | - <div class="sweep-stack__name">NumPy</div> |
162 | | - <div class="sweep-stack__version">≥ 1.26</div> |
163 | | - <div class="sweep-stack__desc">Numerical interop, IO.</div> |
164 | | - </div> |
| 1 | +# sweep-solver |
| 2 | + |
| 3 | +The differentiable, GPU **wave-equation engine** at the core of the sweep |
| 4 | +ecosystem — forward modelling, RTM, and FWI / LSRTM, with equations for |
| 5 | +acoustic, elastic, VTI/TTI, VRZ and spectral-element (SEM) physics, and |
| 6 | +torch / JAX / native-CUDA backends. |
| 7 | + |
| 8 | +Installed with `pip install sweepx` (or `pip install sweep-solver`) → `import sweep`. |
| 9 | + |
| 10 | +<div class="grid cards" markdown> |
| 11 | + |
| 12 | +- :material-rocket-launch-outline: __[Getting started](getting-started/installation.md)__ |
| 13 | + |
| 14 | + --- |
| 15 | + |
| 16 | + Install, run your first forward model, take your first gradient. |
| 17 | + |
| 18 | +- :material-book-open-variant-outline: __[User guide](user-guide/equations.md)__ |
| 19 | + |
| 20 | + --- |
| 21 | + |
| 22 | + Equations, propagators, backends, boundary-saving, memory options. |
| 23 | + |
| 24 | +- :material-notebook-outline: __[Examples](examples/index.md)__ |
| 25 | + |
| 26 | + --- |
| 27 | + |
| 28 | + Runnable notebooks — modelling, wavefields, FWI, RTM. |
| 29 | + |
| 30 | +- :material-api: __[API reference](api/index.md)__ |
| 31 | + |
| 32 | + --- |
| 33 | + |
| 34 | + Every equation, propagator, and operator, documented from source. |
| 35 | + |
165 | 36 | </div> |
166 | | -</section> |
0 commit comments