mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #492] [CLOSED] DeepSeek: account for reclaimable ZFS ARC when sizing RAM #565
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#565
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/492
Author: @saltacc
Created: 10/25/2026
Status: ❌ Closed
Base:
main← Head:fix/ds4-zfs-arc-memory📝 Commits (1)
79f2989DeepSeek: include reclaimable ZFS ARC in RAM budgets📊 Changes
2 files changed (+142 additions, -1 deletions)
View changed files
📝
src/ds4/ds4_model.cu(+24 -1)➕
tools/test_ds4_ram_avail.py(+118 -0)📄 Description
On Linux with ZFS, DeepSeek's
ram_avail()usesMemAvailablewithout accounting for reclaimable ARC. After model reads fill the ARC, this understates the RAM available for expert warmup. Maya's Python setup already accounts for ARC, but the DeepSeek engine does not.Read
sizeandc_minfrom/proc/spl/kstat/zfs/arcstatsand addmax(size - c_min, 0)to knownMemAvailable. Bound the addition byMemTotalwithout overflowing, then apply the existing cgroup v2 limits, including ancestor limits. Missing or incomplete ARC statistics contribute zero; unknown host availability retains its existing sentinel.The change is confined to the DeepSeek memory estimate and a host-only regression test. Related background: #89. This is separate from the optional direct-I/O/cache-release controls in #421.
Measurements
Startup observations before and after applying this patch to v1.1.28, with the same DeepSeek Maya-XS IQ1_S configuration at 131072 context:
Hardware: i9-14900K, 64 GiB installed RAM, RTX 4090 24 GiB, CachyOS, OpenZFS 2.4.4 on a two-NVMe mirror. Values above use the engine's decimal GB units. ARC occupancy differed between starts; these observations describe startup sizing, not a controlled throughput comparison.
The same-input host harness also compares the stock and patched functions directly: with 8 GiB
MemAvailable, 16 GiB ARC and a 2 GiB ARC floor, the estimate changes from 8 to 22 GiB. Adding a cgroup with 2 GiB headroom caps both versions at 2 GiB.Validation
python tools/check_hip_compat.pypassed.python -m unittest discover -s serve -p 'test_*.py' -t .: 366 tests, passed (11 skipped), macOS.python -m unittest discover -s tools -p 'test_*.py': 395 tests, passed (28 skipped), Linux. The full tools suite uses Linux-specific setup checks; an initial macOS run encountered environment failures (/proc, missingcmake, and temporary-path canonicalization).sm_89and run on the RTX 4090. Health, arithmetic and counting smoke requests passed at 131072 context, with no cgroup OOM events. Token-for-token numerical parity was not measured.git diff --checkpassed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.