Code Monkey home page Code Monkey logo

Comments (9)

SOF3 avatar SOF3 commented on July 17, 2024

I am concerned that running on a wrong CPU would cause very unpredictable undefined behavior silently. Or are we confident that machines that do not support AVX2 will generate garbage output before it actually runs something in production to cause some damage?

What about we provide AVX2 binaries separately first and detect that we can use these binaries in install.sh?

from php-binaries.

dktapps avatar dktapps commented on July 17, 2024

Attempted usage of AVX2 instructions will cause an immediate crash with SIGILL since the host processor won't recognize the instruction.

In any case, as it turns out, some stuff such as libdeflate already compiles AVX2 code anyway, and uses cpuid() to switch the used function at runtime depending on what features the processor supports, so this isn't as big of a deal as I expected.

from php-binaries.

SOF3 avatar SOF3 commented on July 17, 2024

Attempted usage of AVX2 instructions will cause an immediate crash with SIGILL since the host processor won't recognize the instruction.

This is not exactly true. Other CPU models may interpret the same instruction code as something else and treat it differently.

from php-binaries.

dktapps avatar dktapps commented on July 17, 2024

I hadn't considered that, but since we're dealing with only two x86_64 vendors with known histories (AMD and Intel), I think that's probably not a concern.

from php-binaries.

SOF3 avatar SOF3 commented on July 17, 2024

I am not very familiar with various SIMD instruction sets, but it appears that AVX2 is already common enough. It is probably still a good idea for users to compile their own binaries to get the best performance though.

from php-binaries.

dktapps avatar dktapps commented on July 17, 2024

I think currently most people aren't aware that they are sacrificing performance by using prebuilt binaries instead of compiling their own, especially since installing a prebuilt is recommended by the docs, and is also done automatically by installer.sh.

from php-binaries.

BlackCatDevel0per avatar BlackCatDevel0per commented on July 17, 2024

(Binaries built using compile.sh without the -t flag will automatically use -march=native, so anyone building their own binaries automatically gets the best performance.)

Recently I've added this flag to my fork) I think I'll upload it this week..

from php-binaries.

dktapps avatar dktapps commented on July 17, 2024

-march=native makes binaries non-portable. There's a reason we don't use it for the prebuilts.

from php-binaries.

kazan417 avatar kazan417 commented on July 17, 2024

I think if someone could add detecting support of avx2 in runtime of already builded binary than enabling avx2 in prebuils will be good idea.

from php-binaries.

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.