Repository navigation
Moving builtins lower in the pipeline and adding option to force. - #13994
Merged
Merged
Conversation
benvanik
force-pushed
the
benvanik-emulate-splat-fill
branch
2 times, most recently
from
June 7, 2023 23:41
1384be0 to
02c6370
Compare
By moving it after partitioning we can use the resource config local to the partitioned execution region where the ops live to make decisions. To work around the CUDA issue in #13984 a global flag was added to force all splats/fills into builtins that must be passed when graphs are used at runtime.
benvanik
force-pushed
the
benvanik-emulate-splat-fill
branch
from
June 8, 2023 00:20
02c6370 to
bd597a1
Compare
benvanik
marked this pull request as ready for review
June 8, 2023 00:56
benvanik
enabled auto-merge (squash)
June 8, 2023 01:02
antiagainst
approved these changes
Jun 8, 2023
antiagainst
left a comment
Member
There was a problem hiding this comment.
Neat! Nice to have builtins at stream level so we are programing in linalg level; much easier and have the CodeGen flow across all backends!
benvanik
added a commit
that referenced
this pull request
Jun 8, 2023
…3440) These aren't actually async as the CUDA HAL is synchronous but will make use of CUDA's memory pooling features to reduce the alloc/free cost in a way more friendly to CUDA's memory management than just the normal allocator. With this our queue-ordered allocations in CUDA now average a few us (for me) and the caching allocator (or any other) is only needed for caching non-queue-ordered allocations. A few compiler tweaks to switch all allocations to queue-ordered will mean only explicitly allocated buffers (constants/variables, stuff the user does manually, etc) will not route to the pools. It'd also be possible to explore using the same pools the queue-ordered allocations use for explicit synchronous allocations (at least the device-local pool) but it'd be nicer to get those out of the critical path and then keep the pools separate such that the transient pool isn't filled with persistent allocations. Due to #13984 this relies on the `--iree-stream-emulate-memset` flag added in #13994 being set when graphs are enabled. Since this is not the default path today and there's just two test suites using it we just flip the flag for them.
NatashaKnk
pushed a commit
to NatashaKnk/iree
that referenced
this pull request
Jul 6, 2023
…ee-org#13994) By moving it after partitioning we can use the resource config local to the partitioned execution region where the ops live to make decisions. We also are able to preserve the semantics of the ops through partitioning/placement such as whether splats should be rematerialized. To work around the CUDA issue in iree-org#13984 a global flag was added to force all splats/fills into builtins that must be passed when graphs are used at runtime. I was hoping this would make it easier to support `complex<f64>` as well but that doesn't quite fit due to the lack of an `i128` in MLIR. One day. May need to move the canonicalizeFillPattern doing the integer conversion down into MaterializeBuiltins but that would mean removing the verifier on AsyncSplatOp/AsyncFillOp that the type is actually supported and spreads encoding across stages of the pipeline. Still may be worth it for readability but we can re-evaluate when we have a need for `complex<f64>`.
NatashaKnk
pushed a commit
to NatashaKnk/iree
that referenced
this pull request
Jul 6, 2023
…ee-org#13440) These aren't actually async as the CUDA HAL is synchronous but will make use of CUDA's memory pooling features to reduce the alloc/free cost in a way more friendly to CUDA's memory management than just the normal allocator. With this our queue-ordered allocations in CUDA now average a few us (for me) and the caching allocator (or any other) is only needed for caching non-queue-ordered allocations. A few compiler tweaks to switch all allocations to queue-ordered will mean only explicitly allocated buffers (constants/variables, stuff the user does manually, etc) will not route to the pools. It'd also be possible to explore using the same pools the queue-ordered allocations use for explicit synchronous allocations (at least the device-local pool) but it'd be nicer to get those out of the critical path and then keep the pools separate such that the transient pool isn't filled with persistent allocations. Due to iree-org#13984 this relies on the `--iree-stream-emulate-memset` flag added in iree-org#13994 being set when graphs are enabled. Since this is not the default path today and there's just two test suites using it we just flip the flag for them.
nhasabni
pushed a commit
to plaidml/iree
that referenced
this pull request
Aug 24, 2023
…ee-org#13994) By moving it after partitioning we can use the resource config local to the partitioned execution region where the ops live to make decisions. We also are able to preserve the semantics of the ops through partitioning/placement such as whether splats should be rematerialized. To work around the CUDA issue in iree-org#13984 a global flag was added to force all splats/fills into builtins that must be passed when graphs are used at runtime. I was hoping this would make it easier to support `complex<f64>` as well but that doesn't quite fit due to the lack of an `i128` in MLIR. One day. May need to move the canonicalizeFillPattern doing the integer conversion down into MaterializeBuiltins but that would mean removing the verifier on AsyncSplatOp/AsyncFillOp that the type is actually supported and spreads encoding across stages of the pipeline. Still may be worth it for readability but we can re-evaluate when we have a need for `complex<f64>`.
nhasabni
pushed a commit
to plaidml/iree
that referenced
this pull request
Aug 24, 2023
…ee-org#13440) These aren't actually async as the CUDA HAL is synchronous but will make use of CUDA's memory pooling features to reduce the alloc/free cost in a way more friendly to CUDA's memory management than just the normal allocator. With this our queue-ordered allocations in CUDA now average a few us (for me) and the caching allocator (or any other) is only needed for caching non-queue-ordered allocations. A few compiler tweaks to switch all allocations to queue-ordered will mean only explicitly allocated buffers (constants/variables, stuff the user does manually, etc) will not route to the pools. It'd also be possible to explore using the same pools the queue-ordered allocations use for explicit synchronous allocations (at least the device-local pool) but it'd be nicer to get those out of the critical path and then keep the pools separate such that the transient pool isn't filled with persistent allocations. Due to iree-org#13984 this relies on the `--iree-stream-emulate-memset` flag added in iree-org#13994 being set when graphs are enabled. Since this is not the default path today and there's just two test suites using it we just flip the flag for them.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
By moving it after partitioning we can use the resource config local to the partitioned execution region where the ops live to make decisions. We also are able to preserve the semantics of the ops through partitioning/placement such as whether splats should be rematerialized.
To work around the CUDA issue in #13984 a global flag was added to force all splats/fills into builtins that must be passed when graphs are used at runtime.
I was hoping this would make it easier to support
complex<f64>as well but that doesn't quite fit due to the lack of ani128in MLIR. One day. May need to move the canonicalizeFillPattern doing the integer conversion down into MaterializeBuiltins but that would mean removing the verifier on AsyncSplatOp/AsyncFillOp that the type is actually supported and spreads encoding across stages of the pipeline. Still may be worth it for readability but we can re-evaluate when we have a need forcomplex<f64>.