Filter backend-owned runtime DLLs#115
Conversation
d15c240 to
3918bd1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
==========================================
+ Coverage 76.57% 76.59% +0.02%
==========================================
Files 68 68
Lines 8670 8678 +8
==========================================
+ Hits 6639 6647 +8
Misses 2031 2031
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes Windows native packaging bloat by filtering “backend-owned” runtime dependencies during native asset bundling so CUDA/OpenBLAS runtime libraries are only emitted when their owning backend module is selected, while still bundling unknown non-core runtime libraries for forward compatibility.
Changes:
- Added explicit classification for known backend-owned runtime dependencies (CUDA runtimes and OpenBLAS) without changing backend availability detection.
- Updated bundling selection logic to filter these runtime dependencies based on the user-selected backends.
- Added/updated unit + integration tests and documented the new packaging behavior in README/docs/changelog.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/platforms/support-matrix.md | Documents backend-owned runtime dependency bundling behavior. |
| website/docs/changelog/recent-releases.md | Notes the new bundling behavior in the docs changelog. |
| test/unit/hook/native_bundle_config_test.dart | Adds coverage for filtering/keeping CUDA & OpenBLAS runtime dependencies based on selected backends. |
| test/unit/hook/build_hook_integration_test.dart | Verifies the build hook does not emit CUDA DLLs unless cuda is selected. |
| README.md | Documents backend-owned runtime dependency bundling rules for users. |
| lib/src/hook/native_bundle_config.dart | Implements runtime dependency classification and selection-time filtering. |
| CHANGELOG.md | Records the packaging size fix in the main changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Fixes #114.
This PR filters backend-owned runtime dependencies during native asset bundling. CUDA runtime DLLs are now emitted only when the
cudabackend module is selected, and OpenBLAS runtime libraries are emitted only whenblasis selected.Unknown non-core runtime libraries are still bundled by default for compatibility with future native bundle layouts.
Root Cause
CUDA runtime DLLs such as
cudart64_12.dll,cublas64_12.dll, andcublaslt64_12.dllintentionally havebackend == nullso they do not make CUDA appear available unlessggml-cudais present. The bundling filter previously treated allbackend == nullnon-core libraries as always-keep runtime files, so those CUDA DLLs leaked into Windows packages even when CUDA was not selected.Changes
cudaselection.blasselection.Validation
dart test -p vm test/unit/hook/native_bundle_config_test.dartdart test -p vm test/unit/hook/build_hook_integration_test.dartdart analyze