pytorch/.github
Nikita Shulga 92ddb3d3d3 [MPS] Expose MPSProfiler::start/stopCapture to Python (#144561)
I.e. when `MTL_CAPTURE_ENABLED` environment variable is set to 1, one should be able to invoke wrap the code with `torch.mps.profiler.capture_metal` to generate gputrace for shaders invoked inside the context manager.

For example, code below:
```python
import torch
import os

def foo(x):
   return x[:,::2].sin() + x[:, 1::2].cos()

if __name__ == "__main__":
    os.environ["MTL_CAPTURE_ENABLED"] = "1"
    x = torch.rand(32, 1024, device="mps")

    with torch.mps.profiler.metal_capture("compiled_shader"):
        torch.compile(foo)(x)
```
should capture the execution of a `torch.compile` generated shader
<img width="734" alt="image" src="https://github.com/user-attachments/assets/718ff64e-103b-4b11-b66c-c89cfc770b5d" />

Pull Request resolved: https://github.com/pytorch/pytorch/pull/144561
Approved by: https://github.com/manuelcandales
ghstack dependencies: #144559, #144560
2025-01-11 02:05:36 +00:00
..
actions [ROCm] Enable post-merge trunk workflow on MI300 runners; skip and fix MI300 related failed tests (#143673) 2025-01-09 05:18:57 +00:00
ci_commit_pins [audio hash update] update the pinned audio hash (#143694) 2024-12-21 05:42:34 +00:00
ISSUE_TEMPLATE Update documentation.yml 2025-01-10 15:27:28 -08:00
requirements Upgrade expecttest to 0.3.0 (#142869) 2024-12-11 19:04:16 +00:00
scripts S390x cancelled jobs cleanup (#144149) 2025-01-09 20:45:19 +00:00
templates Remove builder repo from workflows and scripts (#143776) 2024-12-24 14:11:51 +00:00
workflows [MPS] Expose MPSProfiler::start/stopCapture to Python (#144561) 2025-01-11 02:05:36 +00:00
actionlint.yaml [ROCm] Use linux.rocm.gpu.2 for 2-GPU and linux.rocm.gpu.4 for 4-GPU runners (#143769) 2024-12-24 08:04:00 +00:00
auto_request_review.yml
label_to_label.yml
labeler.yml [dtensor] move all tests to distribute/tensor folder (#144166) 2025-01-08 00:32:33 +00:00
merge_rules.yaml
nitpicks.yml
PULL_REQUEST_TEMPLATE.md
pytorch-circleci-labels.yml
pytorch-probot.yml Update inductor jobs to use CUDA 12.4 (#142177) 2024-12-09 16:18:38 +00:00
regenerate.sh
requirements-gha-cache.txt [EZ] Update jinja2 to 3.1.5 (#143923) 2024-12-27 21:10:21 +00:00