Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
79e0f44
llvm -exe: actually print the exception — jit_run_main_guarded never …
borisbat Jul 27, 2026
8cb3a8b
dasllama-convert + fio direct writer: GLM conversion 383s -> 145s, pe…
borisbat Jul 28, 2026
64459e2
dlim arc phase A: explicit DlimConfiguration — identity is a pure for…
borisbat Jul 28, 2026
2650327
dlim config: auto vram derives from heap SIZE, not the live budget — …
borisbat Jul 28, 2026
47cd96b
dlim arc phase B: offline vulkan bake — dry tier, role-annotated plan…
borisbat Jul 28, 2026
c2206b7
dlim quant plumbing: the identity's quant field is real, not a hardco…
borisbat Jul 28, 2026
fab2bc8
dlim arc phase C core: P3 trim — the vulkan flavor drops the CPU weig…
borisbat Jul 28, 2026
e0b572a
dlim arc phase C gates: trim decode parity EXACT; re-bind slices; tri…
borisbat Jul 28, 2026
e90bdec
dlim arc phase E: prefetch_map — advisory source readahead, with test…
borisbat Jul 28, 2026
33220f9
dlim arc phase D step 1: FillJob recording — load_big grows an inert …
borisbat Jul 28, 2026
074a5d8
dlim arc phase D step 2: plan-mode sizing skip, decline gate, tied-cl…
borisbat Jul 28, 2026
eb19257
dlim arc phase D: the streaming fill executor — SHA-identical to eage…
borisbat Jul 28, 2026
08a84a4
dlim arc phase D: split-shard streaming + THE MEMORY RECEIPT — GLM pe…
borisbat Jul 28, 2026
8ef54ee
dlim arc phase F: P2 imported mirrors — import-first stream mirrors, …
borisbat Jul 28, 2026
a3f7909
dlim arc phase D remainder: dwrite async writer — double-buffered ban…
borisbat Jul 28, 2026
5b25edd
dlim arc phase G: dwrite mechanics tests — round-trip, truncate contr…
borisbat Jul 28, 2026
2f0efdb
dlim arc phase G: converter --list / --clean (the dlim GC) + image_pe…
borisbat Jul 28, 2026
c96e8f1
dlim arc phase G: image-mechanics arms for the v7 meta head and confi…
borisbat Jul 28, 2026
9b16ccc
fio: fmap_open_rw — a writable SHARED file mapping; closes the import…
borisbat Jul 28, 2026
d069e6e
dlim streaming fix: size and gap-fill streamed q-planes from the LAYO…
borisbat Jul 28, 2026
f5c6082
fio: fmap_open_rw tests + handmade RST (the flagged follow-up)
borisbat Jul 28, 2026
c6d4a51
dlim arc phase G: image-vulkan suite — the offline dry bake gets regr…
borisbat Jul 28, 2026
2dd0dea
dasllama-server: the .dlim surface — per-model inventory, bake-now, a…
borisbat Jul 28, 2026
0f5d306
dlim arc phase A remainder: cross-box repack-by-numbers — a PC bakes …
borisbat Jul 28, 2026
eee4615
dlim arc: dasllama_metal_shapes — the metal servable predicate goes p…
borisbat Jul 28, 2026
25fd4a8
dasllama-convert: -f metal pins the portable backend (the metal donor…
borisbat Jul 28, 2026
17e0000
Merge remote-tracking branch 'origin/master' into bbatkin/dasllama-cm…
borisbat Jul 28, 2026
f3e0534
CI: two master-level lane fixes — darwin26 tensor capability skip, wi…
borisbat Jul 28, 2026
fd2b674
PR round 1: eastl stubs, POSIX dwrite stat contract, vulkan-test noli…
borisbat Jul 28, 2026
af5ee00
babysit skill: fixes push immediately - never idle on straggler lanes
borisbat Jul 28, 2026
dcf834c
dasllama-convert: drop the second apply_box_profile_runtime in the st…
borisbat Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/reflections/das2rst.das
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def document_module_fio(_root : string) {
var mod = [get_module("fio_core"), find_module("fio")]
var groups <- array<DocGroup>(
hide_group(group_by_regex("Internal builtin functions", mod, %regex~builtin%%)),
group_by_regex("Direct IO and mapping advice", mod, %regex~(dwrite_open|dwrite_append|dwrite_band|dwrite_commit|dwrite_stat|dwrite_close|prefetch_map)$%%),
group_by_regex("File manipulation", mod, %regex~(f|long_f|stat$|getchar|remove|rename|copy_file|file_size|equivalent|is_symlink|set_mtime)%%),
group_by_regex("Path manipulation", mod, %regex~(base_name|dir_name|get_full_file_name|extension|stem|replace_extension|path_join|normalize|to_generic_path|is_absolute|relative|relative_result|parent)$%%),
group_by_regex("Directory manipulation", mod, %regex~(dir|dir_rec|mkdir|mkdir_rec|mkdir_result|rmdir|rmdir_rec|rmdir_rec_result|rmdir_result|chdir|getcwd)$%%),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Append ``bytes`` from ``data`` at the writer's current end. Any pointer, any size — the handle re-blocks into aligned bands internally, and a band-multiple, band-aligned source is written directly with no copy. Returns false when a write fails (disk full, in practice); a failed writer stays failed, so checking ``dwrite_close`` once is enough.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hand out the writer's own staging band so a producer can build bytes in place instead of building a buffer and appending a copy. ``avail`` receives the free space left in the current band; fill up to that many bytes and account for them with ``dwrite_commit``. Returns null on a dead writer.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flush the writer's tail (sector-padded on cache-bypassing platforms), truncate the file to exactly what was appended, and free the handle. Returns false if anything failed anywhere along the writer's life — this is the one completion verdict a caller needs to check.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Account ``bytes`` written into the pointer ``dwrite_band`` handed out; a full band flushes to the device automatically. Returns false when the commit overruns the band's remaining space (a producer bug) or the writer already failed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Open ``path`` for cache-bypassing sequential append (``FILE_FLAG_NO_BUFFERING`` on Windows, ``F_NOCACHE`` on macOS, ``posix_fallocate`` plus ``fadvise`` elsewhere). ``total_bytes`` preallocates the file — writes must then be strictly ascending, which is what avoids NTFS valid-data-length zero-fill; the file is truncated back to what was actually appended at close. ``band_bytes`` sizes the internal sector-aligned bounce buffer (16 MB when in doubt). Returns null on failure. Pair with ``dwrite_append`` or the ``dwrite_band``/``dwrite_commit`` producer surface, and always finish with ``dwrite_close``.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Where the writer spent its time so far: ``which`` 0 = staging nanoseconds (memcpy into the bounce band), 1 = syscall nanoseconds, 2 = bytes written directly from caller memory, 3 = bytes that went through the bounce band. Call before ``dwrite_close`` — the handle is gone after.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The writable twin of ``fmap_open``: memory-maps the file at ``path`` as a SHARED read-write view and returns the mapping's base pointer, writing the mapped byte count through ``size``. Writes through the mapping go back to the file itself via the page cache — this is a real shared mapping, not copy-on-write, so no commit charge is taken for the view. The mapping stays valid until passed to ``fmap_close``. Returns null when the file cannot be opened for writing, is empty, or cannot be mapped.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Advisory readahead over a mapped range: asks the OS to fault ``bytes`` starting at ``base`` into the page cache ahead of use (``PrefetchVirtualMemory`` on Windows, ``madvise(MADV_WILLNEED)`` on POSIX). Use it on an ``fmap``/``fmap_open`` mapping before a parallel pass over the data — on-demand faults taken inside worker lanes serialize them. Returns false when the OS declines; the call is purely advisory, so reads work either way.
8 changes: 8 additions & 0 deletions include/daScript/simulate/aot_builtin_fio.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,15 @@ namespace das {
DAS_API vec4f builtin_load ( Context & context, SimNode_CallBase *, vec4f * args );
DAS_API void builtin_map_file ( const FILE* _f, const TBlock<void, TTemporary<TArray<uint8_t>>>& blk, Context*, LineInfoArg * at );
DAS_API void * builtin_fmap_open ( const char * name, uint64_t * size, Context * context, LineInfoArg * at );
DAS_API void * builtin_fmap_open_rw ( const char * name, uint64_t * size, Context * context, LineInfoArg * at );
DAS_API void builtin_fmap_close ( void * data, uint64_t size, Context * context, LineInfoArg * at );
DAS_API void * builtin_dwrite_open ( const char * name, uint64_t total_bytes, uint64_t band_bytes, Context * context, LineInfoArg * at );
DAS_API bool builtin_dwrite_append ( void * h, void * data, uint64_t bytes, Context * context, LineInfoArg * at );
DAS_API void * builtin_dwrite_band ( void * h, uint64_t * avail, Context * context, LineInfoArg * at );
DAS_API bool builtin_dwrite_commit ( void * h, uint64_t bytes, Context * context, LineInfoArg * at );
DAS_API uint64_t builtin_dwrite_stat ( void * h, int32_t which, Context * context, LineInfoArg * at );
DAS_API bool builtin_dwrite_close ( void * h, Context * context, LineInfoArg * at );
DAS_API bool builtin_prefetch_map ( void * base, uint64_t bytes, Context * context, LineInfoArg * at );
DAS_API char * builtin_dirname ( const char * name, Context * context, LineInfoArg * at );
DAS_API char * builtin_basename ( const char * name, Context * context, LineInfoArg * at );
DAS_API bool builtin_fstat ( const FILE * f, FStat & fs, Context * context, LineInfoArg * at );
Expand Down
2 changes: 1 addition & 1 deletion modules/dasLLAMA/.das_module
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require daslib/fio
[export]
def initialize(project_path : string) {
let dasllama_paths = [
"dasllama_env", "dasllama_par", "dasllama_parity", "dasllama_tune", "dasllama_math", "dasllama_math_default", "dasllama_math_aarch64_neon", "dasllama_math_gen", "dasllama_math_metal", "dasllama_math_vulkan", "dasllama_math_accelerate", "dasllama_kernel_access", "dasllama_vulkan_lens", "dasllama_metal_lens", "dasllama_metal_common", "dasllama_metal_kernels", "dasllama_metal_prefill", "dasllama_metal_llama", "dasllama_gemm_gen", "dasllama_gemm_register", "dasllama_gemm_schema", "dasllama_quant", "dasllama_gguf",
"dasllama_env", "dasllama_config", "dasllama_par", "dasllama_parity", "dasllama_tune", "dasllama_math", "dasllama_math_default", "dasllama_math_aarch64_neon", "dasllama_math_gen", "dasllama_math_metal", "dasllama_math_vulkan", "dasllama_math_accelerate", "dasllama_kernel_access", "dasllama_vulkan_lens", "dasllama_metal_lens", "dasllama_metal_shapes", "dasllama_metal_common", "dasllama_metal_kernels", "dasllama_metal_prefill", "dasllama_metal_llama", "dasllama_gemm_gen", "dasllama_gemm_register", "dasllama_gemm_schema", "dasllama_quant", "dasllama_gguf",
"dasllama_unicode", "dasllama_tokenizer", "dasllama_bpe", "dasllama_common", "dasllama_layout", "dasllama_prefix", "dasllama_audio", "dasllama_audio_io", "dasllama_whisper", "dasllama_qwen3a", "dasllama_parakeet", "dasllama_canary", "dasllama_gemma4a", "dasllama_vad", "dasllama_asr",
"dasllama_arch_llama", "dasllama_arch_qwen2", "dasllama_arch_qwen3", "dasllama_arch_phi3", "dasllama_arch_gemma2", "dasllama_arch_gemma3", "dasllama_arch_gemma4", "dasllama_arch_qwen2moe", "dasllama_arch_qwen3moe", "dasllama_arch_qwen35", "dasllama_arch_gptoss", "dasllama_arch_mistral3", "dasllama_arch_glm4moe", "dasllama_image",
"dasllama_transformer", "dasllama_chat", "dasllama"
Expand Down
4 changes: 4 additions & 0 deletions modules/dasLLAMA/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Read by the inference engine itself, so these affect any program that loads a mo
| `DASLLAMA_GPU_COMBINE` | flag | on | Device-side routed MoE combine; 0 falls back to the host combine. |
| `DASLLAMA_GPU_HEAT` | number | 0 | Expert heat threshold: hold the N hottest experts resident regardless of layer placement. |
| `DASLLAMA_GPU_PROF` | flag | off | Report lifetime GPU queue submissions (real commands plus staging round-trips). |
| `DASLLAMA_PREFETCH` | flag | on | Advisory source-mapping readahead at gguf load (cold-conversion fix); =0 restores on-demand faulting. |

## Metal backend

Expand Down Expand Up @@ -95,6 +96,8 @@ Vulkan GPU backend. Present only where the dasVulkan package is installed.
| `DASLLAMA_MM_SMALLD` | number | 64 | Small-d cutoff routing narrow roles (k/v) to the small tier; widening measured worse, so this is an instrument. |
| `DASLLAMA_VK_FUSE` | flag | on | Fused decode tail (add+rms+requant, qk-norm+rope); 0 pins the split dispatches for a same-build A/B. |
| `DASLLAMA_VK_XFERQ` | flag | on | Stream expert uploads on the dedicated transfer queue, overlapped via a timeline semaphore; 0 keeps the single-queue rail. |
| `DASLLAMA_VK_IMPORT` | flag | on | Stream mirrors import the mapped .dlim (VK_EXT_external_memory_host) instead of pinned copies; =0 restores the copy path. |
| `DASLLAMA_TRIM` | flag | off | Serve from P3-trimmed vulkan images (big CPU weight families dropped; folded into the flavor identity). |
| `DASLLAMA_VK_MEMPRIO` | flag | on | Tag allocations high-priority (VK_EXT_memory_priority) so the driver demotes desktop memory, not ours. |
| `DASLLAMA_VK_FA` | flag | on | Vulkan flash-attention kernel; 0 falls back to the chunked path. |
| `DASLLAMA_VK_REBAR` | flag | on | Use a ReBAR device-local host-visible heap when one larger than 1GB is present. |
Expand Down Expand Up @@ -187,6 +190,7 @@ Apple Accelerate / AMX float lane. `DASLLAMA_ACCEL` arms the whole group.
| `DASLLAMA_WHISPER_DIR` | path | unset | Directory of whisper models for the audio tests. |
| `DASLLAMA_CORPUS_DIR` | path | unset | Directory of audio corpus files for the transcription tests. |
| `TMPDIR` | path | /tmp | Scratch directory for test artifacts; set by the OS on macOS. |
| `TEMP` | path | unset | Windows scratch-directory fallback when TMPDIR is unset (the test runner's log dir). |

## Examples and tutorials

Expand Down
Loading
Loading