Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get the results of per layer traces? #69

Open
alright1117 opened this issue Jan 18, 2024 · 3 comments
Open

How can I get the results of per layer traces? #69

alright1117 opened this issue Jan 18, 2024 · 3 comments

Comments

@alright1117
Copy link

alright1117 commented Jan 18, 2024

Hi, I use the ort example to convert my model. When I set debug_level=4, I don't see any trace result folder as https://github.com/TexasInstruments/edgeai-tidl-tools/blob/09_00_00_06/docs/images/fm_trace_files.png. Could you give me some advise?

@spivakoa
Copy link

spivakoa commented Apr 4, 2024

Hi,
the traces are stored under /tmp folder

@beetle2069
Copy link

Encountered the same problem as you,
Have you solved the problem?

@spivakoa
Copy link

spivakoa commented May 5, 2024

Hi @beetle2069 ,

If you would like to get the traces of the dequantized floating point data, you should set debug_level=4 in the compilation options and run the inference in tidl emulation environment. You should run your model inference in 2 modes - 32 bits and 16/8/mixed (depending on your quantization). Each time you will find the traces under the /tmp folder in your Linux machine. Copy them elsewhere. There will per layer traces files with .bin extension - you should use them and not the files with the .y extension.
The difference is that the .bin files are binary files representing the dequantized output per-layer in floating point representation. The .y files are useless as they represent quantized fixed point data and you need to use a scale to dequantize them, but you already have this in .bin files. In order to visualize the data, use the functions from here https://github.com/TexasInstruments/edgeai-tidl-tools/blob/master/docs/tidl_osr_debug.md with 32 bit data vs. fixed point data from your 2 previously collected .bin files. Pay attention that there will not be always exact match between layer indices in 32 and fixed models as fixed point model might also include some data convert layers.
Hope I explained it for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants