onnxruntime
Add Int4 and UInt4 support for Cast
#24973
Merged

Add Int4 and UInt4 support for Cast #24973

amarin16 merged 91 commits into main from dev/emarin/cast_int4
amarin16
amarin16 implement TensorCaster specializations for int4/uint4
2ac57eb7
amarin16 Create unit tests
e8dc543a
amarin16 update shape inside tests
a4dc2303
amarin16 fix bug in tests
6d0c0339
github-actions
github-actions commented on 2025-06-06
jywu-msft jywu-msft requested a review from hariharans29 hariharans29 1 year ago
tianleiwu
tianleiwu commented on 2025-06-06
amarin16 update test names
49792061
amarin16 Add CastTo/FromString and TensorCasterNoSat specializations
6e34f5b6
amarin16 fix warning
61d50d8c
amarin16 apply lintrunner
24874115
amarin16 output low nibble first
e2f6f028
amarin16 Update to use Rv10 instead of Rv9 (breaks build)
4ffef5f7
amarin16 more than 1 partial specialization
e0079c0a
amarin16 cannot convert OldType to NewType
6157a9df
amarin16 remove macros, expand specializations
8cd52370
amarin16 merge together similar specializations
5e23ee2c
amarin16 remove unused aliases
9d50386e
amarin16 clean up template specializations
8474ca73
amarin16 reuse existing aliases, refactor for consistency
1ddcb968
amarin16 fix multiple partial specializations issue for MLFloat16
1d02ca1d
amarin16 clean up std::string specializtions
406666fc
amarin16 Add specializations for Int4x2 -> UInt4x2 and UInt4x2 -> Int4x2
13a9c179
amarin16 more concise Int4ElementConverter
bcb24127
amarin16 more concise ToInt4ElementConverter
cb205e5d
amarin16 merge a few TensorCaster specializations
1e8f6809
amarin16 merge a few more TensorCaster specializations
2d1ca00b
github-actions
github-actions commented on 2025-06-09
amarin16 styling suggestions, lint
18b3b11c
amarin16 update iterations over the input
8ceae1b6
amarin16 update iteration
bb806e43
amarin16 Update opset in unit tests to support int4
68259740
amarin16 amarin16 marked this pull request as ready for review 1 year ago
hariharans29
hariharans29 commented on 2025-06-10
amarin16 Add unit tests
b9807628
github-actions
github-actions commented on 2025-06-10
amarin16 add more unit tests
207e5df0
amarin16 update string implementation and add tests
8ab01619
amarin16 lint
c81c5021
amarin16 add MLFloat16 tests
7e4ce012
amarin16 update iteration, add test for odd elements
6ec215c8
amarin16 add specialization from float to MLFloat16
b39a4f43
amarin16 try to fix pipeline errors
351626ef
github-actions
github-actions commented on 2025-06-12
amarin16 lint
3b84c142
amarin16 Try [[noreturn]] to fix pipelines
b5ecbf9a
amarin16 supress 4702 warning
b19df98a
amarin16 try pipeline fix
77b1916b
github-actions
github-actions commented on 2025-06-13
amarin16 lint
83819568
amarin16 disable warning
3d9be2fe
amarin16 move pragma statements
9ce545aa
amarin16 update pragma
082ae757
amarin16 Merge branch 'main' into dev/emarin/cast_int4
234e7f04
amarin16 Update docs for Cast
c70e7f3a
amarin16 Update onnx patch
950a8e32
amarin16 update patch
41af71b6
amarin16 update patch
5b794763
amarin16 keep binskim.patch in sync with onnx.patch
b39c660a
amarin16 update patches
10b2eea2
amarin16 exclude onnx tests in TestCase.cc
c89e11f3
amarin16 remove patch fixes
da7e4448
amarin16 merge main
408ae63b
amarin16 Add newline at end of patch files
be31bdd2
amarin16 amarin16 requested a review from hariharans29 hariharans29 345 days ago
amarin16 amarin16 requested a review from edgchen1 edgchen1 345 days ago
amarin16 amarin16 requested a review from adrianlizarraga adrianlizarraga 345 days ago
edgchen1
edgchen1 commented on 2025-07-01
edgchen1
edgchen1 commented on 2025-07-01
amarin16 explicitly mention next onnx version in skipped tests
ea2956c3
amarin16 use std::is_floating_point_v
989719a1
amarin16 use constants for min anx max (u)int4 values
e2be2442
amarin16 use constexpr if to merge specializations
c7c05faa
amarin16 use constexpr if to merge specializations for Int4
39321998
amarin16 remove extra line
5e00b26f
edgchen1
edgchen1 commented on 2025-07-04
amarin16 remove anonymous namespace
af00c7df
amarin16 update IsOrtFloat8Type usage
fe03e231
adrianlizarraga
adrianlizarraga commented on 2025-07-07
amarin16 update cast between int4x2 and uint4x2 and tests, add Int4x2ToUInt64 …
d382f2c9
github-actions
github-actions commented on 2025-07-07
amarin16 Update cast down implementation and tests
82b1fb5c
amarin16 Fix pipeline issue
f1f4e2e8
amarin16 fix pipeline issue
2b4c325c
amarin16 debug pipeline issue
18521cc9
amarin16 rename
de3c01be
amarin16 remove debugging tests
0dfb771e
github-actions
github-actions commented on 2025-07-10
github-advanced-security
github-advanced-security commented on 2025-07-10
amarin16 lint
338c4408
amarin16 Merge branch 'main' into dev/emarin/cast_int4
1a22e4ba
amarin16 Update TensorCasterNoSat for Int4/UInt4, add tests with saturate = false
6d76f96f
amarin16 Add comments, extract common logic into lambda
6cbeea49
amarin16 extract FromInt4Converter into separate struct, rename converter
ed92b066
amarin16 add IsOrtInt4Type, use UnpackedType, merge specializations
fad04455
amarin16 specialize ToInt4Converter for bool, merge TensorCaster from bool spe…
343a22c3
amarin16 refactor ToInt4Converter, merge TensorCaster to Int4 specializations
195780ed
amarin16 enforce float 8 DstType for TensorCasterNoSat
506a48b7
amarin16 refactor ToInt4Converter, merge specializations
bc9edef1
amarin16 Refactor ToInt4Converter, merge specializations
4d652f04
amarin16 rename type, update comments
27a448af
amarin16 small refactor
fa705d63
amarin16 update comments, test values
4a65285d
amarin16 Add 2 tests
226c6dc3
amarin16 merge int4 -> string specialization with int4 -> numeric
6d97d37a
amarin16 reuse ToInt4Converter inside string specializations
be6c1767
amarin16 Merge string -> int4 and string -> uint4 specializations
003adaeb
amarin16 parse string as double, add test
27040c1f
amarin16 Merge string -> int4 with numeric -> int4 specializations
9a64f1cc
tianleiwu
tianleiwu commented on 2025-07-22
amarin16 Add test
416635f8
tianleiwu
tianleiwu commented on 2025-07-22
tianleiwu
tianleiwu approved these changes on 2025-07-22
amarin16 amarin16 merged 51b678f8 into main 323 days ago
amarin16 amarin16 deleted the dev/emarin/cast_int4 branch 323 days ago

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone