@@ -31,43 +31,49 @@ include("preferences.jl")
3131 make_plot::Bool = true,
3232 set_preferences::Bool = true,
3333 samples::Int = 5,
34- seconds::Float64 = 0.5)
34+ seconds::Float64 = 0.5,
35+ eltypes = (Float32, Float64, ComplexF32, ComplexF64))
3536
3637Run a comprehensive benchmark of all available LU factorization methods and optionally:
3738
38- - Create performance plots
39- - Upload results to GitHub telemetry
39+ - Create performance plots for each element type
40+ - Upload results to GitHub telemetry
4041 - Set Preferences for optimal algorithm selection
4142 - Support both CPU and GPU algorithms based on hardware detection
43+ - Test algorithm compatibility with different element types
4244
4345# Arguments
4446
4547 - `large_matrices::Bool = false`: Include larger matrix sizes for GPU benchmarking
4648 - `telemetry::Bool = true`: Share results to GitHub issue for community data
47- - `make_plot::Bool = true`: Generate performance plots
49+ - `make_plot::Bool = true`: Generate performance plots for each element type
4850 - `set_preferences::Bool = true`: Update LinearSolve preferences with optimal algorithms
4951 - `samples::Int = 5`: Number of benchmark samples per algorithm/size
5052 - `seconds::Float64 = 0.5`: Maximum time per benchmark
53+ - `eltypes = (Float32, Float64, ComplexF32, ComplexF64)`: Element types to benchmark
5154
5255# Returns
5356
54- - `DataFrame`: Detailed benchmark results with performance data
55- - `Plot`: Performance visualization (if `make_plot=true`)
57+ - `DataFrame`: Detailed benchmark results with performance data for all element types
58+ - `Dict` or ` Plot`: Performance visualizations by element type (if `make_plot=true`)
5659
5760# Examples
5861
5962```julia
6063using LinearSolve
6164using LinearSolveAutotune
6265
63- # Basic autotune with default settings
66+ # Basic autotune with default settings (4 element types)
6467results = autotune_setup()
6568
6669# Custom autotune for GPU systems with larger matrices
6770results = autotune_setup(large_matrices = true, samples = 10, seconds = 1.0)
6871
69- # Autotune without telemetry sharing
70- results = autotune_setup(telemetry = false)
72+ # Autotune with only Float64 and ComplexF64
73+ results = autotune_setup(eltypes = (Float64, ComplexF64))
74+
75+ # Test with BigFloat (note: most BLAS algorithms will be excluded)
76+ results = autotune_setup(eltypes = (BigFloat,), telemetry = false)
7177```
7278"""
7379function autotune_setup (;
@@ -76,9 +82,11 @@ function autotune_setup(;
7682 make_plot:: Bool = true ,
7783 set_preferences:: Bool = true ,
7884 samples:: Int = 5 ,
79- seconds:: Float64 = 0.5 )
85+ seconds:: Float64 = 0.5 ,
86+ eltypes = (Float32, Float64, ComplexF32, ComplexF64))
8087 @info " Starting LinearSolve.jl autotune setup..."
8188 @info " Configuration: large_matrices=$large_matrices , telemetry=$telemetry , make_plot=$make_plot , set_preferences=$set_preferences "
89+ @info " Element types to benchmark: $(join (eltypes, " , " )) "
8290
8391 # Get system information
8492 system_info = get_system_info ()
@@ -108,7 +116,7 @@ function autotune_setup(;
108116
109117 # Run benchmarks
110118 @info " Running benchmarks (this may take several minutes)..."
111- results_df = benchmark_algorithms (sizes, all_algs, all_names;
119+ results_df = benchmark_algorithms (sizes, all_algs, all_names, eltypes ;
112120 samples = samples, seconds = seconds, large_matrices = large_matrices)
113121
114122 # Display results table
@@ -143,14 +151,14 @@ function autotune_setup(;
143151 set_algorithm_preferences (categories)
144152 end
145153
146- # Create plot if requested
147- plot_obj = nothing
154+ # Create plots if requested
155+ plots_dict = nothing
148156 plot_files = nothing
149157 if make_plot
150158 @info " Creating performance plots..."
151- plot_obj = create_benchmark_plot (results_df)
152- if plot_obj != = nothing
153- plot_files = save_benchmark_plot (plot_obj )
159+ plots_dict = create_benchmark_plots (results_df)
160+ if ! isempty (plots_dict)
161+ plot_files = save_benchmark_plots (plots_dict )
154162 end
155163 end
156164
@@ -163,9 +171,9 @@ function autotune_setup(;
163171
164172 @info " Autotune setup completed!"
165173
166- # Return results and plot
167- if make_plot && plot_obj != = nothing
168- return results_df, plot_obj
174+ # Return results and plots
175+ if make_plot && plots_dict != = nothing && ! isempty (plots_dict)
176+ return results_df, plots_dict
169177 else
170178 return results_df
171179 end
0 commit comments