Skip to content

gpu: Add InstrumentedSamplingConfig to GpuCounterConfig - #5358

Merged
dreveman merged 1 commit into
mainfrom
dev/reveman/gpu-inst-cfg
Apr 15, 2026
Merged

dreveman merged 1 commit into
mainfrom
dev/reveman/gpu-inst-cfg

Conversation

@dreveman

@dreveman dreveman commented Mar 31, 2026 •

Copy link
Copy Markdown
Collaborator

Add counter_names field to GpuCounterConfig as an alternative to
counter_ids for selecting counters by name.

Add InstrumentedSamplingConfig with activity filtering support:

  • ActivityNameFilter message with per-filter NameBase enum and
    name_glob field for matching mangled or demangled kernel names.
  • TX range include/exclude globs for filtering by in-process
    annotations (e.g. NVTX ranges for CUDA).
  • ActivityRange for skip/count based sampling of matching activities.
  • Three-step filtering pipeline: activity name filters, TX range
    include/exclude, then range-based sampling.

Add instrumented sampling documentation to docs/data-sources/gpu.md.

@github-actions

github-actions Bot commented Mar 31, 2026 •

Copy link
Copy Markdown

@LalitMaganti

Copy link
Copy Markdown
Member

@olehkuznetsov - this might need more discussion or at least comments for Android indicating what is supported etc.

I think in general, this CL could also do with more description of which path you would want to choose, what options will be choose if you use the boolean option etc.

Also I think we need to start thinking about adding documentation to docs.perfetto.dev about all the things you are adding. We didn't add it before but you're significantly expanding the surface, I think it's worth us properly looking into this now.

Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
@dreveman

Copy link
Copy Markdown
Collaborator Author

@olehkuznetsov - this might need more discussion or at least comments for Android indicating what is supported etc.

I think in general, this CL could also do with more description of which path you would want to choose, what options will be choose if you use the boolean option etc.

Also I think we need to start thinking about adding documentation to docs.perfetto.dev about all the things you are adding. We didn't add it before but you're significantly expanding the surface, I think it's worth us properly looking into this now.

Yes, I've been thinking about how to best do this. Just updating the docs/data_sources/gpu.md is a good start. I was thinking we have 3 sections in there:

  • Common GPU things at the top
  • Android specific things
  • High performance GPGPU (e.g. latest Nvidia hw used for GenAI training and inference)

I'll start this as a separate change if that sounds good?

I was also thinking that the last bullet point could be added to the built-in examples so it's easy to see how perfetto UI can visualize these workloads.

@dreveman
dreveman force-pushed the dev/reveman/gpu-inst-cfg branch from 8fcc0a9 to 8faf550 Compare March 31, 2026 22:37
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
@dreveman
dreveman force-pushed the dev/reveman/gpu-inst-cfg branch from 8faf550 to 43aafa2 Compare April 1, 2026 20:24
@dreveman
dreveman force-pushed the dev/reveman/gpu-inst-cfg branch from 43aafa2 to 65988b5 Compare April 1, 2026 20:46
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto
Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto
@dreveman
dreveman force-pushed the dev/reveman/gpu-inst-cfg branch from 65988b5 to 0d9ada5 Compare April 2, 2026 16:25
@dreveman
dreveman requested a review from a team as a code owner April 2, 2026 16:25
@dreveman
dreveman requested a review from olehkuznetsov April 2, 2026 16:31
@dreveman

dreveman commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator Author

@LalitMaganti @olehkuznetsov Does the latest version of this look good to you?

@LalitMaganti LalitMaganti left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Giving owners approval but please wait for olehkuznetsov@ to confirm.

@dreveman

dreveman commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator Author

@olehkuznetsov, friendly ping for review

@dreveman

Copy link
Copy Markdown
Collaborator Author

@olehkuznetsov, any chance you can take a look at this today? I'd like to update the Rust SDK proto bindings now that everything else has landed and it would be nice to include this.

@LalitMaganti, if olehkuznetsov is not available, how do you feel about me landing this now and following up if needed when olehkuznetsov has had a chance to review the final version of this?

@LalitMaganti

Copy link
Copy Markdown
Member

I'd prefer to wait here if possible.

Comment thread protos/perfetto/config/gpu/gpu_counter_config.proto Outdated
@dreveman
dreveman force-pushed the dev/reveman/gpu-inst-cfg branch from 0d9ada5 to a2e65e0 Compare April 15, 2026 13:26
@dreveman dreveman changed the title perfetto: Add InstrumentedSamplingConfig to GpuCounterConfig gpu: Add InstrumentedSamplingConfig to GpuCounterConfig Apr 15, 2026
Add counter_names field to GpuCounterConfig as an alternative to
counter_ids for selecting counters by name.

Add InstrumentedSamplingConfig with activity filtering support:
- ActivityNameFilter message with per-filter NameBase enum and
  name_glob field for matching mangled or demangled kernel names.
- TX range include/exclude globs for filtering by in-process
  annotations (e.g. NVTX ranges for CUDA).
- ActivityRange for skip/count based sampling of matching activities.
- Three-step filtering pipeline: activity name filters, TX range
  include/exclude, then range-based sampling.

Add instrumented sampling documentation to docs/data-sources/gpu.md.
@dreveman
dreveman force-pushed the dev/reveman/gpu-inst-cfg branch from a2e65e0 to 62742c6 Compare April 15, 2026 13:34
@dreveman
dreveman merged commit 31d39b6 into main Apr 15, 2026
23 checks passed
@dreveman
dreveman deleted the dev/reveman/gpu-inst-cfg branch April 15, 2026 13:51
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

Successfully merging this pull request may close these issues.

3 participants