Skip to content

Capture of pinned Helion launches - #26106

Open
yushangdi wants to merge 2 commits into
pytorch:mainfrom
yushangdi:export-D135498635
Open

yushangdi wants to merge 2 commits into
pytorch:mainfrom
yushangdi:export-D135498635

Conversation

@yushangdi

Copy link
Copy Markdown
Contributor

Summary:
codegen/capture.py captures a pinned launch with Helion's
capture_metal_launches on placeholder MPS tensors (nothing is compiled or
dispatched) and arranges it for MLX's metal_kernel. The capture names its
output dtypes as the registry does and records the kernel's parameter names,
which the launch's arguments follow. Helion is imported on the first capture,
so only the tools that capture launches need it. Nothing calls it yet: the
generator that builds a target's launches into the runtime does.

This diff was authored with the help of AI coding agents.

Reviewed By: digantdesai

Differential Revision: D135498635

Summary:

A Helion target, pinned offline for one chip, lists the variants that beat
the MLX lowering of an op's calls: each the call it serves (exact shapes,
and for ints a value or an IntRange), the launches that compute it (kernel,
config, explicit input wiring) and its results. Registration checks
each variant's wiring, that its tensor sizes are exact (a launch's grid is
fixed when it is captured), and that no two variants of an op can match one
call, and keeps an immutable snapshot under the target's name, with shapes
as tuples so that a target written with lists matches the calls it pins.
dtype_name and DTYPES name dtypes as a TensorSpec does. Nothing
reads a target yet: the next commits capture its launches and build them
into the runtime.

This diff was authored with the help of AI coding agents.

Reviewed By: digantdesai

Differential Revision: D135440012
Summary:
codegen/capture.py captures a pinned launch with Helion's
capture_metal_launches on placeholder MPS tensors (nothing is compiled or
dispatched) and arranges it for MLX's metal_kernel. The capture names its
output dtypes as the registry does and records the kernel's parameter names,
which the launch's arguments follow. Helion is imported on the first capture,
so only the tools that capture launches need it. Nothing calls it yet: the
generator that builds a target's launches into the runtime does.

This diff was authored with the help of AI coding agents.

Reviewed By: digantdesai

Differential Revision: D135498635
@pytorch-bot

pytorch-bot Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 13 Pending, 1 Unclassified Failure

As of commit 58e34dc with merge base 7de3ecb (image):

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

  • MLX / test-mlx-qwen35-moe / test-mlx-qwen35-moe (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    ##[error]fatal: unable to access 'https://github.com/google/sentencepiece.git/': Could not resolve host: github.com

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 5, 2026
@meta-codesync

meta-codesync Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@yushangdi has exported this pull request. If you are a Meta employee, you can view the originating Diff in D135498635.

@digantdesai digantdesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

This branch has not been deployed

No deployments
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants