Repository navigation
Conversation
|
really like how this is on the attribute so that each CPU target can also independently control this without the need for global flags - slick! |
|
This seems good to land for me! |
|
Let's discuss this along with #15256 in the "Mai-Tai sync" meeting 30 min from now. |
|
@dcaballe Are you OK with this going in? (Note it doesn't do anything unless |
|
Discussed with @dcaballe on Discord: https://discord.com/channels/689900678990135345/1146173056537079919/1174050447347155015 . Let's wait until DT-by-default is ublocked except perhaps by this, to revisit this. |
DT is turned on by default, let's revisit the mmt4d ukernel enablement on default? |
If I can be honest, we are still recovering from the DT enablement so I would appreciate some slack :). We are still dealing with some DT issues and catching up with the work that DT enablement has put on hold (e.g., multi-level tiling and distribution improvements). Prioritizing those landings would be highly appreciated. I think the two missing features for UK enablement that I can think of are: 1) DT enablement for cases where a UK is not available and, 2) Fall back to performant non-DT path when no efficient UK is available. I think we already have Issues for those so we can look at this once they have been addressed. |
That make sense... lets just put this on the docket for the next year. But IMO data tiling without ukernels was a harder lift to land than data tiling + ukernels together. The former had more chances of regressions (and I think we hit a few of those) than the latter which is what was being developed. Those two are decoupled, but they have been evaluated together, so ideally I would have liked to do both, and done data-tiling without ukernels as follow-up. But kudos to everyone for making it happen.
This is a good point. We need to figure out a way for the compiler to know what configuration is backed by ukernels and what is not. Right now if we turn on ukernels for mmt4d, the ones dont really have a ukernel will take a slow path, that is very slow (but having that fallback is great for functionality and robustness, so thats great!). We should find a way to avoid falling into that slow path in ukernels and instead fall back to at least lowering through vector dialect for mmt4d operations (I think it would be too late to go back and undo DT, the layering does not work that way). |
It is surprising but given the existing issues that we have opened against DT and UK, we only have one model (GPT2) that slightly benefit from UK both on x86 and Arm. This is obviously a temporary situation but it kind of illustrates that we still have some work to do on UK and also on settling DT properly.
It would be good to give this a thought as well as this is the level of optionality that we have been discussing in the DT RFC that would be needed. |
This is strange... Overwhelmingly I have seen DT and UK be order of magnitude better. So it might be better to take a broader view of things. The benchmarks tracked by Marie also seem to show that... There will always be work to do, but needs to be balanced against alternatives
That kind of leaking of information all the way to flow is detrimental. I don't think that is the way to approach it. If we don't have microkernels, then we just vectorize and lower like a normal linalg operation. |
686db78 to
5215079
Compare
mmt4d ukernel by defaultmmt4d ukernel by default in llvm-cpu
Abbreviated Benchmark Summary@ commit 0eeb1c801c5c54f9a723f321a041998e27364e14 (vs. base ab949ef6d787fb7292302f71f5ce039543fe3a6f) Data-Tiling Comparison TableClick to show
Regressed Latencies 🚩
Improved Latencies 🎉
[Top 3 out of 14 results showed] Improved Total Dispatch Sizes 🎉
For more information: |
(This PR temporarily folds #16890, making it look big).
Spreadsheet presenting data from the benchmarks run on #16890:
https://docs.google.com/spreadsheets/d/1w0nG0-uQ2Z0H1dXkS-vaf5xC26GMZLM1g7Nb_kJe61U/edit?usp=sharing
Summary (speedup of DT+UK vs DT-only across all IREE CI benchmarks on CPU, both x86-64 and arm64):
Following #15571, it is now a 1-line change to change the defaults for which microkernel lowerings we enable as an internal implementation detail, without any change to users' command lines.
This PR changes the default from
nonetommt4d, meaning that we enable the ukernel lowering formmt4dops and nothing else (other things could be appended in the future, this is a comma-separated list).This is for now just to help the discussion on DT-by-default, #15256 . This is saying, if the last thing preventing DT-by-default is currently suboptimal codegen for mmt4d ops, we can enable UK for mmt4d so that doesn't affect the default path anymore.
benchmark-extra: x86_64-dt-only, android-cpu-dt-only