Comments (3)
@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:
- Using matmul with runtime dimensions. See example here
- Using
dnnl_?gemm
API
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.
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.
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)
- Understand jit_brgemm_kernel_t and its internals HOT 2
- Help need: use graph API to construct a subgraph of multi-head attention HOT 8
- CPU usage is not as high as expected when thread number >30 HOT 4
- Meet a erro in building process about dnnl HOT 2
- benchdnn matmul failing tests on aarch64 HOT 1
- Expected Multi-Threaded CPU Performance HOT 4
- Wrongly handling of inf when the post-op operation is mul. HOT 2
- [nvidia] int8 convolution primitive fails correctness check
- [nvidia] The build with latest DPC++ open source compiler is broken
- Integration of default in-order stream behaviour to release candidate HOT 1
- oneDNN build with ACL support on ARM machine gives wrong output for matrix multiplication operator HOT 2
- OneDNN verbose not visible in tensorflow 2.14.0 and above. HOT 3
- how can i write a model(mobilenet2) to onednn net graph with c++ HOT 2
- Add support for dimension selection for layer normalization HOT 1
- The test cases are not compatible with the new version of DNN HOT 1
- Convolution not utilizing Eigen Implementation in TensorFlow v2.14.0, Defaults to OneDNN HOT 4
- how can i finish the operator of AdaptiveAvgPool in onednn HOT 2
- Use of use_buffer_b pointer in brgemm matrix multiplication HOT 6
- Min and max reduction in a single prim execution HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onednn.