Skip to content

sanitize bf16 options on model loading#6522

Merged
nihui merged 1 commit into
Tencent:masterfrom
nihui:net-sanitize-gpu-bf16s
Jan 22, 2026
Merged

sanitize bf16 options on model loading#6522
nihui merged 1 commit into
Tencent:masterfrom
nihui:net-sanitize-gpu-bf16s

Conversation

@nihui
Copy link
Copy Markdown
Member

@nihui nihui commented Jan 22, 2026

No description provided.

@github-actions github-actions Bot added the core label Jan 22, 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds sanitization checks for bf16 (bfloat16) options during model loading to ensure they are disabled if the Vulkan device doesn't support them. This prevents potential runtime errors or undefined behavior when bf16 features are enabled but not supported by the GPU hardware.

Changes:

  • Added bf16 packed and storage option sanitization checks in Net::load_param()
  • Added bf16 packed and storage option sanitization checks in Net::load_param_bin()

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.74%. Comparing base (6582aeb) to head (de28c24).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6522      +/-   ##
==========================================
- Coverage   93.08%   92.74%   -0.35%     
==========================================
  Files         809      809              
  Lines      256677   255510    -1167     
==========================================
- Hits       238934   236960    -1974     
- Misses      17743    18550     +807     

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

@nihui nihui merged commit 0deee81 into Tencent:master Jan 22, 2026
112 of 115 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