Skip to content

Remove legacy fusion heuristics. - #10579

Merged
MaheshRavishankar merged 4 commits into
iree-org:mainfrom
MaheshRavishankar:remove_legacy_fusion_heuristics
Sep 29, 2022
Merged

MaheshRavishankar merged 4 commits into
iree-org:mainfrom
MaheshRavishankar:remove_legacy_fusion_heuristics

Conversation

@MaheshRavishankar

Copy link
Copy Markdown
Collaborator

The advanced fusion heuristics added to dispatch region formation supercedes legacy heuristics added. Deprecate those heuristics to enable parts of the advanced heuristics by default.

Fixes #9772

The advanced fusion heuristics added to dispatch region formation
supercedes legacy heuristics added. Deprecate those heuristics to
enable parts of the advanced heuristics by default.

Fixes iree-org#9772
@iree-github-actions-bot

iree-github-actions-bot commented Sep 29, 2022 •

Copy link
Copy Markdown
Contributor

Abbreviated Linux Benchmark Summary

@ commit 2a243eb22e94c08169d779920f08498599b3db9f (vs. base 954705072ef4d46971c5a73eb9d6b61a968a463a)

No improved or regressed benchmarks 🏖️

Improved Compilation Times 🎉

Benchmark Name Compilation Time (ms)
MobileNetV1 [fp32,imagenet] (TFLite) CPU-RV64-Generic full-inference,default-flags 12526 (vs. 13451, 6.88%↓)
MiniLML12H384Uncased [int32,seqlen128] (TF) CPU-x86\_64-CascadeLake 8-thread,full-inference,default-flags 6889 (vs. 7372, 6.55%↓)
MiniLML12H384Uncased [int32,seqlen128] (TF) CPU-x86\_64-CascadeLake full-inference,default-flags 6889 (vs. 7372, 6.55%↓)

[Top 3 out of 6 results showed]

Improved Total Dispatch Sizes 🎉

Benchmark Name Total Dispatch Size (bytes)
MobileNetV1 [fp32,imagenet] (TFLite) CPU-RV64-Generic full-inference,default-flags 33824 (vs. 47952, 29.46%↓)

For more information:

…ior.

Specifically only fuse producer with consumer if the consumer
iteration space has the same rank as the producer.
AffineMap outsOperandIndexingMap = linalgOp.getTiedIndexingMap(outsOperand);

if (outsOperandIndexingMap != insOperandIndexingMap) {
// if (!aggressiveFusion) return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this check? It's to make sure that when aggressiveFusion is disabled, we won't generate stack buffer.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a compile time check for large allocations. So whatever is within that limit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I guess we can remove the argument aggressiveFusion from isInsOperandBufferizable?

@@ -1,2 +1,4 @@
# XFAIL: *
# Failing due to Issue #9802

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a check to not fuse dynamic shape right now to make the test pass?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its really a backend bug. There is an issue tracking it, just fixing it isnt high priority. Since the CPU side passes, i'd rather disable the vulkan test. When needed the SPIR-V side can be fixed.

@iree-github-actions-bot

Copy link
Copy Markdown
Contributor

Abbreviated Benchmark Summary

@ commit 2a243eb22e94c08169d779920f08498599b3db9f (vs. base 954705072ef4d46971c5a73eb9d6b61a968a463a)

Regressed Latencies 🚩

Benchmark Name Average Latency (ms) Median Latency (ms) Latency Standard Deviation (ms)
MobileSSD [fp32] (TFLite) 4-thread,big-core,full-inference,experimental-flags with IREE-LLVM-CPU @ Pixel-4 (CPU-ARMv8.2-A) 50.969 (vs. 46.385, 9.88%↑) 50.986 0.056
MobileNetV3Small [fp32,imagenet] (TFLite) 4-thread,big-core,full-inference,experimental-flags with IREE-LLVM-CPU @ Pixel-4 (CPU-ARMv8.2-A) 9.266 (vs. 8.519, 8.76%↑) 9.110 0.495
PoseNet [fp32] (TFLite) 4-thread,big-core,full-inference,experimental-flags with IREE-LLVM-CPU @ Pixel-4 (CPU-ARMv8.2-A) 28.014 (vs. 26.180, 7.01%↑) 28.010 0.064

[Top 3 out of 10 results showed]

No improved or regressed compilation metrics 🏖️

For more information:

@MaheshRavishankar
MaheshRavishankar merged commit 1631fdf into iree-org:main Sep 29, 2022
@MaheshRavishankar
MaheshRavishankar deleted the remove_legacy_fusion_heuristics branch September 29, 2022 22:16
jpienaar pushed a commit to jpienaar/iree that referenced this pull request Oct 3, 2022
The advanced fusion heuristics added to dispatch region formation supercedes legacy heuristics added. Deprecate those heuristics to enable parts of the advanced heuristics by default.

Fixes iree-org#9772
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flow] Extend reduction fusion by relaxing the existing conditions

3 participants