-
Notifications
You must be signed in to change notification settings - Fork 539
[Android] Support 16bit output data as raw data byte[] #10412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In java, when the returned dtype is fp16 or bf16, instead of crash, use byte[] to represent these raw data, and let user parse the byte[]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10412
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 833d388 with merge base 98c2c53 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@@ -674,6 +712,10 @@ private static Tensor nativeNewTensor( | |||
tensor = new Tensor_uint8(data, shape); | |||
} else if (DType.INT8.jniCode == dtype) { | |||
tensor = new Tensor_int8(data, shape); | |||
} else if (DType.HALF.jniCode == dtype) { | |||
tensor = new Tensor_raw_data_16b(data, shape, DType.HALF); | |||
} else if (DType.HALF.jniCode == dtype) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is same check as L715, should be DType.BFLOAT16.jniCode == dtype?
Per discussion, we use #10414 instead. Don't support it as output data type. |
In java, when the returned dtype is fp16 or bf16, instead of crash, use byte[] to represent these raw data, and let user parse the byte[]
We don't support fp16 or bf16 as input dtype. User can convert to fp32.
Resolved: #9881
Resolved: #10371
cc @cbilgin @guangy10 @huydhn @shoumikhin