Feature: mark a Func as no_profiling, to prevent injection of profiling.#8136
Feature: mark a Func as no_profiling, to prevent injection of profiling.#8136mcourteaux wants to merge 2 commits intohalide:mainfrom
Conversation
…oop) Func should not be profiled.
|
I still run in a situation where the information from calling In the screenshot above, |
|
The idea seems useful, but I don't think this should be a flag on ProducerConsumer nodes for such a niche purpose. The nice thing about ProducerConsumer nodes is that they give you the name of the Func being produced/consumed. We never make ones that don't correspond directly to a Func. So I think a better way to implement it is to look up the Func in the environment passed around during lowering and read the flag from its schedule. |
|
Replaced by #8143. Thanks for the feedback! |

This PR adds a small change that allows you to
.no_profiling()on aFuncto prevent the corresponding ProducerConsumer node to not be instrumented with profiling. Therefore all the collected samples are attributed to the enclosingProducerConsumer. I wanted to give this a try to see what the generated code looks like.I was thinking this might be useful to get rid of this overhead manually when you are working on pipelines that have a
Funcwithout any loops sitting in the innermost loop nest level, e.g.: theFuncgets compiled to only 1 to 5 instructions.Feedback and opinions welcome!
My use case:
This code full of profiling injections (with an unrolled loop around it):

Became this:

Meanwhile, the profile report went from:
to: