Skip to content

Commit 4e58631

Browse files
Add CPUSummary.jl integration and final UI improvements
- Added CPUSummary.jl dependency for better system info - Exported plot function for AutotuneResults - Reordered display output: comprehensive first, community second, share last - Updated system info gathering to use CPUSummary functions - Enhanced OS and thread information display
1 parent d23f97e commit 4e58631

File tree

3 files changed

+39
-21
lines changed

3 files changed

+39
-21
lines changed

lib/LinearSolveAutotune/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ version = "1.0.0"
77
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
88
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
99
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
10+
CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
1011
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
1112
GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
1213
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
@@ -29,6 +30,7 @@ Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
2930
LinearSolve = "3"
3031
BenchmarkTools = "1"
3132
Base64 = "1"
33+
CPUSummary = "0.2"
3234
DataFrames = "1"
3335
GitHub = "5"
3436
Plots = "1"

lib/LinearSolveAutotune/src/LinearSolveAutotune.jl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ using Printf
1212
using Dates
1313
using Base64
1414
using ProgressMeter
15+
using CPUSummary
1516

1617
# Hard dependency to ensure RFLUFactorization others solvers are available
1718
using RecursiveFactorization
@@ -25,7 +26,7 @@ using Metal
2526
using GitHub
2627
using Plots
2728

28-
export autotune_setup, share_results, AutotuneResults
29+
export autotune_setup, share_results, AutotuneResults, plot
2930

3031
include("algorithms.jl")
3132
include("gpu_detection.jl")
@@ -46,12 +47,12 @@ function Base.show(io::IO, results::AutotuneResults)
4647
println(io, "LinearSolve.jl Autotune Results")
4748
println(io, "="^60)
4849

49-
# System info summary
50+
# System info summary using CPUSummary
5051
println(io, "\n📊 System Information:")
5152
println(io, " • CPU: ", get(results.sysinfo, "cpu_name", "Unknown"))
52-
println(io, " • OS: ", get(results.sysinfo, "os", "Unknown"))
53+
println(io, " • OS: ", CPUSummary.os_name(), " (", get(results.sysinfo, "os", "Unknown"), ")")
5354
println(io, " • Julia: ", get(results.sysinfo, "julia_version", "Unknown"))
54-
println(io, " • Threads: ", get(results.sysinfo, "num_threads", "Unknown"))
55+
println(io, " • Threads: ", CPUSummary.num_threads(), " (BLAS: ", CPUSummary.blas_num_threads(), ")")
5556

5657
# Results summary
5758
successful_results = filter(row -> row.success, results.results_df)
@@ -79,17 +80,17 @@ function Base.show(io::IO, results::AutotuneResults)
7980
println(io, "📏 Matrix Sizes: ", minimum(sizes), "×", minimum(sizes),
8081
" to ", maximum(sizes), "×", maximum(sizes))
8182

82-
# Call to action
83+
# Call to action - reordered
8384
println(io, "\n" * "="^60)
84-
println(io, "💡 To share your results with the community, run:")
85-
println(io, " share_results(results)")
86-
println(io, "\n📈 See community results at:")
87-
println(io, " https://github.com/SciML/LinearSolve.jl/issues/669")
88-
println(io, "\n🚀 For comprehensive results, consider running:")
85+
println(io, "🚀 For comprehensive results, consider running:")
8986
println(io, " results_full = autotune_setup(")
9087
println(io, " sizes = [:tiny, :small, :medium, :large, :big],")
9188
println(io, " eltypes = (Float32, Float64, ComplexF32, ComplexF64)")
9289
println(io, " )")
90+
println(io, "\n📈 See community results at:")
91+
println(io, " https://github.com/SciML/LinearSolve.jl/issues/669")
92+
println(io, "\n💡 To share your results with the community, run:")
93+
println(io, " share_results(results)")
9394
println(io, "="^60)
9495
end
9596

lib/LinearSolveAutotune/src/gpu_detection.jl

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# GPU hardware and package detection
22

3+
using CPUSummary
4+
35
"""
46
is_cuda_available()
57
@@ -76,10 +78,13 @@ function get_system_info()
7678

7779
info["julia_version"] = string(VERSION)
7880
info["os"] = string(Sys.KERNEL)
81+
info["os_name"] = CPUSummary.os_name()
7982
info["arch"] = string(Sys.ARCH)
80-
info["cpu_name"] = Sys.cpu_info()[1].model
81-
info["num_cores"] = Sys.CPU_THREADS
82-
info["num_threads"] = Threads.nthreads()
83+
info["cpu_name"] = CPUSummary.cpu_name()
84+
info["num_cores"] = CPUSummary.num_physical_cores()
85+
info["num_logical_cores"] = CPUSummary.num_logical_cores()
86+
info["num_threads"] = CPUSummary.num_threads()
87+
info["blas_num_threads"] = CPUSummary.blas_num_threads()
8388
info["blas_vendor"] = string(LinearAlgebra.BLAS.vendor())
8489
info["has_cuda"] = is_cuda_available()
8590
info["has_metal"] = is_metal_available()
@@ -147,13 +152,19 @@ function get_detailed_system_info()
147152
end
148153

149154
try
150-
system_data["cpu_cores"] = Sys.CPU_THREADS
155+
system_data["cpu_cores"] = CPUSummary.num_physical_cores()
151156
catch
152157
system_data["cpu_cores"] = "unknown"
153158
end
154159

155160
try
156-
system_data["julia_threads"] = Threads.nthreads()
161+
system_data["cpu_logical_cores"] = CPUSummary.num_logical_cores()
162+
catch
163+
system_data["cpu_logical_cores"] = "unknown"
164+
end
165+
166+
try
167+
system_data["julia_threads"] = CPUSummary.num_threads()
157168
catch
158169
system_data["julia_threads"] = "unknown"
159170
end
@@ -170,14 +181,18 @@ function get_detailed_system_info()
170181
system_data["machine"] = "unknown"
171182
end
172183

173-
# CPU details
184+
# CPU details using CPUSummary
174185
try
175-
cpu_info = Sys.cpu_info()[1]
176-
system_data["cpu_name"] = cpu_info.model
177-
system_data["cpu_speed_mhz"] = cpu_info.speed
186+
system_data["cpu_name"] = CPUSummary.cpu_name()
178187
catch
179188
system_data["cpu_name"] = "unknown"
180-
system_data["cpu_speed_mhz"] = "unknown"
189+
end
190+
191+
try
192+
# CPUSummary provides more detailed info
193+
system_data["cpu_architecture"] = CPUSummary.cpu_architecture()
194+
catch
195+
system_data["cpu_architecture"] = "unknown"
181196
end
182197

183198
# Categorize CPU vendor for easy analysis
@@ -212,7 +227,7 @@ function get_detailed_system_info()
212227
end
213228

214229
try
215-
system_data["blas_num_threads"] = LinearAlgebra.BLAS.get_num_threads()
230+
system_data["blas_num_threads"] = CPUSummary.blas_num_threads()
216231
catch
217232
system_data["blas_num_threads"] = "unknown"
218233
end

0 commit comments

Comments
 (0)