Skip to content

--iree-llvmcpu-enable-ukernels, a fine-grained replacement for --iree-llvmcpu-enable-microkernels - #15571

Merged
bjacob merged 2 commits into
mainfrom
bjacob-fine-grained-ukernel-flag
Nov 14, 2023
Merged

bjacob merged 2 commits into
mainfrom
bjacob-fine-grained-ukernel-flag

Conversation

@bjacob

@bjacob bjacob commented Nov 13, 2023 •

Copy link
Copy Markdown
Collaborator

This introduces a new command-line flag, --iree-llvmcpu-enable-ukernels, as a replacement for the existing --iree-llvmcpu-enable-microkernels, which gets deprecated but temporarily coexists during the transition.

The name ambiguity (only differing by micro vs u substring) is OK as that's part of a general renaming trend and the old flag should get removed quickly.

The problem with the boolean --iree-llvmcpu-enable-microkernels was that our plan was of course to eventually enable it by default, but then that puts a very high bar on any future new ukernel. For now, the only ukernel enabled in LLVMCPU is mmt4d, but the next time that we want to introduce a new ukernel, if that means that all existing codegen users get it while it is still under development, that would be hard.

The new --iree-llvmcpu-enable-ukernels is a string. It has the default value default, which means let the implementation enable whichever set of ukernels is currently default. Currently, that's no ukernel at all, but we hope in the near team to change that default to including the mmt4d ukernel. Other special string values are none and all with the obvious meanings. Any other string is interpreted as a comma-separated list of individual ukernels to enable.

The old boolean flag --iree-llvmcpu-enable-microkernels={false,true} is currently interpreted as --iree-llvmcpu-enable-ukernels={none,all} until it's dropped.

@bjacob bjacob added the benchmarks:x86_64 Run default x86_64 benchmarks label Nov 13, 2023
@github-actions

github-actions Bot commented Nov 13, 2023 •

Copy link
Copy Markdown

Abbreviated Benchmark Summary

@ commit dda127ac7dc68893b9d09715fe7f4fd43f40f619 (vs. base 41a8152d967eca2d3d313dbbc41bc98c9d158c49)

Regressed Latencies 🚩

Benchmark Name Average Latency (ms) Median Latency (ms) Latency Standard Deviation (ms)
BertForMaskedLMTF(stablehlo) [x86\_64-cascadelake-linux\_gnu-llvm\_cpu][default-flags] local\_task(embedded\_elf)[8-thread,full-inference,default-flags] with default @ c2-standard-16[cpu] 420.204 (vs. 381.681, 10.09%↑) 421.154 5.260

Improved Latencies 🎉

Benchmark Name Average Latency (ms) Median Latency (ms) Latency Standard Deviation (ms)
DeepLabV3\_fp32(tflite) [x86\_64-cascadelake-linux\_gnu-llvm\_cpu][default-flags] local\_task(embedded\_elf)[1-thread,full-inference,default-flags] with default @ c2-standard-16[cpu] 33.360 (vs. 35.053, 4.83%↓) 33.361 0.190
MobileNetV1\_fp32(tflite) [x86\_64-cascadelake-linux\_gnu-llvm\_cpu][default-flags] local\_task(embedded\_elf)[1-thread,full-inference,default-flags] with default @ c2-standard-16[cpu] 26.493 (vs. 27.599, 4.01%↓) 26.439 0.129

No improved or regressed compilation metrics 🏖️

For more information:

Source Workflow Run

@benvanik

Copy link
Copy Markdown
Collaborator

good idea!

@bjacob bjacob added benchmarks:x86_64 Run default x86_64 benchmarks and removed benchmarks:x86_64 Run default x86_64 benchmarks labels Nov 13, 2023
@bjacob

bjacob commented Nov 13, 2023

Copy link
Copy Markdown
Collaborator Author

The benchmark results seem to be just noise, but I retriggered just to be sure.

@bjacob
bjacob marked this pull request as ready for review November 13, 2023 22:14
@bjacob
bjacob merged commit 5cd1510 into main Nov 14, 2023
@bjacob
bjacob deleted the bjacob-fine-grained-ukernel-flag branch November 14, 2023 01:32
bjacob added a commit that referenced this pull request Nov 14, 2023
…` to `--iree-llvmcpu-enable-ukernels` (#15584)

Following #15571, we migrate
existing tests and benchmarks from the old deprecated flag to the new
one.

This will allow us to drop `--iree-llvmcpu-enable-microkernels` in a
future PR.
ramiro050 pushed a commit to ramiro050/iree that referenced this pull request Dec 19, 2023
…ree-llvmcpu-enable-microkernels` (iree-org#15571)

This introduces a new command-line flag,
`--iree-llvmcpu-enable-ukernels`, as a replacement for the existing
`--iree-llvmcpu-enable-microkernels`, which gets deprecated but
temporarily coexists during the transition.

The name ambiguity (only differing by `micro` vs `u` substring) is OK as
that's part of a general renaming trend and the old flag should get
removed quickly.

The problem with the boolean `--iree-llvmcpu-enable-microkernels` was
that our plan was of course to eventually enable it by default, but then
that puts a very high bar on any future new ukernel. For now, the only
ukernel enabled in LLVMCPU is mmt4d, but the next time that we want to
introduce a new ukernel, if that means that all existing codegen users
get it while it is still under development, that would be hard.

The new `--iree-llvmcpu-enable-ukernels` is a string. It has the default
value `default`, which means let the implementation enable whichever set
of ukernels is currently default. Currently, that's no ukernel at all,
but we hope in the near team to change that default to including the
`mmt4d` ukernel. Other special string values are `none` and `all` with
the obvious meanings. Any other string is interpreted as a
comma-separated list of individual ukernels to enable.

The old boolean flag `--iree-llvmcpu-enable-microkernels={false,true}`
is currently interpreted as `--iree-llvmcpu-enable-ukernels={none,all}`
until it's dropped.
ramiro050 pushed a commit to ramiro050/iree that referenced this pull request Dec 19, 2023
…` to `--iree-llvmcpu-enable-ukernels` (iree-org#15584)

Following iree-org#15571, we migrate
existing tests and benchmarks from the old deprecated flag to the new
one.

This will allow us to drop `--iree-llvmcpu-enable-microkernels` in a
future PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmarks:x86_64 Run default x86_64 benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants