From 0b2a57846d9a1c28d6f58fd2ff35f770293f4009 Mon Sep 17 00:00:00 2001 From: Willow Ahrens Date: Wed, 13 Mar 2024 19:23:53 -0400 Subject: [PATCH 1/4] bug fixes and performance improvements --- Project.toml | 2 +- src/execute.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index ab12e5aac..3955ade1d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Finch" uuid = "9177782c-1635-4eb9-9bfb-d9dfa25e6bce" authors = ["Willow Ahrens"] -version = "0.6.16" +version = "0.6.17" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/execute.jl b/src/execute.jl index 187513992..f8346610d 100644 --- a/src/execute.jl +++ b/src/execute.jl @@ -63,7 +63,7 @@ execute(ex) = execute(ex, NamedTuple()) code = execute_code(:ex, ex; virtualize(:opts, opts, ctx)...) quote # try - @inbounds begin + @inbounds @fastmath begin $(code |> unblock) end # catch @@ -229,7 +229,7 @@ function finch_kernel(fname, args, prgm; algebra = DefaultAlgebra(), mode = safe end |> pretty |> unresolve |> dataflow |> unquote_literals arg_defs = map(((key, val),) -> :($key::$(maybe_typeof(val))), args) striplines(:(function $fname($(arg_defs...)) - @inbounds $(striplines(unblock(code))) + @inbounds @fastmath $(striplines(unblock(code))) end)) end From f14aecf4866ac300699336792eae5c8dda9db4e9 Mon Sep 17 00:00:00 2001 From: Willow Ahrens Date: Thu, 14 Mar 2024 15:07:34 -0400 Subject: [PATCH 2/4] small fix --- src/util/limits.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/limits.jl b/src/util/limits.jl index 7b9221c1a..3545b099f 100644 --- a/src/util/limits.jl +++ b/src/util/limits.jl @@ -193,6 +193,6 @@ for S in limit_types end end -Base.promote_rule(::Type{Limit{T}}, ::Type{Limit{S}}) where {T, S} = Limit(promote_type(T, S)) +Base.promote_rule(::Type{Limit{T}}, ::Type{Limit{S}}) where {T, S} = Limit{promote_type(T, S)} Base.convert(::Type{Limit{T}}, i::Limit) where {T} = Limit{T}(convert(T, i.val), i.sign) Base.hash(x::Limit, h::UInt) = hash(typeof(x), hash(x.val, hash(x.sign, h))) From f3d67f955aeb5cafc93801856550fa008aa0ae0f Mon Sep 17 00:00:00 2001 From: Willow Bot Date: Thu, 14 Mar 2024 19:25:10 +0000 Subject: [PATCH 3/4] Regenerate test output --- docs/src/interactive.ipynb | 6 +++--- test/reference64/issues/short_circuit_bfs.jl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/interactive.ipynb b/docs/src/interactive.ipynb index 3b191c8f3..024827b59 100644 --- a/docs/src/interactive.ipynb +++ b/docs/src/interactive.ipynb @@ -49,11 +49,11 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.10.2" + "version": "1.6.7" }, "kernelspec": { - "name": "julia-1.10", - "display_name": "Julia 1.10.2", + "name": "julia-1.6", + "display_name": "Julia 1.6.7", "language": "julia" } }, diff --git a/test/reference64/issues/short_circuit_bfs.jl b/test/reference64/issues/short_circuit_bfs.jl index 906669a5b..d92ce7bde 100644 --- a/test/reference64/issues/short_circuit_bfs.jl +++ b/test/reference64/issues/short_circuit_bfs.jl @@ -53,7 +53,7 @@ begin if y_lvl_i == phase_stop_2 && A_lvl_2_i == phase_stop_2 A_lvl_3_val = A_lvl_2_val[A_lvl_2_q] y_lvl_2_val = y_lvl_val[y_lvl_q] - p_val = (Finch.Chooser{0}())(p_val, ifelse(y_lvl_2_val && A_lvl_3_val, phase_stop_2, 0)) + p_val = (Finch.Chooser{0}())(p_val, (Core).ifelse(y_lvl_2_val && A_lvl_3_val, phase_stop_2, 0)) y_lvl_q += 1 A_lvl_2_q += 1 elseif A_lvl_2_i == phase_stop_2 From 26d580c5ba403fd87acbc42ff6700af51f4ad3d8 Mon Sep 17 00:00:00 2001 From: Willow Bot Date: Thu, 14 Mar 2024 19:40:40 +0000 Subject: [PATCH 4/4] Regenerate test output --- test/reference32/issues/issue288_concordize_double_let.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/reference32/issues/issue288_concordize_double_let.jl b/test/reference32/issues/issue288_concordize_double_let.jl index fb76c5fcb..e80da63b5 100644 --- a/test/reference32/issues/issue288_concordize_double_let.jl +++ b/test/reference32/issues/issue288_concordize_double_let.jl @@ -24,10 +24,10 @@ begin for i_9 = 1:A_mode1_stop val = X[i_9, j_5] for l_6 = 1:A_mode2_stop + val_2 = A[i_9, l_6, k_6] phase_stop = min(i_9, l_6 + -1) if phase_stop >= i_9 - for s_4 = i_9:phase_stop - val_2 = A[i_9, l_6, k_6] + for s_5 = i_9:phase_stop C[i_9, j_5, k_6] = val_2 * val + C[i_9, j_5, k_6] C[i_9, j_5, k_6] = val * val_2 + C[i_9, j_5, k_6] end