Comments (6)
Hi @WilliamTambellini, please use DNNL_VERBOSE=all
to see an explanation to the error you observe.
It says to me onednn_verbose,primitive,create:check,reorder,inconsistent src and dst mds,src/common/reorder.cpp:82
.
Conservative reshape should be done through a dedicated function of memory::desc. Reorder does perform memory copy regardless of inputs since memory arguments are expected to be different.
from onednn.
Tks @dzarukin
Though:
- as said in my initial post, desc::reshape does NOT do much except returning a new desc, it does NOT reshape a memory obj.
- if reorder is not the right pri to use, which one is it ?
That ticket is by definition not completed: you did not show evidence yet as today that a memcopy free reshape is doable with onednn 3.2.1. With 3.2.1, there is no way to change the desc of an existing memory. Creating a new mem object would mean memcopy the data.
Could you please reopened the ticket till resolved ?
Best regards
WT
from onednn.
it does NOT reshape a memory obj.
The memory object is not modified simply because oneDNN can't do any assumptions whether the original memory object is needed or not. It's always required to create a new object as the user is allowed to attach same handle over different memory objects.
The following piece should serve well.
memory::desc md_orig(...);
memory m_orig(md_orig, engine); // allocation happens here
... // filling/modifying m_orig.data()
memory::desc md_reshaped(...);
memory m_reshaped(md_reshaped, engine, m_orig.get_data_handle()); // Since md doesn't change data order, can re-apply the handle.
The piece above requires m_orig
to be alive to keep the handle allocated. It's safer to provide a handle for m_orig
though for juggling memory objects as needed.
from onednn.
Tks @dzarukin
I was keeping that solution as last option because, as you said, many drawbacks, as imposing the user to keep alive the old original memory and of course the new created one.
Considering a conservative resize could be needed multiple times in the lifetime of a tensor, it would mean accumulating zombie memory objects just to keep the data alive.
I thought about fully refactoring our onednn plugin to never use onednn allocation but using the handle ctor but I hope you can see all the additional logic that it would require, plus being unable to take advantage of ondnn mem allocation system (gpu or cpu, best aligned for the running cpu, ...), having to reimplement a mem allocation system.
A cleaner, high perf and user friendly solution would be to simply be able to move the handle(s) from an existing memory object to another one, the original memory not owning the data anymore.
Is it possible with 3.2.1 ?
Best regards
W.
from onednn.
Reminder: that issue is not closed: the algo is not doable today with 3.2.1.
from onednn.
If you want to migrate handles between memory objects, you must allocate memory on your end and manage it manually.
For convenience, you probably may insert a move ctor into dnnl namespace or make a lightweight function that will perform transition.
The memory allocated by the library can't be managed externally and there's no scenario where the library would detach the handle and make user de-allocate it.
Since the memory creation without handle is cheap, oneDNN team doesn't see a need to do anything else.
from onednn.
Related Issues (20)
- running destructors before completion of a primitive HOT 7
- why the result of eltwise_hardswish is zero? HOT 8
- test_benchdnn_modeC_softmax_ci_cpu fails due to F16 accumulation HOT 2
- Check timings of assembly level instructions HOT 10
- How to use coverage.cmake file HOT 5
- Add option to disable python 2.7 finding via docs HOT 5
- why the result shape of conv is not same with input HOT 3
- test_benchdnn_modeC_rnn_ci_cpu failing on AArch64 with and without ACL
- how to link the dnnl library from a git submodule build HOT 7
- how can i use the cache for cpu inference HOT 12
- 'ONEDNN_VERBOSE' is not recognized at the windows cmd HOT 2
- Core utilization on heterogeneous architectures HOT 2
- when i set the ONEDNN_VERBOSE=all for windows, it only display serveral information, why? HOT 2
- why the reorder cost a lot time? HOT 9
- Getting configuration error on RiscV Qemu: Only Sequential Runtime is now supported for a Risc-V CPU HOT 4
- can support the fp16 or bf16 for cpu with 3.3.6 version? HOT 11
- when i compile the dll of onednn wit debug, it failds to build, but the release is built successfully。 HOT 2
- how can i close the verbose when running HOT 4
- Graphs with single StaticReshape or StaticTranspose fail HOT 12
- test_benchdnn_modeC_reorder_ci_cpu failing on AArch64 HOT 5
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.