Parallelize SPIR-V compilation (#4200)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/4200 Due to a high number of shaders to compile, shader compilation has become quite slow (taking around 1 minute from empirical observations). This change updates the SPIR-V compilation script to parallelize SPIR-V compilation over the available number of CPU cores. Testing the impact of parallelization using the following command: ``` buck build //xplat/executorch/backends/vulkan:gen_vulkan_graph_runtime_shaderlib_cpp --out ~/scratch/shaders ``` We can observe the following improvement: | | Before | After| |--- | --- | --- | | M1 Mac | 42.4s | 7.8s | Reviewed By: liuk22, jorgep31415 Differential Revision: D59597186 fbshipit-source-id: 72df756a3a1f818688af66bbce4fc9fc02f1f505
S
Stephen Jia committed
bc632308aca5901a81f4047e329a66f1ccd98870
Parent: f80c6ef
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 7/10/2024, 8:47:49 PM