Re: [Mesa-dev] [PATCH 0/5] anv: Add a NIR cache

2018-10-16 Thread Eero Tamminen

Hi,

On 10/13/18 3:08 AM, Jason Ekstrand wrote:

This patch series adds a simple NIR shader cache that sits right after
spirv_to_nir and brw_preprocess_nir and before linking.  This should help
alleviate some of the added overhead of link-time optimization since most
of the NIR-level optimization is now cached prior to linking.

I have no numbers to back this series up; just intuition.


Fortunately approximate numbers of where the bottlenecks are, are easy
to come by for shader compilation.

1. Start use-case doing lot of shader compilation (shader-db?)
2. "sudo perf record -a"
3. ^C when shader compilation stops
4. "sudo perf report"

When I profiled GL shader compilation before Mesa switched to NIR,
linking phase was 2/3 of the cycles taken by the whole shader compilation.

(I.e. why shader cache needed to cache linking results to have 
significant impact.)



- Eero


Jason Ekstrand (5):
   anv/pipeline: Move wpos and input attachment lowering to lower_nir
   anv/pipeline: Hash shader modules and spec constants separately
   compiler/types: Serialize/deserialize subpass input types correctly
   anv/pipeline_cache: Add support for caching NIR
   anv/pipeline: Cache the pre-lowered NIR

  src/compiler/glsl_types.cpp   |   4 +-
  src/intel/vulkan/anv_pipeline.c   | 118 ++
  src/intel/vulkan/anv_pipeline_cache.c | 100 ++
  src/intel/vulkan/anv_private.h|  18 
  4 files changed, 204 insertions(+), 36 deletions(-)



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/5] anv: Add a NIR cache

2018-10-13 Thread Jason Ekstrand
I ran the Vulkan CTS both with and without this patch in the hopes that the
massive pile of redundant shaders in the CTS would be helped.  It shaved 6
minutes of a 4.5 hour run.  Quite possibly in the noise.

--Jason

On Fri, Oct 12, 2018 at 7:08 PM Jason Ekstrand  wrote:

> This patch series adds a simple NIR shader cache that sits right after
> spirv_to_nir and brw_preprocess_nir and before linking.  This should help
> alleviate some of the added overhead of link-time optimization since most
> of the NIR-level optimization is now cached prior to linking.
>
> I have no numbers to back this series up; just intuition.
>
> Jason Ekstrand (5):
>   anv/pipeline: Move wpos and input attachment lowering to lower_nir
>   anv/pipeline: Hash shader modules and spec constants separately
>   compiler/types: Serialize/deserialize subpass input types correctly
>   anv/pipeline_cache: Add support for caching NIR
>   anv/pipeline: Cache the pre-lowered NIR
>
>  src/compiler/glsl_types.cpp   |   4 +-
>  src/intel/vulkan/anv_pipeline.c   | 118 ++
>  src/intel/vulkan/anv_pipeline_cache.c | 100 ++
>  src/intel/vulkan/anv_private.h|  18 
>  4 files changed, 204 insertions(+), 36 deletions(-)
>
> --
> 2.19.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/5] anv: Add a NIR cache

2018-10-12 Thread Jason Ekstrand
This patch series adds a simple NIR shader cache that sits right after
spirv_to_nir and brw_preprocess_nir and before linking.  This should help
alleviate some of the added overhead of link-time optimization since most
of the NIR-level optimization is now cached prior to linking.

I have no numbers to back this series up; just intuition.

Jason Ekstrand (5):
  anv/pipeline: Move wpos and input attachment lowering to lower_nir
  anv/pipeline: Hash shader modules and spec constants separately
  compiler/types: Serialize/deserialize subpass input types correctly
  anv/pipeline_cache: Add support for caching NIR
  anv/pipeline: Cache the pre-lowered NIR

 src/compiler/glsl_types.cpp   |   4 +-
 src/intel/vulkan/anv_pipeline.c   | 118 ++
 src/intel/vulkan/anv_pipeline_cache.c | 100 ++
 src/intel/vulkan/anv_private.h|  18 
 4 files changed, 204 insertions(+), 36 deletions(-)

-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev