Skip to content

feat(core): add fp16 dtype representation - #1632

Merged
IgorSwat merged 1 commit into
mainfrom
@is/fp16-dtype
Nov 11, 2026
Merged

IgorSwat merged 1 commit into
mainfrom
@is/fp16-dtype

Conversation

@IgorSwat

@IgorSwat IgorSwat commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds fp16 dtype as a new available tensor dtype. This is for the purpose of memory efficiency of one of the upcoming models.

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

Added the native test TensorTest.Float16TransfersRawHalfBitsAsUint16, which can be run with scripts/run-native-tests.sh -R TensorTest from packages/react-native-executorch.

Screenshots

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

Note that there is no built-in float16 representation in JS, so Uint16Array was used instead.

@IgorSwat
IgorSwat requested a review from barhanc November 11, 2026 21:34
@barhanc barhanc added core feature PRs that implement a new feature labels Nov 11, 2026

@barhanc barhanc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@IgorSwat
IgorSwat merged commit d0ddb0b into main Nov 11, 2026
8 checks passed
@IgorSwat
IgorSwat deleted the @is/fp16-dtype branch November 11, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core feature PRs that implement a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants