From 9bac40b79613e2b68a8f1f85df645fbf9963bb6f Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 23 Apr 2024 17:04:15 +0200 Subject: [PATCH] etnaviv/nn: Don't shortcut ZRL bits calculation In some (probably malformed) cases, even weights BOs for strided or depthwise convolutions can become bigger when using ZRL compression. To avoid running out of space in the BO, play safe and calculate the actual optimum ZRL bit count. This does slow compilation for quite a bit, though (2x slower for MobileNetV1). Reviewed-by: Philipp Zabel Part-of: --- src/gallium/drivers/etnaviv/etnaviv_ml_nn.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_ml_nn.c b/src/gallium/drivers/etnaviv/etnaviv_ml_nn.c index c3a443ad263..d39e6d6ec1b 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_ml_nn.c +++ b/src/gallium/drivers/etnaviv/etnaviv_ml_nn.c @@ -1253,16 +1253,6 @@ calculate_zrl_bits(struct etna_ml_subgraph *subgraph, const struct etna_operatio unsigned best_compressed_size; unsigned best_zrl_bits; - /* On HW that doesn't natively support depthwise and strided convolutions, - * we have to lower them and pad with lots of zeroes. We can be pretty certain - * that max bits of compression will help these jobs. - */ - if (operation->depthwise || - operation->stride > 1) { - - return max_zrl_bits; - } - /* These are very unlikely to have enough zeroes for compression to be useful. */ if (operation->addition || operation->pointwise) {