pytorch / pytorch/executorch

Android: Tensor type is not very friendly to BFloat16

Open
#6,571 6 comments 2 reactions 1 assignee View on GitHub

@kirklandsign is already working on this.

Since Feb 7, 2025.

module: android triaged
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🐛 Describe the bug

After https://github.com/pytorch/executorch/issues/6284#issuecomment-2423431020 patch that original UTF-8 invalid character issue had fixed,there is a new issue in tensor type support.

Llama3.2 1B/3B Model BF16 dtype
A large number of the following logcat logs will appear during the session, and the output is truncated or not displayed
E 00:00:02.486051 executorch:tensor_util.h:482] Check failed (t.scalar_type() == dtype): Expected to find Half type, but tensor has type BFloat16
E 00:00:02.496141 executorch:tensor_util.h:482] Check failed (t.scalar_type() == dtype): Expected to find Float type, but tensor has type BFloat16

Llama3.2 1B/3B SpinQuant Model FP32 dtype
Conversations and emoji can be output completely, without truncation or non-display, and logcat does not show the above errors

Versions

master version

cc @kirklandsign

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.