-
Notifications
You must be signed in to change notification settings - Fork 14
Adds INT2 (2-bit signed) and UINT2 (2-bit unsigned) data type #251
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: vraspar <[email protected]>
…them yet Co-authored-by: vraspar <[email protected]>
Co-authored-by: vraspar <[email protected]>
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| This function is used for serializing the tensor to bytes. It handles the | ||
| special cases for 4-bit data types and endianness. | ||
| special cases for 2-bit and 4-bit data types and endianness. |
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.
I realized we don’t need to handle endianess because these are subtbyte types. So endianess is irrelevant
|
@vraspar could you check the test errors? Thanks |
Signed-off-by: Justin Chu <[email protected]>
Adds INT2 (2-bit signed) and UINT2 (2-bit unsigned) data types following ONNX spec PR #7446. These complement existing INT4/UINT4 support with similar packed representation.
Changes
Enums (
_enums.py)Packing (
_type_casting.py)pack_2bitx4()/unpack_2bitx4()for 4-values-per-byte packingCore (
_core.py)Serialization (
serde.py)Torch adapters (
tensor_adapters.py)Example
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.