Skip to content

Add graph-based GPU Timer API - #4050

Open
XXXXRT666 wants to merge 1 commit into
ml-explore:mainfrom
XXXXRT666:graph-gpu-timer
Open

Add graph-based GPU Timer API#4050
XXXXRT666 wants to merge 1 commit into
ml-explore:mainfrom
XXXXRT666:graph-gpu-timer

Conversation

@XXXXRT666

Copy link
Copy Markdown
Contributor

Proposed changes

Add mx.Timer, a graph-based API for measuring GPU execution time between two points in a lazy graph. It uses Metal command-buffer timestamps and CUDA events, preserves pytree structures through pass-through markers, and synchronizes in elapsed_time() before returning milliseconds.

Add Python typing, tests, and usage documentation.

Checklist

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@zcbenz zcbenz added the await discussion This pull request makes some major changes that requires the team to have a discussion. label Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

await discussion This pull request makes some major changes that requires the team to have a discussion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants