Repository navigation
Disabling detensoring by default until #6948 can be completed. - #13658
Conversation
ScottTodd
left a comment
There was a problem hiding this comment.
May want to run benchmarks on this (if we have any there that are affected...)
|
@ScottTodd I'm seeing some failures in SPIR-V -> WGSL that I suspect are existing but not hit because detensoring was preventing the comparison ops (both tosa and HLO) from reaching device code. I'll file an issue and disable those tests for now. |
|
So there is a chance we should be ok due to the upstream |
Ahhh right. #12509 and #10906. You can either disable the tests or set the flag to true for them. |
|
@rsuderman that'd be great - |
3e77a8b to
b3a630b
Compare
|
Thanks @pzread - I was really confused for a bit :) I'll rebase after the revert lands! |
Detensoring is useful in small scale (a single while-loop with a tensor<i64> iterator like from JAX) but results in pathologically bad device<->host behavior in all other cases. Without improvements to dispatch region formation for small scalar workloads or a retensoring pass that eliminates the device<->host transfers we can't have it on by default.
b3a630b to
a0330cb
Compare
Abbreviated Benchmark Summary@ commit eee5e977f5e9fbdabe5b8684943335875677ebaa (vs. base f0636f4e93a3d113fd5d805528e7b5fdeb060455) Improved Latencies 🎉
No improved or regressed compilation metrics 🏖️ For more information: |
iree-org#13658) Detensoring is useful in small scale (a single while-loop with a tensor<i64> iterator like from JAX) but results in pathologically bad device<->host behavior in all other cases. Without improvements to dispatch region formation for small scalar workloads or a retensoring pass that eliminates the device<->host transfers we can't have it on by default. This makes HLO while loops less efficient as they represent the loop iterator and condition as tensor operations that get performed on device even though the loop happens on the host. It makes everything else significantly better, though, and in the LLM modules under inspection in iree-org#13637 reduces the number of host<->device round trips from ~500-1000 (depending on model) to ~3 (all while loop math). We could investigate an HLO-level specialized detensoring of while loops until we can fix iree-org#6948. WebGPU's SPIR-V -> WGSL lowering currently has issues with non-detensored comparisons (iree-org#12509) and those `while.mlir` tests have been disabled.
Detensoring is useful in small scale (a single while-loop with a tensor iterator like from JAX) but results in pathologically bad device<->host behavior in all other cases. Without improvements to dispatch region formation for small scalar workloads or a retensoring pass that eliminates the device<->host transfers we can't have it on by default.
This makes HLO while loops less efficient as they represent the loop iterator and condition as tensor operations that get performed on device even though the loop happens on the host. It makes everything else significantly better, though, and in the LLM modules under inspection in #13637 reduces the number of host<->device round trips from ~500-1000 (depending on model) to ~3 (all while loop math). We could investigate an HLO-level specialized detensoring of while loops until we can fix #6948.
WebGPU's SPIR-V -> WGSL lowering currently has issues with non-detensored comparisons (#12509) and those
while.mlirtests have been disabled.