torch.mps.profiler.start(mode='interval', wait_until_completed=False)[source]

Start OS Signpost tracing from MPS backend.

The generated OS Signposts could be recorded and viewed in XCode Instruments Logging tool.

  • mode (str) – OS Signpost tracing mode could be “interval”, “event”, or both “interval,event”. The interval mode traces the duration of execution of the operations, whereas event mode marks the completion of executions. See document Recording Performance Data for more info.

  • wait_until_completed (bool) – Waits until the MPS Stream complete executing each encoded GPU operation. This helps generating single dispatches on the trace’s timeline. Note that enabling this option would affect the performance negatively.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources