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 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures, 3 Unrelated Failures

As of commit 368f131 with merge base fd6fa87 (image):

NEW FAILURES - The following jobs have failed:

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

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.

…, 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]
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.

2 participants