Giter Site home page Giter Site logo

Comments (3)

vpirogov avatar vpirogov commented on June 15, 2024

@ItayLasch, oneDNN programming model assumes that primitives are created once and reused during the model execution (either explicitly of via oneDNN primitive cache), so we do not provide any guarantees around creation time. If you need the creation time to be zero there are two options:

While the creation time will be zero for these cases, the execution time will suffer in comparison to fully specialized matmul primitive.

Hope this helps!

from onednn.

ItayLasch avatar ItayLasch commented on June 15, 2024

I don't want creation time to be zero. I wanted to know if there are certain cases with the inputs dimensions where the performance is worse the usual or better. The only variable I'm trying to look at right now is the dimension sizes of the inputs and output.

from onednn.

mgouicem avatar mgouicem commented on June 15, 2024

Adding @msotoflo @ankalinin

Is there any thumb rule to decide whether or not it is preferable to use this primitive regarding the tensor's sizes?
I noticed that the output's dimension perhaps affects the performance more than the input's sizes.

It is really implementation dependent and architecture dependent. In general, here are some guidelines, though their impact on final performance will vary:

  • use multiples of hardware vector length, so that you avoid tail handling (e.g. 64 should be ok for most instruction sets and datatypes)
  • use multiples of the number of cores if you are targeting a particular platform. This allows perfect load balancing.
  • Try to avoid large powers of 2 to maximize cache usage. This is because CPU caches are typically N-way associative, and for L1 cache, strided accesses prevent from using all the cache effectively (see here)

Hope that helps.

from onednn.

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.