-
Notifications
You must be signed in to change notification settings - Fork 84
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
Fuse Split-Reduce with MLIR #3319
Merged
Merged
Changes from all commits
Commits
Show all changes
195 commits
Select commit
Hold shift + click to select a range
7e24411
Add atomic ops
pfultz2 244d8b8
Add missing header
pfultz2 c53c40a
Add support for half type
pfultz2 d39f832
Add fuse mthods to module
pfultz2 d2d3bae
Format
pfultz2 af83509
Add some initial code
pfultz2 ac47954
Format
pfultz2 c9407aa
Reuse find_inputs
pfultz2 ea41fb9
Format
pfultz2 15c06b5
Merge branch 'develop' into split-reduce2
pfultz2 3931cfc
Handle two reductions
pfultz2 0370543
Format
pfultz2 d4db0f6
Handle multi outputs in split reduce
pfultz2 5b37853
Format
pfultz2 ac747b2
Split two reductions
pfultz2 2f7e96c
Format
pfultz2 acb291b
Merge
pfultz2 c6a7caa
Add split fix
pfultz2 25442a5
Fix bug with live instruction after split
pfultz2 3b04922
Format
pfultz2 1cfa65e
Remove debug prints
pfultz2 61d788c
Enable with env var
pfultz2 cad9d3d
Merge branch 'develop' into mlir-fuse-inputs
pfultz2 52a6a0e
Merge branch 'develop' into mlir-fuse-inputs
pfultz2 6533429
Fix merge conflict
pfultz2 36af65c
Merge branch 'develop' into split-reduce2
pfultz2 78161de
Use reaches
pfultz2 166f7c9
Merge branch 'develop' into split-reduce2
pfultz2 6647d4b
Remvoe dominator
pfultz2 66e9d31
Update comments
pfultz2 9107b26
Format
pfultz2 cbf3afc
Fix param_utils
pfultz2 3947949
Filter supported ops
pfultz2 ffdba3c
Add another comment
pfultz2 019bb0d
Add test for multi out split reduce
pfultz2 c33f7fd
Format
pfultz2 86df8f1
Add dominator back
pfultz2 7e5babf
Format
pfultz2 6f99033
Merge
pfultz2 48712c9
Handle scalars
pfultz2 c3cf902
Format
pfultz2 28b013e
Merge
pfultz2 d40bbae
Merge branch 'develop' into split-reduce2
pfultz2 f9df6fa
Merge branch 'develop' into mlir-fuse-inputs
pfultz2 51d3ea9
Add description
pfultz2 0e60085
Update src/targets/gpu/fuse_mlir.cpp
causten fd0b7f7
Add doc
pfultz2 43ff58b
Merge branch 'develop' into split-reduce2
pfultz2 9c4d659
Add input fusion to jenkins
pfultz2 5eaaed3
Add unit test for fuse module
pfultz2 1edac2d
Format
pfultz2 4a825cb
Merge branch 'develop' into mlir-fuse-inputs
causten 1ebdaf1
Add unit test
pfultz2 d035f3b
Format
pfultz2 8c4b8f0
Rename type
pfultz2 271ea78
Add verify test
pfultz2 43e76f5
Format
pfultz2 b357f94
Fix tidy issue
pfultz2 fbb630e
Fix tidy
pfultz2 a3ff01a
Format
pfultz2 7686c3d
Merge branch 'develop' into split-reduce2
pfultz2 5e848ba
Fix parameter name
pfultz2 c7ff9a7
Merge branch 'split-reduce2' of github.com:ROCmSoftwarePlatform/AMDMI…
pfultz2 3964597
Add line
pfultz2 efb1f76
Format
pfultz2 f3b2b95
Merge branch 'develop' into split-reduce2
causten ee50c26
Merge branch 'develop' into mlir-fuse-inputs
causten c0c51c5
Merge branch 'develop' into split-reduce2
causten 5a7f247
Merge branch 'develop' into mlir-fuse-inputs
umangyadav ae29e39
add reshapes to fused mlir
umangyadav 470984d
use fuse instead of fold_pointwise
umangyadav 593b119
Passes make check
umangyadav d49cfe3
pull in changes for find_dot_slice
umangyadav c12c6bc
add unittest
umangyadav 55c3c6d
add verify test
umangyadav 1f76cc5
debugging
umangyadav a238d2a
add lowering for contiguous
umangyadav e26120b
use input_rep_map
umangyadav c8b06d5
add eliminate_contiguous
umangyadav 64642c9
Add lowering for reshape
umangyadav 0149594
Merge branch 'develop' into mlir-reshape
umangyadav 886fc1b
Fix cppcheck
umangyadav 04e37ad
fix tidy
umangyadav e533627
Merge branch 'develop' into mlir-reshape
umangyadav 2409622
fixes
umangyadav 8a008b6
rename test file
umangyadav 2a75820
formatting
umangyadav 96ac474
fix SLES
umangyadav 7a65f2e
Merge branch 'develop' into mlir-reshape
umangyadav a46bbaa
fix test
umangyadav f4b3211
Merge branch 'develop' into mlir-reshape
umangyadav b88f6bd
use anonymous namespace
umangyadav 518fce3
Merge branch 'develop' into mlir-reshape
umangyadav c9f5201
multi use case
umangyadav 8a44a13
fix replace
umangyadav c984b83
clean up
umangyadav ea3fdb7
add test
umangyadav 329955b
add multi use case
umangyadav d14cd66
revert test change
umangyadav 1e981a2
add verify test
umangyadav 2a1c4cd
fix return
umangyadav 9a9c2c4
Foramtting
umangyadav 9c50be6
Merge branch 'add_multi_use' into mlir-split-reduce
umangyadav bb76528
Add missing elipsis
pfultz2 51d3c5f
Add licenses
pfultz2 cb909a4
Format
pfultz2 3f4ef63
split-reduce fusion working
umangyadav 374e74b
Merge branch 'develop' into split-reduce2
pfultz2 0f785f0
Update test/split_reduce.cpp
pfultz2 97e4861
Update test/split_reduce.cpp
pfultz2 32140c9
Fix test
pfultz2 daa607c
Format
pfultz2 bca36d8
Merge branch 'split-reduce2' of github.com:ROCmSoftwarePlatform/AMDMI…
pfultz2 94d9456
refactor pieces
umangyadav 072f8dc
formatting
umangyadav 0a2a8d8
renamed
umangyadav 0a06260
refactor
umangyadav dff3dd4
remove debug
umangyadav ff94e04
add logic for checking is mlir_split_reduce
umangyadav 9540c78
add logic for is_reduce in header files
umangyadav 00fef22
Format
pfultz2 207f94e
add TODO
umangyadav f022edb
add assert
umangyadav 1397e09
Merge branch 'develop' into mlir-reshape
umangyadav 244e62e
remove else
umangyadav e4c9eb9
remove else
umangyadav ba53ce4
Merge branch 'develop' into split-reduce2
causten 64ed1ec
Merge branch 'develop' into mlir-reshape
umangyadav cd8762f
Merge branch 'mlir-reshape' into add_multi_use
umangyadav 7e356a6
Merge branch 'develop' into mlir-reshape
umangyadav 6b81657
Merge branch 'mlir-reshape' into add_multi_use
umangyadav a1c5ad7
use mlir for the reshapes
umangyadav ca11ca4
fuse reshapes with dot
umangyadav 9a7aa0b
remove header
umangyadav d3ab2af
remove changes for module split
umangyadav 2e7c2d8
Merge branch 'mlir-reshape' into add_multi_use
umangyadav 83fd160
flatten outputs
umangyadav a784df3
Merge branch 'add_multi_use' into mlir-split-reduce
umangyadav 5d9fe2a
Merge branch 'split-reduce2' into mlir-split-reduce
umangyadav 662a29d
disable test
umangyadav d4dd7af
remove TODO
umangyadav c1cba50
Update TODO
pfultz2 805793d
add verify test
umangyadav 74496ba
Merge branch 'develop' into split-reduce2
umangyadav fd5a9a1
increase reduce limite, disable rewrite_reduce to reduce_sum
umangyadav bd1eca3
Get correct data type for lane reductions
pfultz2 06f54fa
Merge remote-tracking branch 'origin/lane-parallel-reduce' into mlir-…
umangyadav c5032ff
Merge remote-tracking branch 'origin/split-reduce2' into mlir-split-r…
umangyadav 631127a
enable test again
umangyadav e82daf1
revert back split size
umangyadav eb4f262
add MIGRAPHX_EXPORT For the reaches
umangyadav 4589e09
Merge branch 'split-reduce2' into mlir-split-reduce
umangyadav 1ac328b
add test for the MLIR slow bench
umangyadav ddbf8ba
Merge branch 'develop' into add_multi_use
umangyadav 68a8afb
fix merge
umangyadav 7e83db3
fix unit-test
umangyadav ec3dc3f
Merge branch 'add_multi_use' into mlir-split-reduce
umangyadav c5b70b7
merge fixes
umangyadav ca7df92
fix return bug enable rewrite_reduce
umangyadav 9f56e6a
fix wiring
umangyadav f1550b1
fix output shape
umangyadav f276db5
remove debug prints
umangyadav 2076920
add env flag for the reduce fusion
umangyadav 43a22e5
add doc
umangyadav a4d546d
formatting
umangyadav c64d2ee
fix cppcheck
umangyadav 40325f9
update problem_key && jenkins
umangyadav 67ea3c6
change EPS
umangyadav 8ebbb0e
Merge remote-tracking branch 'origin/develop' into mlir-split-reduce
umangyadav ece936f
Merge branch 'develop' into mlir-split-reduce
umangyadav c5c4c72
Merge branch 'develop' into mlir-split-reduce
umangyadav 5b51efd
merge fixes
umangyadav 5e828ee
fix tidy
umangyadav 6e78168
Merge branch 'develop' into mlir-split-reduce
umangyadav 69fef78
change EPS For half and fp8
umangyadav 70063f9
Merge branch 'develop' into mlir-split-reduce
umangyadav 34c539f
Merge branch 'develop' into mlir-split-reduce
umangyadav 1ebf2a3
address review comments
umangyadav 102a246
formattimg
umangyadav f967f7d
Merge remote-tracking branch 'origin/develop' into mlir-split-reduce
umangyadav 335be33
address review comments, add dump_mlir test
umangyadav 112b14a
formatting
umangyadav 57c550e
fix typo
umangyadav b02eb78
fix tidy
umangyadav 86b98aa
add test
umangyadav df96690
add reduce.hpp header
umangyadav 8e0acd0
add multi use unit-test
umangyadav a5733c5
fix licensing
umangyadav 93d24bf
Merge branch 'develop' into mlir-split-reduce
umangyadav 070da3d
revert problem_key changes
umangyadav dc71b68
add one more test
umangyadav 1b68e45
use auto_add_return
umangyadav 4e043c7
use `insert_inline()`
umangyadav 848d807
fix cppcheck
umangyadav 94e112a
Formatting
umangyadav 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 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 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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,8 @@ inline namespace MIGRAPHX_INLINE_NS { | |
struct module; | ||
namespace gpu { | ||
|
||
MIGRAPHX_GPU_EXPORT std::string dump_mlir(const module& m); | ||
MIGRAPHX_GPU_EXPORT std::string dump_mlir(const module& m, const std::vector<shape>& inputs); | ||
MIGRAPHX_GPU_EXPORT std::string dump_mlir(module m); | ||
MIGRAPHX_GPU_EXPORT std::string dump_mlir(module m, const std::vector<shape>& inputs); | ||
|
||
MIGRAPHX_GPU_EXPORT bool | ||
is_module_fusible(const module& m, const context& migraphx_ctx, const value& solution); | ||
|
@@ -50,6 +50,8 @@ struct MIGRAPHX_GPU_EXPORT mlir_code_object | |
std::vector<value> prefill_values = {}; | ||
}; | ||
|
||
MIGRAPHX_GPU_EXPORT bool is_reduce(const instruction& ins); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont see this used outside of mlir.cpp. I think it can be removed from the header. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is being used on both |
||
|
||
MIGRAPHX_GPU_EXPORT mlir_code_object compile_mlir(const context& migraphx_ctx, | ||
module m, | ||
const std::vector<shape>& in_shapes, | ||
|
This file contains 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 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.
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.
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.
Why is this flipped?
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.
There are cases where same input instruction is mapped to multiple parameters.
e.g.
split_fused_reduce(x, y, x)
In those cases, having mapping from
input--> param
would de-duplicate it and only add single parameter.Later
AMDMIGraphX/src/module.cpp
Line 238 in ae2b026
Here it won't find parameter in the
map_ins
and would try to add it and fails