Skip to content
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

[js/web] Add support for int4/uint4 tensor #21720

Merged
merged 2 commits into from
Aug 16, 2024
Merged

[js/web] Add support for int4/uint4 tensor #21720

merged 2 commits into from
Aug 16, 2024

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Aug 13, 2024

Description

Add support for int4/uint4 tensor.

@satyajandhyala
Copy link
Contributor

satyajandhyala commented Aug 15, 2024

Do we need to add int4 and uint4 data types in js/node/src/tensor_helper.cc also?
I was trying here

static_assert(ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT4 == 21, "definition not consistent with OnnxRuntime");

@fs-eire
Copy link
Contributor Author

fs-eire commented Aug 15, 2024

Do we need to add int4 and uint4 data types in js/node/src/tensor_helper.cc also? I was trying here

static_assert(ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT4 == 21, "definition not consistent with OnnxRuntime");

I probably do another change for this. the change may be larger than expected, because it's also using element_size for tensor size calculating, which does not work for (u)int4. (you cannot assign 0.5 to size_t)

@fs-eire fs-eire merged commit ef2ccc4 into main Aug 16, 2024
95 of 97 checks passed
@fs-eire fs-eire deleted the js/int4 branch August 16, 2024 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants