Add more profiler counters, and a system of performance warnings driven by them - #9344
Open
abadams wants to merge 2 commits into
Open
Add more profiler counters, and a system of performance warnings driven by them#9344abadams wants to merge 2 commits into
abadams wants to merge 2 commits into
Conversation
Reintroduces the per-Func warnings system (stripped when the profiler was
merged in smaller pieces) for the rules that need no counters beyond those
already tracked in main:
- allocs_in_parallel_loop
- poor_thread_utilization_{many_loops,fine_tasks}
- too_few_parallel_tasks
- not_parallelized
- high_recompute (basic message)
- approximated_counters
- device_bouncing
plus the pipeline-wide heuristics (too few samples, too many anonymous
Funcs, expensive frees). Each Func's row gains a "notes" cell listing the
numbers of the warnings that apply; the messages print after the table.
The rules run against a per-canonical rollup (canon_fs/canon_cs) that sums
each Func's instances. The approximated flag is read from the uint32
counters_approximated bitmask rather than the old single-bit flags byte.
Vectorization warnings and the recompute-locality warning depend on
counters not yet restored, and follow in later commits.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds eight per-Func counters classifying the loads and stores done while computing each Func, by index expression: scalar (scalar index), vector (unit-stride ramp), or gather/scatter (anything else), plus total bytes loaded/stored. They're counted in Profiling.cpp's visit(Load)/visit(Store), threaded through halide_profiler_update_counters, stored on halide_profiler_func_stats, and dumped to the JSON report. These drive five reinstated vectorization warnings: - no_vector_ops - more_gathers_than_vector_loads - more_scatters_than_vector_stores - many_scalar_stores - narrow_vector_stores (uses the pipeline's native_vector_bytes) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLMs scheduling Halide code need more explicit guidance on things that might be wrong with the schedule. We've found this set of warnings to be helpful to them. Example output:
Still TODO is to include the warnings in the JSON version of the output, for tools that would rather ingest that.