Skip to content

Commit d79442d

Browse files
committed
docs: finalize GPU documentation and enable draft mode
- Condense GPU options section for better readability - Fix println statements to display both GPU and CPU option values - Remove unnecessary Draft meta blocks - Enable draft mode to execute @example blocks in documentation - Add comments clarifying CPU defaults are equivalent to explicit {CPU} types
1 parent 0e9898b commit d79442d

2 files changed

Lines changed: 12 additions & 37 deletions

File tree

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ cp(
153153
Draft = false
154154
```
155155
=#
156-
draft = true # Draft mode: if true, @example blocks in markdown are not executed
156+
draft = false # Draft mode: if true, @example blocks in markdown are not executed
157157

158158
# ═══════════════════════════════════════════════════════════════════════════════
159159
# Load extensions

docs/src/manual-solve-gpu.md

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# [Solve on GPU](@id manual-solve-gpu)
22

3-
4-
```@meta
5-
Draft = false
6-
```
7-
83
This manual explains how to solve optimal control problems on GPU using the [`solve`](@ref) function. GPU acceleration is available through [ExaModels.jl](https://exanauts.github.io/ExaModels.jl/stable) and [MadNLPGPU.jl](https://github.com/MadNLP/MadNLP.jl), with current support for NVIDIA GPUs via [CUDA.jl](https://github.com/JuliaGPU/CUDA.jl).
94

105
For basic CPU solving, see [Solve a problem](@ref manual-solve).
@@ -72,44 +67,25 @@ sol = solve(ocp, :gpu; grid_size=100, print_level=MadNLP.ERROR)
7267

7368
### What the `:gpu` token does
7469

75-
The `:gpu` parameter token automatically selects GPU-optimized defaults:
76-
77-
**For `Exa` modeler:**
70+
The `:gpu` parameter automatically selects GPU-optimized defaults:
7871

79-
- Sets `backend` to CUDA backend
80-
- Enables GPU-optimized automatic differentiation
81-
82-
**For `MadNLP` solver:**
83-
84-
- Sets `linear_solver` to `MadNLPGPU.CUDSSSolver` (instead of `MadNLP.MumpsSolver`)
85-
- Configures GPU-specific solver options
86-
87-
You can inspect these defaults:
72+
- **Exa modeler**: CUDA backend + GPU-optimized automatic differentiation
73+
- **MadNLP solver**: `CUDSSSolver` linear solver (instead of `MumpsSolver`)
8874

8975
```@example gpu
76+
# GPU defaults
9077
modeler = OptimalControl.Exa{GPU}()
91-
opts = options(modeler)
92-
opts[:backend]
93-
```
94-
95-
```@example gpu
9678
solver = OptimalControl.MadNLP{GPU}()
97-
opts = options(solver)
98-
opts[:linear_solver]
79+
println("Exa{GPU} backend: ", options(modeler)[:backend])
80+
println("MadNLP{GPU} linear_solver: ", options(solver)[:linear_solver])
9981
```
10082

101-
Compare with CPU defaults:
102-
10383
```@example gpu
104-
modeler = OptimalControl.Exa{CPU}()
105-
opts = options(modeler)
106-
opts[:backend]
107-
```
108-
109-
```@example gpu
110-
solver = OptimalControl.MadNLP{CPU}()
111-
opts = options(solver)
112-
opts[:linear_solver]
84+
# CPU defaults (default parameter)
85+
modeler = OptimalControl.Exa() # equivalent to OptimalControl.Exa{CPU}()
86+
solver = OptimalControl.MadNLP() # equivalent to OptimalControl.MadNLP{CPU}()
87+
println("Exa{CPU} backend: ", options(modeler)[:backend])
88+
println("MadNLP{CPU} linear_solver: ", options(solver)[:linear_solver])
11389
```
11490

11591
## Explicit mode with parameterized types
@@ -122,7 +98,6 @@ mod = OptimalControl.Exa{GPU}()
12298
sol = OptimalControl.MadNLP{GPU}(print_level=MadNLP.ERROR)
12399

124100
result = solve(ocp; discretizer=disc, modeler=mod, solver=sol)
125-
nothing # hide
126101
```
127102

128103
This gives you:

0 commit comments

Comments
 (0)