Skip to content

Update throughput and latency cost calc for shuffling reductions #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 29, 2023

Conversation

chriselrod
Copy link
Member

@chriselrod chriselrod commented Apr 29, 2023

Also, it heuristically doubles the estimated throughput of apple-m*. This check should work regardless of whether running Mac or Linux, as long as the CPU is recognized.

@heltonmc

julia> function dot_turbo_ls(ca::AbstractVector{Complex{T}}, cb::AbstractVector{Complex{T}}) where {T}
           a = reinterpret(reshape, T, ca)
           b = reinterpret(reshape, T, cb)
           re = zero(T)
           im = zero(T)
           LoopVectorization.@turbo_debug for i  axes(a, 2)
             re += a[1, i] * b[1, i] + a[2, i] * b[2, i]
             im += a[1, i] * b[2, i] - a[2, i] * b[1, i]
           end
       end
dot_turbo_ls (generic function with 1 method)

julia> T = Complex{Float64}; n = 203;

julia> xv = rand(T, n);

julia> yv = rand(T, n);

julia> ls = dot_turbo_ls(xv,yv);

julia> LoopVectorization.choose_order_cost(ls)
rt = 4.5
sl = 12
op = var"##op#307" = LoopVectorization.vfmadd_fast(var"##op#303", var"##op#304", var"##op#308")
rt = 0.5
sl = 8
op = var"##op#309" = LoopVectorization.vfmadd_fast(var"##op#303", var"##op#306", var"##op#310")
(latency, rt) = (12.0, 5.0)
([:i], :i, Symbol("##undefined##"), :i, 4, -1, 2970.3953125000003, true)

It'll now unroll the complex dot product by 4, because 12 / 5 = 2.4.
It'll round 2.4 up to the nearest power of 2, i.e. 4.

@codecov
Copy link

codecov bot commented Apr 29, 2023

Codecov Report

Patch coverage: 92.85% and project coverage change: +2.18 🎉

Comparison is base (9eb6f63) 84.58% compared to head (70622b0) 86.76%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #488      +/-   ##
==========================================
+ Coverage   84.58%   86.76%   +2.18%     
==========================================
  Files          38       39       +1     
  Lines        9489     9516      +27     
==========================================
+ Hits         8026     8257     +231     
+ Misses       1463     1259     -204     
Impacted Files Coverage Δ
src/modeling/determinestrategy.jl 95.60% <92.85%> (+2.12%) ⬆️

... and 30 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@chriselrod chriselrod merged commit 177708e into main Apr 29, 2023
@chriselrod chriselrod deleted the shufflereductioncost branch April 29, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant