Adding compilation mode - #4770
Conversation
This reverts commit 0160c2b.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ming and cppcheck warnings
|
| pipelines = { | ||
| p.dynamic_shapes_pipeline(), | ||
| p.required_pipeline(), | ||
| {optimize_module{}, |
There was a problem hiding this comment.
I dont think we want to run optimize_module in eager mode.
There was a problem hiding this comment.
If optimize_module is not included logsoftmax test fails. If we return it than we lose time improvements from eager mode, so I want to exclude it.
I didn't see this problem when testing with models, so can we skip this test right now, since you mentioned it will be removed.
There was a problem hiding this comment.
I see the verification fails because it runs log(softmax(x)) without simplify_algebra. We could update rewrite_reduce to generate the logsoftmax correctly so simplify_algebra is not needed.
There was a problem hiding this comment.
Because this requires additional work I want to leave it for next iterations, I have reverted all changes regarding removing passes, that will be handled in future tasks. Right now, in eager mode we have kernel benchmarking removed.
There was a problem hiding this comment.
Adding only simplify_algebra does not solve failing for those tests, in order to add rewrite_reduce and rewrite_topk, optimize_module also needs to be added in order for tests to pass.
There was a problem hiding this comment.
This has optimize_module before rewrite. But arent you going to add simplify_algebra after rewrite_reduce? You added the header for it but I dont see it being used.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…nto compile-modes
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
||
| // Eager mode drops precision-preserving passes (rewrite_low_precision, propagate_precision, | ||
| // rewrite_gelu) | ||
| rv.disable_eager_tests({"test_topk", "test_softmax", "test_logsoftmax"}); |
There was a problem hiding this comment.
These tests should not be disabled.
| test::add_test_case(p.name, [=] { verify(p); }); | ||
| test::add_test_case(p.name, [=] { verify(p, migraphx::compile_modes::balanced); }); | ||
|
|
||
| if(check_skipped_eager_tests(p.name)) |
There was a problem hiding this comment.
Remove this as well, we shouldnt be disabling a test for a compile mode.
…ny passes for now
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…nto compile-modes
|
To fix the CI failures, you can probably disable |
Motivation
Adding compilation mode which defines factor between compilation time and quality of model optimization. This is defined by compile option "compile_mode" which is defined by int value 0-100 (0 - fast, minimal/no optimization, 100 slow, best optimization quality).
Technical Details
compile_mode is represented by enum class compile_modes, and int value is mapped in the closest value. There are three modes defined for now (more fine-grained system can be implemented later):
Tested on both platforms, Eager mode improves compilation time up to 10x while decreasing inference performance for 20-50%.
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable