mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #569] feat(ds4): add opt-in expert prefetch sampling on Linux #602
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#602
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/569
Author: @Whamp
Created: 10/27/2026
Status: 🔄 Open
Base:
main← Head:feat/ds4-expert-prefetch-policy📝 Commits (2)
4efbd3ffeat(ds4): expose opt-in expert prefetch sampling on Linux1b4e3bcref(ds4): simplify expert prefetch to one sample count📊 Changes
9 files changed (+387 additions, -14 deletions)
View changed files
📝
CMakeLists.txt(+16 -0)📝
README.md(+2 -1)📝
docs/SETTINGS.md(+1 -0)➕
docs/ds4-expert-prefetch.md(+39 -0)➕
src/ds4/ds4_expert_prefetch.hpp(+48 -0)📝
src/ds4/ds4_main.cpp(+7 -0)📝
src/ds4/ds4_os.hpp(+7 -13)➕
tests/ds4_prefetch_policy_test.cpp(+122 -0)➕
tests/ds4_prefetch_test.cpp(+145 -0)📄 Description
On Linux, Maya sends read-ahead hints for every expert-weight range passed to
prefetch_cold, even when those file pages are already cached. This PR lets users sample pages and skip the hint when every sample is resident, avoiding repeated hints for cached weights.Residency checks also cost time, so Linux sampling stays opt-in. Windows already uses eight samples per range; its default stays unchanged, but the count becomes configurable.
Configuration and behavior
Set
DS4_PF_SAMPLESin the saved Maya config and restart:0always hints;1through16sets the sample count per range.DS4_PF_ALLstill overrides the count and forces hints.DS4_PF_ALL=0does not enable sampling.DS4_IQ_PF_ALLstill bypasses filtering at its separate IQ call site.Linux measurements
Mean time to process the added input and generate 256 tokens after an 8K cached code-chat prefix, comparing main
e16dec85with PR1b4e3bc:Negative changes mean less time. Main is a single reference run; the repeated comparison is counts 0 versus 4 within the PR build.
Benchmark setup
Tradeoffs and limits
MAYA_DS4_DISK_SKIP_Wenabled, changed residency can change which experts Maya omits and therefore change answers. The benchmark did not enable disk skipping and does not establish output equivalence.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.