[codex] Add SSD-aware GGUF mmap policy - #28
Conversation
There was a problem hiding this comment.
2 issues found across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Replace assert() with an abort-based require() helper in gguf_mmap_policy_test and autotune_test so assertions still fire in Release builds (-DNDEBUG), and round-trip all four mmap policies (demand/prefetch/sequential/random) plus the empty-string case. Addresses cubic.dev review on PR #28. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Addressed the cubic.dev review in b168577:
Verified with a Release ( |
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="oxidize-cpp/tests/gguf_mmap_policy_test.cpp">
<violation number="1" location="oxidize-cpp/tests/gguf_mmap_policy_test.cpp:25">
P3: check_round_trip uses the policy name as the error message for all three require() calls, so a failure at any step produces the same output without indicating which check broke (parse existence, value equality, or name round-trip). Consider using distinct messages per check so the failing assertion is immediately identifiable from stderr.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| auto parsed = oxidize::parse_mmap_policy(name); | ||
| require(parsed.has_value(), name); | ||
| require(*parsed == expected, name); | ||
| require(std::string(oxidize::mmap_policy_name(*parsed)) == name, name); |
There was a problem hiding this comment.
P3: check_round_trip uses the policy name as the error message for all three require() calls, so a failure at any step produces the same output without indicating which check broke (parse existence, value equality, or name round-trip). Consider using distinct messages per check so the failing assertion is immediately identifiable from stderr.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At oxidize-cpp/tests/gguf_mmap_policy_test.cpp, line 25:
<comment>check_round_trip uses the policy name as the error message for all three require() calls, so a failure at any step produces the same output without indicating which check broke (parse existence, value equality, or name round-trip). Consider using distinct messages per check so the failing assertion is immediately identifiable from stderr.</comment>
<file context>
@@ -1,24 +1,35 @@
+ auto parsed = oxidize::parse_mmap_policy(name);
+ require(parsed.has_value(), name);
+ require(*parsed == expected, name);
+ require(std::string(oxidize::mmap_policy_name(*parsed)) == name, name);
+}
</file context>
cargo deny advisories fail on anyhow 1.0.102 (unsound Error::downcast_mut). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Triage note (maintainer pass): mmap-policy work looks clean and all CI is green, and the earlier cubic P1/P2 review was addressed. The main thing to resolve before merge is ordering vs the stack: #29 builds directly on this branch, so merging #29 pulls #28's commits in with it. To avoid a redundant merge, either land this one first and then rebase #29 onto master, or fold #28 into #29 and close this. Please confirm which path you intend. Also note the |
Summary
demand,prefetch,sequential, andrandom.--mmap-policyinoxidize-cppand validate it before model loading or--print-plan.mmap_policy, choosingdemandfor huge/over-RAM models andprefetchotherwise.Research basis
madvisedocuments the paging hints used by the implementation.Validation
.omo/ulw-loop/019f2383-7472-7f40-9115-29b70a98d721/evidence/c001-red.txt,c002-red.txt../build/autotune_test,./build/gguf_mmap_policy_test.--print-planfor a 250G sparse model produced"mmap_policy": "demand".--mmap-policy nonsenseexited with code 2.ai@192.168.1.132in a temp copy;autotune_test,gguf_mmap_policy_test, andoxidize-cpp --helpall passed.Note
Full local
cmake --build buildis currently blocked by an unrelated untrackedtests/train_matmul_test.cppthat references missing training symbols; the PR excludes that file.Summary by cubic
Adds SSD-aware GGUF mmap policies and a
--mmap-policyflag, with autotune choosing demand paging for huge/over-RAM models to avoid full-file prefetch and speed up startup/IO. Also updates Rustanyhowto 1.0.103 to address a security advisory.New Features
--mmap-policy <mode>with validation; included in--print-planJSON asmmap_policy.GgufModel::loadacceptsGgufLoadOptionsand appliesmadviseper policy, including split shards.mmap_policy(demand for huge models, prefetch otherwise); CLI respects explicit overrides and shows it in the plan.Dependencies
anyhowto 1.0.103 (fixes RUSTSEC-2026-0190).Written for commit 808e101. Summary will update on new commits.