Skip to content

Commit 80d52d0

Browse files
Fix preferences section to show correct usage of autotuning results
- Remove incorrect preference setting example that doesn't exist in LinearSolve - Replace with actual code showing how to use specific algorithms - Explain that autotuning informs algorithm choice and internal heuristics - Show examples of directly using recommended algorithms from benchmarks - Mention future possibility of automatic preference setting
1 parent 67dd9fb commit 80d52d0

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

news/2025/08/16/linearsolve_autotuning.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,32 @@ For complex arithmetic, we found that specialized algorithms matter even more:
103103
- `LUFactorization` outperforms vendor libraries by **2x** for ComplexF32
104104
- Apple Accelerate struggles with complex numbers, making pure Julia implementations preferable
105105

106-
## Setting Preferences: Making It Permanent
106+
## Applying Your Results: Using the Optimal Algorithms
107107

108-
Once you've identified the best algorithms for your system, you can set them as defaults using Julia's Preferences system:
108+
Once you've identified the best algorithms for your system through autotuning, you can directly use them in your code:
109109

110110
```julia
111-
using LinearSolve, Preferences
112-
113-
# Set algorithm preferences based on autotuning results
114-
set_preferences!(
115-
"LinearSolve",
116-
"small_matrix_alg" => "RFLUFactorization",
117-
"medium_matrix_alg" => "AppleAccelerateLUFactorization",
118-
"large_matrix_alg" => "MetalLUFactorization"
119-
)
111+
using LinearSolve
112+
113+
# Based on your autotuning results, choose the appropriate algorithm
114+
A = rand(100, 100)
115+
b = rand(100)
116+
117+
# For small matrices on Apple Silicon (from autotuning)
118+
prob = LinearProblem(A, b)
119+
sol = solve(prob, RFLUFactorization())
120+
121+
# For larger matrices
122+
A_large = rand(1000, 1000)
123+
b_large = rand(1000)
124+
prob_large = LinearProblem(A_large, b_large)
125+
sol_large = solve(prob_large, AppleAccelerateLUFactorization())
126+
127+
# Or let LinearSolve choose based on its heuristics
128+
sol_auto = solve(prob) # Uses default algorithm selection
120129
```
121130

122-
These preferences are stored in your project's `LocalPreferences.toml` file and automatically applied whenever you use LinearSolve.jl.
131+
The autotuning results help inform LinearSolve.jl's internal heuristics, which are continuously improved based on community benchmark submissions. Future versions may support automatic preference setting based on your hardware configuration.
123132

124133
## Performance Visualization: A Picture Worth 1000 Benchmarks
125134

0 commit comments

Comments
 (0)