Skip to content

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Dec 15, 2025

Stack from ghstack (oldest at bottom):

Context

Currently, when using the event tracer API to log shader execution times, only the shader name is recorded as the event name. However, this provides very minimal context to use when interpreting profiling data. For example, if we see that a convolution shader is running slow, it's is impossible to know from the profiling data alone what the input/output sizes were, what convolution parameters (i.e. stride/padding/dilation) were used, etc.

Changes

This diff makes it so that for each shader dispatch, a JSON is recorded as the event name instead which contains the complete details of all the arguments the operator was invoked with.

The JSON will look something like

    {
      "name": "aten.where.self",
      "args": [
        {
          "type": "TENSOR",
          "value_ref": 25,
          "dtype": "Bool",
          "sizes": [
            1,
            1,
            1,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        },
        {
          "type": "TENSOR",
          "value_ref": 30,
          "dtype": "Float",
          "sizes": [
            1,
            6,
            43,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        },
        {
          "type": "TENSOR",
          "value_ref": 32,
          "dtype": "Float",
          "sizes": [
            1,
            6,
            43,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        },
        {
          "type": "TENSOR",
          "value_ref": 33,
          "dtype": "Float",
          "sizes": [
            1,
            6,
            43,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        }
      ]
    }

Then, when processing the profiling data, the JSON can be post-processed to provide useful information to contextualize the shader execution times, for example:

  • Memory Throughput
  • GFLOPS

Differential Revision: D84646748

## Context

Currently, when using the event tracer API to log shader execution times, only the shader name is recorded as the event name. However, this provides very minimal context to use when interpreting profiling data. For example, if we see that a convolution shader is running slow, it's is impossible to know from the profiling data alone what the input/output sizes were, what convolution parameters (i.e. stride/padding/dilation) were used, etc.

## Changes

This diff makes it so that for each shader dispatch, a JSON is recorded as the event name instead which contains the complete details of all the arguments the operator was invoked with.

The JSON will look something like

```json
    {
      "name": "aten.where.self",
      "args": [
        {
          "type": "TENSOR",
          "value_ref": 25,
          "dtype": "Bool",
          "sizes": [
            1,
            1,
            1,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        },
        {
          "type": "TENSOR",
          "value_ref": 30,
          "dtype": "Float",
          "sizes": [
            1,
            6,
            43,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        },
        {
          "type": "TENSOR",
          "value_ref": 32,
          "dtype": "Float",
          "sizes": [
            1,
            6,
            43,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        },
        {
          "type": "TENSOR",
          "value_ref": 33,
          "dtype": "Float",
          "sizes": [
            1,
            6,
            43,
            8
          ],
          "storage": "TEXTURE_3D",
          "packed_dim": 2
        }
      ]
    }
```

Then, when processing the profiling data, the JSON can be post-processed to provide useful information to contextualize the shader execution times, for example:

* Memory Throughput
* GFLOPS

Differential Revision: [D84646748](https://our.internmc.facebook.com/intern/diff/D84646748/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 15, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16266

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 4 Unrelated Failures

As of commit 5286b58 with merge base 5d40a3a (image):

NEW FAILURE - The following job has failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 15, 2025
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@SS-JIA SS-JIA changed the base branch from gh/SS-JIA/382/base to main December 16, 2025 21:16
@SS-JIA SS-JIA merged commit 69974f3 into main Dec 16, 2025
154 of 163 checks passed
@SS-JIA SS-JIA deleted the gh/SS-JIA/382/head branch December 16, 2025 21:17
SS-JIA added a commit that referenced this pull request Dec 16, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* __->__ #16267
* #16266

## Context

When debugging correctness issues in ET-VK, it can be helpful to extract
a subgraph of the model and test on the subgraph.

## Changes

This diff/PR introduces some test utilites that can be used to extract
all nodes tagged with a specified field in the `node.meta["custom"]` map
into a separate `ExportedProgram`.

Differential Revision:
[D89216531](https://our.internmc.facebook.com/intern/diff/D89216531/)

---------

Co-authored-by: ssjia <ssjia@devvm1479.ncg0.facebook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants