Skip to content

Translate flow.tensor.empty to stream.tensor.empty. - #11131

Merged
benvanik merged 1 commit into
mainfrom
benvanik-empty-uninit
Nov 14, 2022
Merged

benvanik merged 1 commit into
mainfrom
benvanik-empty-uninit

Conversation

@benvanik

@benvanik benvanik commented Nov 11, 2022 •

Copy link
Copy Markdown
Collaborator

I believe this matches the expected behavior of tensor.empty as @silvasean pointed out in #8717. I've added the
--iree-flow-zero-fill-empty-tensors= flag to allow an override if we notice user programs that assume the contents are zero-filled.

On ESRGAN this saves nearly 1GB of memset(0)'s per invocation:
Original fill count: 627 size: 2004094976 (2GB)
New fill count: 351 size: 1117008896 (1.1GB)

Workaround for #6972. We still want generalized tracking but this will cover concats (the most common producers of this pattern).
Progress on #7729.

@benvanik benvanik added compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) performance ⚡ Performance/optimization related work across the compiler and runtime labels Nov 11, 2022
@benvanik
benvanik force-pushed the benvanik-empty-uninit branch from bd0856c to 5797dfd Compare November 11, 2022 19:10
I believe this matches the expected behavior of tensor.empty as
@silvasean pointed out in #8717. I've added the
`--iree-flow-zero-fill-empty-tensors=` flag to allow an override if we
notice user programs that assume the contents are zero-filled.

On ESRGAN this saves nearly 1GB of memset(0)'s per invocation:
- old fill count: 627 size: 2004094976 (2GB)
- new fill count: 351 size: 1117008896 (1.1GB)

Workaround for #6972. We still want generalized tracking but this will
cover concats (the most common producers of this pattern).
Progress on #7729.
@iree-github-actions-bot

Copy link
Copy Markdown
Contributor

Abbreviated Linux Benchmark Summary

@ commit eb68a638c8c26ef2f4acbb98004d1a3c213da071 (vs. base a09e5644504542578fb79851b243a943af748687)

No improved or regressed benchmarks 🏖️

Regressed Compilation Times 🚩

Benchmark Name Compilation Time (ms)
MiniLML12H384Uncased [int32,seqlen128] (TF) GPU-CUDA-SM\_80 full-inference,default-flags 7940 (vs. 4628, 71.56%↑)
MobileBertSquad [int8] (TFLite) CPU-RV64-Generic full-inference,default-flags 124976 (vs. 105476, 18.49%↑)

Improved Compilation Times 🎉

Benchmark Name Compilation Time (ms)
MobileNetV2 [fp32,imagenet] (TFLite) CPU-x86\_64-CascadeLake 8-thread,full-inference,experimental-flags 20906 (vs. 29942, 30.18%↓)
MobileNetV2 [fp32,imagenet] (TFLite) CPU-x86\_64-CascadeLake full-inference,experimental-flags 20906 (vs. 29942, 30.18%↓)
MobileNetV2 [fp32,imagenet] (TFLite) CPU-x86\_64-CascadeLake 4-thread,full-inference,experimental-flags 20906 (vs. 29942, 30.18%↓)

[Top 3 out of 84 results showed]

For more information:

@iree-github-actions-bot

Copy link
Copy Markdown
Contributor

Abbreviated Benchmark Summary

@ commit eb68a638c8c26ef2f4acbb98004d1a3c213da071 (vs. base d4aa49f1500b0597adf8f5b828a8d478635b26b1)

Improved 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) 40.180 (vs. 44.290, 9.28%↓) 40.187 0.076

No improved or regressed compilation metrics 🏖️

For more information:

@benvanik
benvanik marked this pull request as ready for review November 11, 2022 22:18

@MaheshRavishankar MaheshRavishankar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, but i'd suggest wait to submit on Monday. This might cause correctness issues out of tree....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) performance ⚡ Performance/optimization related work across the compiler and runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants