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.

⏳ 1 Pending, 1 Unrelated Failure

As of commit 0723a1e with merge base 9a30bd3 (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness 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.

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.

2 participants