Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
CUSOLVERRF = "a8cc9031-bad2-4722-94f5-40deabb4245c"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e"
FastLapackInterface = "29a986be-02c6-4525-aec4-84b980013641"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
Expand Down
13 changes: 10 additions & 3 deletions lib/LinearSolveAutotune/src/LinearSolveAutotune.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ end
samples::Int = 5,
seconds::Float64 = 0.5,
eltypes = (Float32, Float64, ComplexF32, ComplexF64),
skip_missing_algs::Bool = false)
skip_missing_algs::Bool = false,
include_fastlapack::Bool = false)

Run a comprehensive benchmark of all available LU factorization methods and optionally:

Expand All @@ -179,6 +180,7 @@ Run a comprehensive benchmark of all available LU factorization methods and opti
- `seconds::Float64 = 0.5`: Maximum time per benchmark
- `eltypes = (Float32, Float64, ComplexF32, ComplexF64)`: Element types to benchmark
- `skip_missing_algs::Bool = false`: If false, error when expected algorithms are missing; if true, warn instead
- `include_fastlapack::Bool = false`: If true and FastLapackInterface.jl is loaded, includes FastLUFactorization in benchmarks

# Returns

Expand All @@ -199,6 +201,10 @@ results = autotune_setup(sizes = [:small, :medium, :large, :big])
# Large matrices only
results = autotune_setup(sizes = [:large, :big], samples = 10, seconds = 1.0)

# Include FastLapackInterface.jl algorithms if available
using FastLapackInterface
results = autotune_setup(include_fastlapack = true)

# After running autotune, share results (requires gh CLI or GitHub token)
share_results(results)
```
Expand All @@ -209,7 +215,8 @@ function autotune_setup(;
samples::Int = 5,
seconds::Float64 = 0.5,
eltypes = (Float64,),
skip_missing_algs::Bool = false)
skip_missing_algs::Bool = false,
include_fastlapack::Bool = false)
@info "Starting LinearSolve.jl autotune setup..."
@info "Configuration: sizes=$sizes, set_preferences=$set_preferences"
@info "Element types to benchmark: $(join(eltypes, ", "))"
Expand All @@ -219,7 +226,7 @@ function autotune_setup(;
@info "System detected: $(system_info["os"]) $(system_info["arch"]) with $(system_info["num_cores"]) cores"

# Get available algorithms
cpu_algs, cpu_names = get_available_algorithms(; skip_missing_algs = skip_missing_algs)
cpu_algs, cpu_names = get_available_algorithms(; skip_missing_algs = skip_missing_algs, include_fastlapack = include_fastlapack)
@info "Found $(length(cpu_algs)) CPU algorithms: $(join(cpu_names, ", "))"

# Add GPU algorithms if available
Expand Down
22 changes: 20 additions & 2 deletions lib/LinearSolveAutotune/src/algorithms.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Algorithm detection and creation functions

"""
get_available_algorithms(; skip_missing_algs::Bool = false)
get_available_algorithms(; skip_missing_algs::Bool = false, include_fastlapack::Bool = false)

Returns a list of available LU factorization algorithms based on the system and loaded packages.
If skip_missing_algs=false, errors when expected algorithms are missing; if true, warns instead.
If include_fastlapack=true and FastLapackInterface is loaded, includes FastLUFactorization in benchmarks.
"""
function get_available_algorithms(; skip_missing_algs::Bool = false)
function get_available_algorithms(; skip_missing_algs::Bool = false, include_fastlapack::Bool = false)
algs = []
alg_names = String[]

Expand Down Expand Up @@ -68,6 +69,23 @@ function get_available_algorithms(; skip_missing_algs::Bool = false)
push!(algs, SimpleLUFactorization())
push!(alg_names, "SimpleLUFactorization")

# FastLapackInterface LU if requested and available
if include_fastlapack
try
# Try to create a FastLUFactorization to see if the extension is loaded
test_alg = FastLUFactorization()
push!(algs, test_alg)
push!(alg_names, "FastLUFactorization")
@info "FastLUFactorization included in benchmarks"
catch e
if occursin("UndefVarError", string(e))
@warn "FastLUFactorization requested but FastLapackInterface.jl not loaded. Load it with: using FastLapackInterface"
else
@warn "FastLUFactorization requested but not available: $e"
end
end
end

return algs, alg_names
end

Expand Down
Loading