Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIRV] Break SPIRVVectorize pass into GenericVectorization and SPIRVVectorLowering passes. #15009

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

qedawkins
Copy link
Contributor

This removes vectorization patterns from SPIRVVectorize pass and delegate it to GenericVectorization.
It renames the old pass to SPIRVVectorLowering because it is mainly lowering vector ops.

This is a duplicate of #14902 to push it through to completion.

@qedawkins qedawkins added benchmarks:android-gpu Run default Android GPU benchmarks benchmarks:vulkan-nvidia Run default Vulkan benchmarks on NVIDIA GPU labels Sep 21, 2023
…gate it to GenericVectorization.

It renames the old pass to SPIRVVectorLowering because it is mainly lowering vector ops.

This is a duplicate of #14902 to push it through to completion.

Additionally cooperative matrix vectorization runs preparation patterns for
vectorization, so splitting apart that pass is left as TODO.
@github-actions
Copy link

Abbreviated Benchmark Summary

@ commit 002295be2584c8cccfb6df6e14ae3ea4c8e690a7 (vs. base a79da4f537b559507eddd8b87e1926830b349d86)

Regressed Latencies 🚩

Benchmark Name Average Latency (ms) Median Latency (ms) Latency Standard Deviation (ms)
MobileBertSquad\_fp16(tflite) [arm-valhall-vulkan\_android31-vulkan\_spirv][default-flags,demote-f32-to-f16] vulkan(none)[full-inference,default-flags] with zeros @ pixel-6-pro[gpu] 77.318 (vs. 72.324, 6.90%↑) 77.660 1.895
MobileNetV3Small\_fp32(tflite) [qualcomm-adreno-vulkan\_android31-vulkan\_spirv][default-flags] vulkan(none)[full-inference,default-flags] with zeros @ moto-edge-x30[gpu] 5.417 (vs. 5.118, 5.85%↑) 5.525 0.381

Improved Latencies 🎉

Benchmark Name Average Latency (ms) Median Latency (ms) Latency Standard Deviation (ms)
MobileNetV3Small\_fp32(tflite) [arm-valhall-vulkan\_android31-vulkan\_spirv][default-flags] vulkan(none)[full-inference,default-flags] with zeros @ pixel-6-pro[gpu] 7.368 (vs. 7.765, 5.12%↓) 7.518 0.548

No improved or regressed compilation metrics 🏖️

For more information:

Source Workflow Run

Copy link
Contributor

@MaheshRavishankar MaheshRavishankar left a comment

Choose a reason for hiding this comment

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

This mostly looks good to me. Ill let Lei or Jakub approve, but happy to stamp if you need me to.

@qedawkins
Copy link
Contributor Author

qedawkins commented Sep 21, 2023

This pass is fairly load bearing so I'll wait for their eyes. The hope is that it is pretty much NFC though.

Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

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

LGTM

let summary = "Vectorize Linalg ops with buffer semantics";
let constructor = "mlir::iree_compiler::createSPIRVVectorizePass()";
let constructor = "mlir::iree_compiler::createSPIRVVectorLoweringPass()";
Copy link
Member

Choose a reason for hiding this comment

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

We should probably remove these constructors in the future and let tablegem autogenerate all of this code. But this is as a side note only, let's keep things as close to NFC as possible in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes we should. I split up the TD file to be per backend to do that (someday). I

@qedawkins qedawkins merged commit 25a0b6c into main Sep 21, 2023
59 checks passed
@qedawkins qedawkins deleted the spirv-vec-clean-step2 branch September 21, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks:android-gpu Run default Android GPU benchmarks benchmarks:vulkan-nvidia Run default Vulkan benchmarks on NVIDIA GPU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants