-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add Int4 and UInt4 support for Cast #24973
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
2ac57eb
implement TensorCaster specializations for int4/uint4
amarin16 e8dc543
Create unit tests
amarin16 a4dc230
update shape inside tests
amarin16 6d0c033
fix bug in tests
amarin16 4979206
update test names
amarin16 6e34f5b
Add CastTo/FromString and TensorCasterNoSat specializations
amarin16 61d50d8
fix warning
amarin16 2487411
apply lintrunner
amarin16 e2f6f02
output low nibble first
amarin16 4ffef5f
Update to use Rv10 instead of Rv9 (breaks build)
amarin16 e0079c0
more than 1 partial specialization
amarin16 6157a9d
cannot convert OldType to NewType
amarin16 8cd5237
remove macros, expand specializations
amarin16 5e23ee2
merge together similar specializations
amarin16 9d50386
remove unused aliases
amarin16 8474ca7
clean up template specializations
amarin16 1ddcb96
reuse existing aliases, refactor for consistency
amarin16 1d02ca1
fix multiple partial specializations issue for MLFloat16
amarin16 406666f
clean up std::string specializtions
amarin16 13a9c17
Add specializations for Int4x2 -> UInt4x2 and UInt4x2 -> Int4x2
amarin16 bcb2412
more concise Int4ElementConverter
amarin16 cb205e5
more concise ToInt4ElementConverter
amarin16 1e8f680
merge a few TensorCaster specializations
amarin16 2d1ca00
merge a few more TensorCaster specializations
amarin16 18b3b11
styling suggestions, lint
amarin16 8ceae1b
update iterations over the input
amarin16 bb806e4
update iteration
amarin16 6825974
Update opset in unit tests to support int4
amarin16 b980762
Add unit tests
amarin16 207e5df
add more unit tests
amarin16 8ab0161
update string implementation and add tests
amarin16 c81c502
lint
amarin16 7e4ce01
add MLFloat16 tests
amarin16 6ec215c
update iteration, add test for odd elements
amarin16 b39a4f4
add specialization from float to MLFloat16
amarin16 351626e
try to fix pipeline errors
amarin16 3b84c14
lint
amarin16 b5ecbf9
Try [[noreturn]] to fix pipelines
amarin16 b19df98
supress 4702 warning
amarin16 77b1916
try pipeline fix
amarin16 8381956
lint
amarin16 3d9be2f
disable warning
amarin16 9ce545a
move pragma statements
amarin16 082ae75
update pragma
amarin16 234e7f0
Merge branch 'main' into dev/emarin/cast_int4
amarin16 c70e7f3
Update docs for Cast
amarin16 950a8e3
Update onnx patch
amarin16 41af71b
update patch
amarin16 5b79476
update patch
amarin16 b39c660
keep binskim.patch in sync with onnx.patch
amarin16 10b2eea
update patches
amarin16 c89e11f
exclude onnx tests in TestCase.cc
amarin16 da7e444
remove patch fixes
amarin16 408ae63
merge main
amarin16 be31bdd
Add newline at end of patch files
amarin16 ea2956c
explicitly mention next onnx version in skipped tests
amarin16 989719a
use std::is_floating_point_v
amarin16 e2be244
use constants for min anx max (u)int4 values
amarin16 c7c05fa
use constexpr if to merge specializations
amarin16 3932199
use constexpr if to merge specializations for Int4
amarin16 5e00b26
remove extra line
amarin16 af00c7d
remove anonymous namespace
amarin16 fe03e23
update IsOrtFloat8Type usage
amarin16 d382f2c
update cast between int4x2 and uint4x2 and tests, add Int4x2ToUInt64 …
amarin16 82b1fb5
Update cast down implementation and tests
amarin16 f1f4e2e
Fix pipeline issue
amarin16 2b4c325
fix pipeline issue
amarin16 18521cc
debug pipeline issue
amarin16 de3c01b
rename
amarin16 0dfb771
remove debugging tests
amarin16 338c440
lint
amarin16 1a22e4b
Merge branch 'main' into dev/emarin/cast_int4
amarin16 6d76f96
Update TensorCasterNoSat for Int4/UInt4, add tests with saturate = false
amarin16 6cbeea4
Add comments, extract common logic into lambda
amarin16 ed92b06
extract FromInt4Converter into separate struct, rename converter
amarin16 fad0445
add IsOrtInt4Type, use UnpackedType, merge specializations
amarin16 343a22c
specialize ToInt4Converter for bool, merge TensorCaster from bool spe…
amarin16 195780e
refactor ToInt4Converter, merge TensorCaster to Int4 specializations
amarin16 506a48b
enforce float 8 DstType for TensorCasterNoSat
amarin16 bc9edef
refactor ToInt4Converter, merge specializations
amarin16 4d652f0
Refactor ToInt4Converter, merge specializations
amarin16 27a448a
rename type, update comments
amarin16 fa705d6
small refactor
amarin16 4a65285
update comments, test values
amarin16 226c6dc
Add 2 tests
amarin16 6d97d37
merge int4 -> string specialization with int4 -> numeric
amarin16 be6c176
reuse ToInt4Converter inside string specializations
amarin16 003adae
Merge string -> int4 and string -> uint4 specializations
amarin16 27040c1
parse string as double, add test
amarin16 9a64f1c
Merge string -> int4 with numeric -> int4 specializations
amarin16 416635f
Add test
amarin16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.