Git Product home page Git Product logo

Comments (4)

cuihantao avatar cuihantao commented on August 15, 2024

And using LoopVectorization 0.12.125, the same code on the same data only takes 1.206 ms. I will post an MWE later today.

from loopvectorization.jl.

chriselrod avatar chriselrod commented on August 15, 2024

Version 0.12.129 is the last version without the warning (and the speed is obviously faster). Looking at the release notes, I'm not sure which function can_turbo determines to be false.

That would be good to know. It obviously has a false positive.
It'd be helpful to get a message notifying why it didn't work...

from loopvectorization.jl.

cuihantao avatar cuihantao commented on August 15, 2024

Thanks for the reply! Below is the code to reproduce the warning:

using LoopVectorization
using BenchmarkTools

symbols = [:a1, :a2, :bh, :bhk, :gh, :ghk, :itap, :itap2, :phi, :u, :v1, :v2, :a1_rhs, :a2_rhs, :v1_rhs, :v2_rhs];

Nelem = 88_900;

for sym in symbols
    @eval $sym = rand(Nelem);
end


function g_update_kernel_Line!(a1, a2, bh, bhk, gh, ghk, itap, itap2, phi, u, v1, v2, a1_rhs, a2_rhs, v1_rhs, v2_rhs)
    @turbo @. a1_rhs = u*(-itap*v1*v2*(-bhk*sin(-a1 + a2 + phi) + ghk*cos(-a1 + a2 + phi)) + itap2*v1^2 *(gh + ghk))
    @turbo @. a2_rhs = u*(-itap*v1*v2*(bhk*sin(-a1 + a2 + phi) + ghk*cos(-a1 + a2 + phi)) + v2^2 *(gh + ghk))
    @turbo @. v1_rhs = u*(-itap*v1*v2*(-bhk*cos(-a1 + a2 + phi) - ghk*sin(-a1 + a2 + phi)) - itap2*v1^2 *(bh + bhk))
    @turbo @. v2_rhs = u*(itap*v1*v2*(bhk*cos(-a1 + a2 + phi) - ghk*sin(-a1 + a2 + phi)) - v2^2 *(bh + bhk))
    nothing
end

@btime g_update_kernel_Line!($a1, $a2, $bh, $bhk, $gh, $ghk, $itap, $itap2,
                             $phi, $u, $v1, $v2, $a1_rhs, $a2_rhs, $v1_rhs, $v2_rhs)

On my device, it gets

  • 0.12.129: 1.2 ms
  • 0.12.130: 6.9 ms (with warning)

But this code does not reproduce the slow down reported in my second post. I will wait for a possible fix and see if the slow down goes away.

from loopvectorization.jl.

cuihantao avatar cuihantao commented on August 15, 2024

Thanks for the new release! Please disregard the issue reported in my reply. The performance is now back with 0.12.133.

from loopvectorization.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.