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
12 changes: 7 additions & 5 deletions lib/LinearSolveAutotune/src/benchmarking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ function categorize_results(df::DataFrame)

categories = Dict{String, String}()

# Define size ranges
# Define size ranges based on actual benchmark categories
# These align with the sizes defined in get_benchmark_sizes()
ranges = [
("0-128", 1:128),
("128-256", 129:256),
("256-512", 257:512),
("512+", 513:10000)
("tiny (5-20)", 5:20),
("small (20-100)", 21:100),
("medium (100-300)", 101:300),
("large (300-1000)", 301:1000),
("big (10000+)", 10000:typemax(Int))
]

# Get unique element types
Expand Down
24 changes: 22 additions & 2 deletions lib/LinearSolveAutotune/src/telemetry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function format_categories_markdown(categories::Dict{String, String})
eltype_categories = Dict{String, Dict{String, String}}()

for (key, algorithm) in categories
# Parse key like "Float64_0-128" -> eltype="Float64", range="0-128"
# Parse key like "Float64_tiny (5-20)" -> eltype="Float64", range="tiny (5-20)"
if contains(key, "_")
eltype, range = split(key, "_", limit=2)
if !haskey(eltype_categories, eltype)
Expand All @@ -208,14 +208,34 @@ function format_categories_markdown(categories::Dict{String, String})
end
end

# Define the proper order for size ranges
size_order = ["tiny (5-20)", "small (20-100)", "medium (100-300)", "large (300-1000)", "big (10000+)"]

# Custom sort function for ranges
function sort_ranges(ranges_dict)
sorted_pairs = []
for size in size_order
if haskey(ranges_dict, size)
push!(sorted_pairs, (size, ranges_dict[size]))
end
end
# Add any other ranges not in our predefined order (for backward compatibility)
for (range, algo) in ranges_dict
if !(range in size_order)
push!(sorted_pairs, (range, algo))
end
end
return sorted_pairs
end

# Format each element type
for (eltype, ranges) in sort(eltype_categories)
push!(lines, "#### Recommendations for $eltype")
push!(lines, "")
push!(lines, "| Size Range | Best Algorithm |")
push!(lines, "|------------|----------------|")

for (range, algorithm) in sort(ranges)
for (range, algorithm) in sort_ranges(ranges)
push!(lines, "| $range | $algorithm |")
end
push!(lines, "")
Expand Down
Loading