Skip to content

Commit

Permalink
bump minimum compatibility to the current LTS (1.10) (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk authored Jan 29, 2025
1 parent 7aaa4ac commit 199316c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 49 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
matrix:
version:
- '1' # current stable
- '1.10' # minimum compat
- 'nightly'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
BenchmarkTools = "1.4"
StableRNGs = "1"
julia = "1.6"
julia = "1.10"

[extras]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
2 changes: 1 addition & 1 deletion src/BaseBenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const MODULES = Dict("array" => :ArrayBenchmarks,
"string" => :StringBenchmarks,
"tuple" => :TupleBenchmarks,
"frontend" => :FrontendBenchmarks,
"inference" => :InferenceBenchmarks,
)
@static VERSION v"1.8-DEV" && push!(MODULES, "inference" => :InferenceBenchmarks)

load!(id::AbstractString; kwargs...) = load!(SUITE, id; kwargs...)

Expand Down
2 changes: 1 addition & 1 deletion src/collection/CollectionBenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ for T in (Nothing, Bool, Int8, UInt16)
if T === Nothing
g["Vector", "abstract", tstr] = @benchmarkable Vector($v)
g["Vector", "concrete", tstr] = @benchmarkable Vector{$T}($v)
elseif T !== Bool && (!(T <: Unsigned) || VERSION >= v"0.7.0-")
elseif T !== Bool && !(T <: Unsigned)
# there is a bug on 0.6, will probably get fixed on v6.2, cf. #24365
g["BitSet", tstr] = @benchmarkable BitSet($v)
end
Expand Down
53 changes: 12 additions & 41 deletions src/inference/InferenceBenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,10 @@ CC.cache_owner(wvc::InferenceBenchmarker) = wvc.code_cache
end

function inf_gf_by_type!(interp::InferenceBenchmarker, @nospecialize(tt::Type{<:Tuple}); kwargs...)
match = _which(tt; world=get_inference_world(interp))
match = Base._which(tt; world=get_inference_world(interp))
return inf_method_signature!(interp, match.method, match.spec_types, match.sparams; kwargs...)
end

@static if VERSION v"1.10.0-DEV.96"
using Base: _which
else
function _which(@nospecialize(tt::Type);
method_table::Union{Nothing,MethodTable,CC.MethodTableView}=nothing,
world::UInt=get_world_counter(),
raise::Bool=false)
if method_table === nothing
table = CC.InternalMethodTable(world)
elseif isa(method_table, MethodTable)
table = CC.OverlayMethodTable(world, method_table)
else
table = method_table
end
match, = CC.findsup(tt, table)
if match === nothing
raise && error("no unique matching method found for the specified argument types")
return nothing
end
return match
end
end

inf_method!(interp::InferenceBenchmarker, m::Method; kwargs...) =
inf_method_signature!(interp, m, m.sig, method_sparams(m); kwargs...)
function method_sparams(m::Method)
Expand Down Expand Up @@ -178,23 +155,17 @@ function opt_call(@nospecialize(f), @nospecialize(types = Base.default_tt(f));
evals = 0
return function ()
@assert (evals += 1) <= 1
## `optimize` may modify these objects, so need to stash the pre-optimization states, if we want to allow multiple evals
#src, stmt_info, slottypes, ssavalue_uses = copy(frame.src), copy(frame.stmt_info), copy(frame.slottypes), copy(frame.ssavalue_uses)
#cfg = @static hasfield(InferenceState, :cfg) ? copy(frame.cfg) : nothing
#unreachable = @static hasfield(InferenceState, :unreachable) ? copy(frame.unreachable) : nothing
#bb_vartables = @static hasfield(InferenceState, :bb_vartables) ? copy(frame.bb_vartables) : nothing
@static if !hasfield(CC.InliningState, :params)
opt = OptimizationState(frame, interp)
CC.optimize(interp, opt, frame.result)
else
params = OptimizationParams(interp)
opt = OptimizationState(frame, params, interp)
CC.optimize(interp, opt, params, frame.result)
end
#frame.src, frame.stmt_info, frame.slottypes, frame.ssavalue_uses = src, stmt_info, slottypes, ssavalue_uses
#cfg === nothing || (frame.cfg = cfg)
#unreachable === nothing || (frame.unreachable = unreachable)
#bb_vartables === nothing || (frame.bb_vartables = bb_vartables)
# # `optimize` may modify these objects, so need to stash the pre-optimization states, if we want to allow multiple evals
# src, stmt_info, slottypes, ssavalue_uses = copy(frame.src), copy(frame.stmt_info), copy(frame.slottypes), copy(frame.ssavalue_uses)
# cfg = copy(frame.cfg)
# unreachable = @static hasfield(InferenceState, :unreachable) ? copy(frame.unreachable) : nothing
# bb_vartables = @static hasfield(InferenceState, :bb_vartables) ? copy(frame.bb_vartables) : nothing
opt = OptimizationState(frame, interp)
CC.optimize(interp, opt, frame.result)
# frame.src, frame.stmt_info, frame.slottypes, frame.ssavalue_uses = src, stmt_info, slottypes, ssavalue_uses
# cfg === nothing || (frame.cfg = cfg)
# unreachable === nothing || (frame.unreachable = unreachable)
# bb_vartables === nothing || (frame.bb_vartables = bb_vartables)
end
end

Expand Down
8 changes: 3 additions & 5 deletions src/linalg/LinAlgBenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ for s in (2, 3)
B = randmat(s)
C = randmat(s)
g["3-arg mul!", s] = @benchmarkable LinearAlgebra.mul!($C, $A, $B)

if VERSION >= v"1.3"
(α, β) = rand(2)
g["5-arg mul!", s] = @benchmarkable LinearAlgebra.mul!($C, $A, $B, $α, $β)
end

(α, β) = rand(2)
g["5-arg mul!", s] = @benchmarkable LinearAlgebra.mul!($C, $A, $B, $α, $β)
end


Expand Down

0 comments on commit 199316c

Please sign in to comment.