halide_profiler_func_stats#
-
struct halide_profiler_func_stats#
Per-Func state tracked by the sampling profiler.
Public Members
-
const char *name#
The name of this Func.
A global constant string.
-
const char *ir_name#
The name of this Func in the IR.
Differs from name when the Func has a profiler display name (e.g. inputs and wrappers). A global constant string.
-
int parent#
The id of the parent Func (the one which this is compute_at).
-1 if the Func is compute_root.
-
int canonical_id#
Id of this Func’s canonical entry.
A Func can appear in this array more than once (e.g. an unscheduled Func with an update definition reached from multiple callers); canonical_id is the id of the first such appearance, the shared key for rolling instances back up to a Func.
-
int buffer_func_id#
For copy synthetics (kind == copy_to_host/copy_to_device), the canonical id of the Func whose buffer is being copied.
-1 otherwise.
-
uint32_t counters_approximated#
A bitmask flagging which of this Func’s aggregated counters are conservative upper bounds rather than exact values.
Bit i corresponds to the i’th counter passed to halide_profiler_update_counters, in the order of the counter enum in src/Profiling.cpp (bit 0 = memory_total, 1 = num_allocs, … covering all the summed counters below, from memory_total through productions_if_inwards). active_threads_numerator and _denominator are sampled at runtime rather than summed over loops, so they are never approximated and have no bit. A set bit only happens on GPU, where a guarded contribution can’t be summed exactly and is bounded instead; the reporter marks such columns with a leading ‘<’.
-
uint64_t time#
Total time (nanoseconds) spent evaluating this Func, summed across all runs that produced a profiler sample.
Divide by the pipeline’s billed_runs (not runs) for a per-run time.
-
uint64_t memory_current#
This Func’s live heap allocation at the instant the report is taken; normally near zero once a run has finished.
A snapshot, not aggregated.
-
uint64_t memory_peak#
The peak heap allocation of this Func: the maximum over all runs (a peak, not a sum — do not divide by runs).
-
uint64_t stack_peak#
The peak stack allocation of this Func’s threads, as a maximum over all runs (like memory_peak).
-
uint64_t memory_total#
The total memory allocation of this Func.
-
uint64_t active_threads_numerator#
The average number of thread pool worker threads active while computing this Func is numerator / denominator.
Both are summed across runs, so the ratio is already an average — do not divide it by runs.
-
uint64_t num_allocs#
The total number of times heap storage for this Func was allocated.
-
uint64_t parallel_loops#
The number of parallel loops launched to compute some of this Func.
I.e. the number of times halide_do_par_for was called due to one of this Func’s parallel loops. Next, the total number of iterations of those loops.
-
uint64_t points_required_at_root#
The number of points required of this Func at root.
Will be less than points_required when there is redundant recompute due to use of compute_at.
-
uint64_t points_computed#
The number of points actually computed by this Func’s pure definition (its stage-0 stores), weighted by vector lane count.
Captures forms of over-computation that the box-required counters miss: tail strategies like RoundUp that write past the requested extent, and cases where sliding-window failed so each produce-node iteration computes the full required box. Counting just stage-0 stores keeps update definitions from being conflated as “recompute”.
-
uint64_t scalar_loads#
The number of loads of various kinds done while computing this Func, classified by the index expression: scalar (a scalar index), vector (a unit-stride ramp), or gather (anything else).
bytes_loaded is the total number of bytes loaded across all three.
-
uint64_t scalar_stores#
The number of stores of various kinds done while computing this Func, classified the same way (scalar / unit-stride vector / scatter), plus the total bytes stored.
-
uint64_t realizations#
The number of times heap storage for this Func was realized (a store_at site) and produced (a compute_at site).
-
uint64_t points_required_at_realization#
The total number of points required of this Func aggregated across all realizations (store_at sites) and, separately, across all productions (compute_at sites).
When sliding-window succeeds, the production total is less than the per-production naive sum.
-
uint64_t points_required_inwards#
The number of points that would be required, and the number of times the Func would be produced, if it were computed one loop level further inwards than its current compute_at.
Used to evaluate whether computing further in might be a good idea.
-
const char *name#