Skip to content

vulkan packing code clean, drop image storage type#6128

Merged
nihui merged 8 commits into
Tencent:masterfrom
nihui:vulkan-packing-clean
Jun 17, 2025
Merged

vulkan packing code clean, drop image storage type#6128
nihui merged 8 commits into
Tencent:masterfrom
nihui:vulkan-packing-clean

Conversation

@nihui

@nihui nihui commented Jun 17, 2025

Copy link
Copy Markdown
Member

No description provided.

@nihui nihui changed the title vulkan packing clean, drop image storage type vulkan packing code clean, drop image storage type Jun 17, 2025
@nihui nihui requested a review from Copilot June 17, 2025 03:02

This comment was marked as outdated.

@codecov-commenter

codecov-commenter commented Jun 17, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 87.55187% with 30 lines in your changes missing coverage. Please review.

Project coverage is 95.81%. Comparing base (bd0b111) to head (6146309).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/layer/vulkan/packing_vulkan.cpp 85.64% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6128      +/-   ##
==========================================
- Coverage   95.81%   95.81%   -0.01%     
==========================================
  Files         831      831              
  Lines      264935   264990      +55     
==========================================
+ Hits       253843   253895      +52     
- Misses      11092    11095       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jun 17, 2025

Copy link
Copy Markdown

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15656872 15598184 -58688 😘
armhf 6665712 6607084 -58628 😘
aarch64 9985232 9917304 -67928 😘

@nihui nihui requested a review from Copilot June 17, 2025 06:24

This comment was marked as outdated.

@nihui nihui requested a review from Copilot June 17, 2025 06:29

This comment was marked as outdated.

@nihui nihui requested a review from Copilot June 17, 2025 07:38

This comment was marked as outdated.

@nihui nihui requested a review from Copilot June 17, 2025 08:28

This comment was marked as outdated.

@nihui nihui requested a review from Copilot June 17, 2025 08:38

This comment was marked as outdated.

@nihui nihui requested a review from Copilot June 17, 2025 08:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Cleanup Vulkan packing code by removing image‐storage variants, unifying on a new cast_type model, and updating layer and GPU APIs to drop storage_type.

  • Removed legacy *_fp*_to_fp* shader files and storage‐type branches in shaders
  • Renamed storage_type_from/to to cast_type_from/to in Packing and shader code
  • Updated convert_packing overloads and get_utility_operator to work with cast_type only

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.

File Description
src/layer/vulkan/shader/packing_pack4to1.comp Unified on cast_type, removed storage‐type branching
src/layer/packing.h Dropped storage_type fields, updated comments for cast_type
src/gpu.cpp Added convert_packing overload, refactored get_utility_operator
src/command.cpp Updated calls to convert_packing to pass cast_type_to
Comments suppressed due to low confidence (1)

src/gpu.cpp:4226

  • The new convert_packing overload with cast_type_to introduces multiple cast branches (auto, fp32, fp16). Add unit or integration tests to cover each cast_type_to path to ensure correct behavior.
void VulkanDevice::convert_packing(const VkMat& src, VkMat& dst, int dst_elempack, int cast_type_to, VkCompute& cmd, const Option& opt) const

Comment thread src/gpu.cpp
Comment thread src/command.cpp
Comment thread src/command.cpp
@nihui nihui merged commit 626d9d0 into Tencent:master Jun 17, 2025
120 of 122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants