Skip to content

dasLLAMA: examples on demand, a huge-page knob, the fleet's memory floor - #4751

Merged
borisbat merged 3 commits into
masterfrom
bbatkin/dasllama-examples-on-demand
Nov 22, 2026
Merged

borisbat merged 3 commits into
masterfrom
bbatkin/dasllama-examples-on-demand

Conversation

@borisbat

Copy link
Copy Markdown
Collaborator

Behavior change: DAS_NO_HUGEPAGE_HINT turns off the huge-page hint of large allocations on Linux; the dasLLAMA runner's four example smoke tests run only under --area examples; the pod fleet remakes a pod that is slow to hand out memory.

Why. A cloud pod ran the gemma CPU cells 10x slower than the pod before it: the runtime's own huge-page request stalled in the host's memory compaction. And the tts area's time on a development box was mostly four example smokes that tell a story in real time.

What changes.

  • DAS_NO_HUGEPAGE_HINT (any value but empty or 0): an allocation of 2 MB or more keeps its 2 MB alignment and drops MADV_HUGEPAGE. Unset, nothing changes.
  • das_env_flag is the one parse of a flag's value in the runtime; nano answers the allocator's question itself.
  • run.das: test_interpreter, test_parrot, test_storyteller_restart and test_storywish form the on-demand examples area. They leave the audio, tts, translate and llm areas and the stocked suite.
  • pod_fleet.das up: a new pod is timed filling one 2 GB buffer and remade under --min-gbs (1 GB/s), in the loop that remakes one short of cores. A run's children take DAS_NO_HUGEPAGE_HINT=1.

Observable behavior.

  • --area tts plans 18 files, not 22; --area examples plans the four smokes; --changed plans one of them only when that file itself changed.
  • No engine module and no fixture plans an example smoke.
  • The fleet's first run after this lands compiles cold once: a DAS* variable is part of every compile record's name.
  • up's log line of a kept pod reads 27.2 cores, 2.0 GB/s of fresh memory.

Where to look. das_aligned_alloc16 in include/daScript/misc/platform.h; ON_DEMAND_AREAS / standing_areas in modules/dasLLAMA/tests/run.das; pod_reading in modules/dasLLAMA/harness/pod_fleet.das.

Validation, claims, ledger

Validation

Kind: intermediate PR of the dasLLAMA suite-speed arc (tooling and one runtime knob; no test cell changes).

What led to the knob (context, picking nothing: the default is unchanged). One cloud pod, RTX PRO 4500, EPYC 7713, Linux 6.8, transparent huge pages madvise, the host's compaction failing 97% of its attempts:

  • test_gpu_resident_gemma4_e2b.das alone, the same binary, one run after the other: 517 s and 0 s of the cgroup's memory stall with the hint off, 791 s and 351 s stalled with it on.
  • A script that allocates and keeps 6 GB: 1.7 GB/s with the hint off, 0.1-0.6 GB/s with it on; plain C on the same pod 1.7 GB/s without MADV_HUGEPAGE and 0.7 GB/s with it. A second pod on another host read the same.

Scope report, RUN:

  • Linux (the pod above, a build of this branch): tests/fio/uncategorized.das 11 of 11 with test_no_hugepage_hint passing, not skipping (the child reports one advised mapping under DAS_NO_HUGEPAGE_HINT=0 and empty, none under =1); test_nano_ctx builds, links and prints nano_ctx: ok; test_run_suites.das 32 of 32; test_pod_fleet.das 12 of 12; up's read command prints 2097152000 bytes (2.1 GB, 2.0 GiB) copied, 1.02341 s, 2.0 GB/s.
  • The knob's negative control, same pod: with && das::hugepage_hint() removed from das_aligned_alloc16 and the tree rebuilt, test_no_hugepage_hint fails (under the knob no mapping carries the advice: ADVISED=1); restored and rebuilt, it passes.
  • macOS (Apple M5 Max, -jit): run.das -- --suite model-free: REPORT suite model-free: 81 file(s), 0 failed, 187 cell(s) skipped, 241 s. run.das -- --changed: PLAN 24 file(s), REPORT changed vs origin/master: 24 file(s), 0 failed, 6 cell(s) skipped, 276 s. tests/fio/uncategorized.das: 11 tests, 10 passed, 1 skipped (the knob's test, by its platform gate).
  • Preflight: the full run, once: 26 passed, 0 failed, 2 skipped (the two Vulkan doc gates, which this Mac's build cannot run); tests-aot among the passes.

NOT RUN:

  • The stocked suite and the GPU homes: no engine module and no test cell changes; the runner's and the fleet's planners are pinned by test_run_suites.das and test_pod_fleet.das.
  • up against a real slow pod: pod_reading and memory_rate are tested on dd's lines, and the read command was run by hand on a pod.
  • test_no_hugepage_hint on Windows and macOS: it skips there by its platform gate.

Negative controls (each mutation made the named test fail, then was restored): the examples branch of suite_files; each example file put back into stocked or an area; ON_DEMAND_AREAS and standing_areas; the three standing-area defaults of areas_for_path and fixture_areas; the examples suite out of area_plan's census; memory_rate's guards; keeps_memory's floor and off switch; memory_reading's unread arm; the memory floor out of the refusal; the knob out of the fleet's environment.

Audits: one checklist auditor per discovered REVIEW.md (eight checklists in three groups), the TDD audit, the duplicate audit, one external review round (no findings).

Claims

  • tests/REVIEW.md, the test_aot rule: tests/fio/uncategorized.das and the new child fixture are compiled by test_aot; the preflight's tests-aot lane above is the run.
  • modules/dasLLAMA/REVIEW.md routes numbers to REVIEW_MEASUREMENT.md and REVIEW_RACE_PICKS.md: the timings above are context. They pick no default - the hint stays on unless the variable is set - and the fleet sets the variable for its own children on the pod's fact.
  • src/REVIEW.md, static storage: hugepage_hint's function-local static const bool is written by its initializer alone.

Checklist rules

  • modules/dasLLAMA/REVIEW.md: the rule on a test file running a module's code now reads "a test file of a standing area" - an on-demand area's file is planned for no module, which the rule otherwise forbade. The sentence beside the MODULE_AREAS rule reads "every standing area".
  • modules/dasLLAMA/tests/REVIEW_PINNED_GATES.md: the test_run_suites.das entry names the standing areas and the on-demand examples area.

Not done

  • No duty yet asks a final PR for an --area examples run on a box with a window server.
  • child_cache_dir-style keying is untouched: the fleet's new variable renames every compile record once.

borisbat and others added 3 commits November 22, 2026 11:03
On Linux an allocation of 2 MB or more takes 2 MB alignment and
MADV_HUGEPAGE. On a host whose memory is fragmented each such page
fault waits on compaction: a cloud pod handed daslang fresh memory at
0.1-0.6 GB/s with the hint and 1.7 GB/s without. The variable drops the
hint and keeps the alignment; unset, nothing changes.

das_env_flag is the one parse of a flag's value, which the module-load
trace read in two copies. nano, which has no environment, answers the
allocator's question itself.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The four browser-example smoke tests spawn their example under a window
and tell a story in real time; they sat in the audio, tts, translate and
llm areas and the stocked suite, and were most of the tts area's time.
They form the examples area now: --area examples runs them, a changed
one still runs itself, and no engine module and no fixture plans them
(standing_areas, every area but the on-demand ones).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
up reads how fast a new pod gives a process fresh memory - one 2 GB
buffer of dd's - and remakes a pod under --min-gbs (1 GB/s) in the
loop that already remakes one short of cores; the refusal names each
floor that is on and what each try read. A run's children take
DAS_NO_HUGEPAGE_HINT=1: a pod's host stalls on hinted page faults.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@borisbat
borisbat merged commit 24d96f6 into master Nov 22, 2026
66 checks passed
@borisbat
borisbat deleted the bbatkin/dasllama-examples-on-demand branch November 22, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant