Skip to content

Conversation

@Gasoonjia
Copy link
Contributor

@Gasoonjia Gasoonjia commented Dec 26, 2025

Stack from ghstack (oldest at bottom):

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

Key changes:

  1. c10/core/ScalarType.h - Extended with all required types:
    • Added enum values matching PyTorch's c10::ScalarType for compatibility
    • Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
    • Extended elementSize() to return correct sizes for all types
    • Extended toString() for all types
    • Fixed isFloatingType() to include BFloat16
    • Fixed isIntegralType() to properly handle all integral types and Bool
    • Added isBoolType() helper function
    • Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: D89821402

…oat16)

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

**Key changes:**

1. **`c10/core/ScalarType.h`** - Extended with all required types:
   - Added enum values matching PyTorch's c10::ScalarType for compatibility
   - Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
   - Extended `elementSize()` to return correct sizes for all types
   - Extended `toString()` for all types
   - Fixed `isFloatingType()` to include BFloat16
   - Fixed `isIntegralType()` to properly handle all integral types and Bool
   - Added `isBoolType()` helper function
   - Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: [D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 26, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures, 2 Unrelated Failures

As of commit 042aae1 with merge base 4f8dbde (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

Gasoonjia added a commit that referenced this pull request Dec 26, 2025
…oat16)

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

**Key changes:**

1. **`c10/core/ScalarType.h`** - Extended with all required types:
   - Added enum values matching PyTorch's c10::ScalarType for compatibility
   - Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
   - Extended `elementSize()` to return correct sizes for all types
   - Extended `toString()` for all types
   - Fixed `isFloatingType()` to include BFloat16
   - Fixed `isIntegralType()` to properly handle all integral types and Bool
   - Added `isBoolType()` helper function
   - Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: [D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)

ghstack-source-id: 331195238
Pull Request resolved: #16399
@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 26, 2025
@github-actions
Copy link

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.

…, Bool, BFloat16)"

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

**Key changes:**

1. **`c10/core/ScalarType.h`** - Extended with all required types:
   - Added enum values matching PyTorch's c10::ScalarType for compatibility
   - Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
   - Extended `elementSize()` to return correct sizes for all types
   - Extended `toString()` for all types
   - Fixed `isFloatingType()` to include BFloat16
   - Fixed `isIntegralType()` to properly handle all integral types and Bool
   - Added `isBoolType()` helper function
   - Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: [D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)

[ghstack-poisoned]
…, Bool, BFloat16)"

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

**Key changes:**

1. **`c10/core/ScalarType.h`** - Extended with all required types:
   - Added enum values matching PyTorch's c10::ScalarType for compatibility
   - Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
   - Extended `elementSize()` to return correct sizes for all types
   - Extended `toString()` for all types
   - Fixed `isFloatingType()` to include BFloat16
   - Fixed `isIntegralType()` to properly handle all integral types and Bool
   - Added `isBoolType()` helper function
   - Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: [D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)

[ghstack-poisoned]
…, Bool, BFloat16)"

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

**Key changes:**

1. **`c10/core/ScalarType.h`** - Extended with all required types:
   - Added enum values matching PyTorch's c10::ScalarType for compatibility
   - Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
   - Extended `elementSize()` to return correct sizes for all types
   - Extended `toString()` for all types
   - Fixed `isFloatingType()` to include BFloat16
   - Fixed `isIntegralType()` to properly handle all integral types and Bool
   - Added `isBoolType()` helper function
   - Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: [D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)

[ghstack-poisoned]
…, Bool, BFloat16)"

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

**Key changes:**

1. **`c10/core/ScalarType.h`** - Extended with all required types:
   - Added enum values matching PyTorch's c10::ScalarType for compatibility
   - Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
   - Extended `elementSize()` to return correct sizes for all types
   - Extended `toString()` for all types
   - Fixed `isFloatingType()` to include BFloat16
   - Fixed `isIntegralType()` to properly handle all integral types and Bool
   - Added `isBoolType()` helper function
   - Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: [D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)

[ghstack-poisoned]
…, Bool, BFloat16)"

This diff adds support for all required scalar types in SlimTensor to support ExecuTorch aoti-driven backend usage: Int8 (Char), Int16 (Short), Int32 (Int), Int64 (Long), Bool, and BFloat16.

**Key changes:**

1. **`c10/core/ScalarType.h`** - Extended with all required types:
   - Added enum values matching PyTorch's c10::ScalarType for compatibility
   - Added type alias constants (kChar, kShort, kInt, kLong, kBool, kBFloat16)
   - Extended `elementSize()` to return correct sizes for all types
   - Extended `toString()` for all types
   - Fixed `isFloatingType()` to include BFloat16
   - Fixed `isIntegralType()` to properly handle all integral types and Bool
   - Added `isBoolType()` helper function
   - Imported BFloat16 from ExecuTorch's portable_type

Differential Revision: [D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)

[ghstack-poisoned]
@meta-codesync meta-codesync bot merged commit a7c39dc into gh/gasoonjia/78/base Jan 21, 2026
166 of 173 checks passed
@meta-codesync meta-codesync bot deleted the gh/gasoonjia/78/head branch January 21, 2026 05:57
Gasoonjia added a commit that referenced this pull request Jan 21, 2026
…oat16) (#16731)

This PR was created by the merge bot to help merge the original PR into
the main branch.
ghstack PR number: #16399 by
@Gasoonjia
^ Please use this as the source of truth for the PR details, comments,
and reviews
ghstack PR base:
https://github.com/pytorch/executorch/tree/gh/gasoonjia/78/base
ghstack PR head:
https://github.com/pytorch/executorch/tree/gh/gasoonjia/78/head
Merge bot PR base:
https://github.com/pytorch/executorch/tree/gh/gasoonjia/77/orig
Merge bot PR head:
https://github.com/pytorch/executorch/tree/gh/gasoonjia/78/orig
Differential Revision:
[D89821402](https://our.internmc.facebook.com/intern/diff/D89821402/)
@diff-train-skip-merge

---------

Co-authored-by: gasoonjia <gasoonjia@icloud.com>
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants