Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions lib/LinearSolveAutotune/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
FastLapackInterface = "29a986be-02c6-4525-aec4-84b980013641"
GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
LAPACK_jll = "51474c39-65e3-53ba-86ba-03b1b862ec14"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -36,6 +37,7 @@ CPUSummary = "0.2"
CUDA = "5"
DataFrames = "1"
Dates = "1"
FastLapackInterface = "2"
GitHub = "5"
LAPACK_jll = "3"
LinearAlgebra = "1"
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 @@ -36,6 +36,7 @@ using blis_jll
using LAPACK_jll
using CUDA
using Metal
using FastLapackInterface


# Optional dependencies for telemetry and plotting
Expand Down Expand Up @@ -156,7 +157,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 +181,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, includes FastLUFactorization in benchmarks

# Returns

Expand All @@ -199,6 +202,9 @@ 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
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
11 changes: 9 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, 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,12 @@ function get_available_algorithms(; skip_missing_algs::Bool = false)
push!(algs, SimpleLUFactorization())
push!(alg_names, "SimpleLUFactorization")

# FastLapackInterface LU if requested (always available as dependency)
if include_fastlapack
push!(algs, FastLUFactorization())
push!(alg_names, "FastLUFactorization")
end

return algs, alg_names
end

Expand Down
Loading