[Hexagon DSP, HVX] BoundaryCondition #5167
Replies: 1 comment
-
We do optimize boundary conditions as much as we can, splitting loops to avoid boundary conditions when unnecessary, and we optimize clamped vector loads on Hexagon with table lookups. However, if the input is 32 bit, perhaps that second optimization isn't happening. Maybe the problem is that just needs to be implemented @pranavb-ca @dpalermo . edit: I'm wrong, we did implement this, and it is tested: https://github.com/halide/Halide/blob/master/test/correctness/simd_op_check_hvx.cpp#L304-L305 Boundary conditions are applicable to Func, you just need to provide the bounds yourself (since they can't be determined automatically). It is possibly useful to schedule the boundary condition, so the expensive part isn't recomputed N times (for each row of the stencil). If the image is small, just computing it at root might be fine. If not, computing it at tiles, or line buffering it are good options. Would it be possible to share a reproducer of some sort? Particularly for the crash. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am dealing with an algorithm which has to be completed within 7-8 ms on DSP (wihtout RPC overhead).
Function level problem.
-One of the functions in the full chain uses kernel operation.
-Did halide scheduling on this particular function first.
-The input buffer is 32b, and after using BoundaryCondition on te input buffer I see, that the overhead is ~3 ms, which is not feasible for my target.
-I tried clamping also but it says, 32b LUTs are not implemted in Halide. Even if I use any random 8b buffer (even if the output mismatches the reference), it crashes while vectorization.
Chain level problem
-Now this function lies down the chain, and the input is halide func, not the halide buffer exactly(input to the generator).
-BoundaryCondition is not applicable on func, clamping is not working, applying BoundaryCondition input buffers will cause overhead of Boundary condition.
Please help and provide solutions to the above problems.
Beta Was this translation helpful? Give feedback.
All reactions