Skip to content

vulkan weight allocator prefer host memory fusion - #6545

Merged
nihui merged 4 commits into
Tencent:masterfrom
nihui:vulkan-host-allocator-fusion
Feb 13, 2026
Merged

vulkan weight allocator prefer host memory fusion#6545
nihui merged 4 commits into
Tencent:masterfrom
nihui:vulkan-host-allocator-fusion

Conversation

@nihui

@nihui nihui commented Feb 12, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added the core label Feb 12, 2026
@tencent-adm

Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov-commenter

codecov-commenter commented Feb 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 34.48276% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.22%. Comparing base (0ed9702) to head (8f37497).

Files with missing lines Patch % Lines
src/allocator.cpp 33.91% 76 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6545      +/-   ##
==========================================
+ Coverage   93.18%   93.22%   +0.03%     
==========================================
  Files         847      847              
  Lines      266764   266744      -20     
==========================================
+ Hits       248591   248661      +70     
+ Misses      18173    18083      -90     

☔ 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.

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

This PR consolidates Vulkan “weights in host memory” handling by folding the former VkHostAllocator behavior into VkWeightAllocator, and wiring Net::load_model() to select host-memory preference via a flag rather than switching allocator classes.

Changes:

  • Update Net::load_model() to construct VkWeightAllocator with a host-memory preference flag.
  • Extend VkWeightAllocator to optionally allocate/import host-backed memory (and add cleanup for host pointers).
  • Remove the exported VkHostAllocator class from the public allocator header and implementation.

Reviewed changes

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

File Description
src/net.cpp Switch allocator creation to a single VkWeightAllocator with host-memory preference.
src/allocator.h Change VkWeightAllocator constructor signature; remove VkHostAllocator declaration.
src/allocator.cpp Implement host-memory preference inside VkWeightAllocator; delete VkHostAllocator implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/allocator.h
Comment thread src/allocator.h
Comment thread src/allocator.cpp
nihui and others added 2 commits February 13, 2026 00:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nihui
nihui merged commit e235e09 into Tencent:master Feb 13, 2026
113 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants