Skip to content

[executorch][native] Add Scalar value type to the in-memory IR - #22099

Open
SS-JIA wants to merge 1 commit into
gh/SS-JIA/588/basefrom
gh/SS-JIA/588/head
Open

[executorch][native] Add Scalar value type to the in-memory IR#22099
SS-JIA wants to merge 1 commit into
gh/SS-JIA/588/basefrom
gh/SS-JIA/588/head

Conversation

@SS-JIA

@SS-JIA SS-JIA commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Add Scalar (backends/native/runtime/graph/Scalar.{h,cpp}), a concrete scalar
value — an int / double / bool tagged over a trivially-copyable union, analogous
to c10::Scalar and the scalar slice of the ET-VK ComputeGraph Value.

Construct implicitly from int / int64_t / double / bool; read via strict
accessors (to_int / to_double / to_bool, which throw on a tag mismatch) or
the promoting to<T>() template (a static_cast of whichever member is active,
like c10::Scalar::to<T>()). Plus tag() / is_*() predicates and tag_name()
/ to_string() debug helpers. No "none" state — the graph's Value owns that.

Pure std — no ExecuTorch and no flatbuffers dependency. Mirrored into both the
fbcode/ and xplat/ trees to match the native backend layout.

Authored with Claude Code.

Differential Revision: D114396762

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 96f437d with merge base 9a2d135 (image):

NEW FAILURE - The following job has failed:

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

@github-actions

Copy link
Copy Markdown

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.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant