Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6480 +/- ##
==========================================
- Coverage 93.41% 93.41% -0.01%
==========================================
Files 868 869 +1
Lines 275264 274989 -275
==========================================
- Hits 257146 256868 -278
- Misses 18118 18121 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
There was a problem hiding this comment.
Pull request overview
Adds Vulkan backend support for the Flip layer by introducing dedicated compute shaders and a Vulkan layer implementation, enabling axis-based tensor reversal on GPU for both pack1 and pack4 layouts.
Changes:
- Added
flip.comp(pack1) andflip_pack4.comp(pack4) Vulkan compute shaders implementing flip across up to 4 dimensions. - Introduced
Flip_vulkanlayer with pipeline creation/destruction andVkMatforward path selecting pack1/pack4 pipelines. - Wired specialization constants + push constants to match existing Vulkan shader conventions for shape/dispatch parameters.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/layer/vulkan/shader/flip.comp | New pack1 Vulkan shader implementing flip coordinate remapping and copy. |
| src/layer/vulkan/shader/flip_pack4.comp | New pack4 Vulkan shader implementing flip plus lane reversal when flipping the packed axis. |
| src/layer/vulkan/flip_vulkan.h | Declares Flip_vulkan layer and pipelines. |
| src/layer/vulkan/flip_vulkan.cpp | Implements pipeline setup and Vulkan forward() dispatch, including axis->flip flag mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| support_vulkan = true; | ||
| support_vulkan_packing = true; | ||
| support_any_packing = true; |
| // compute flip flags exactly like cpu version | ||
| int axes_flag[4] = {0}; | ||
| int flip_w = 0; | ||
| int flip_h = 0; | ||
| int flip_d = 0; | ||
| int flip_c = 0; | ||
| { | ||
| const int* axes_ptr = axes; | ||
| for (int i = 0; i < axes.w; i++) | ||
| { | ||
| int axis = axes_ptr[i]; | ||
| if (axis < 0) | ||
| axis += dims; | ||
|
|
||
| if (axis < 0 || axis >= 4) | ||
| continue; | ||
|
|
No description provided.