mlx-bun 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1449 -109
- package/THIRD_PARTY_NOTICES.md +882 -0
- package/bin/mlx-bun.convert.mjs +4 -0
- package/bin/mlx-bun.fuse.mjs +4 -0
- package/bin/mlx-bun.generate.mjs +4 -0
- package/bin/mlx-bun.lora.mjs +4 -0
- package/bin/mlx-bun.mjs +13 -21
- package/bin/mlx-bun.server.mjs +4 -0
- package/bin/mlx-bun.upload.mjs +4 -0
- package/dist/web/app.js +9584 -0
- package/package.json +50 -53
- package/src/cli/ane-install.ts +76 -0
- package/src/cli/args.ts +179 -0
- package/src/cli/engine-entry.ts +68 -0
- package/src/cli/inference.ts +214 -0
- package/src/cli/job-entry.ts +97 -0
- package/src/cli/library-host.ts +117 -0
- package/src/cli/main.ts +57 -0
- package/src/cli/memory-engine.ts +163 -0
- package/src/cli/memory.ts +36 -0
- package/src/cli/mlx-lm-aliases.ts +309 -0
- package/src/cli/model-choice.ts +33 -0
- package/src/cli/model-selection.ts +84 -0
- package/src/cli/module-host.ts +11 -0
- package/src/cli/module-verbs.ts +50 -0
- package/src/cli/numerical-policy.ts +12 -0
- package/src/cli/perplexity.ts +89 -0
- package/src/cli/serve-host.ts +423 -0
- package/src/cli/serve-isolated.ts +217 -0
- package/src/cli/serve-options.ts +106 -0
- package/src/cli/serve-state.ts +205 -0
- package/src/cli/serve.ts +500 -0
- package/src/cli/served-model-host.ts +102 -0
- package/src/cli/server-entry.ts +148 -0
- package/src/cli/serving-unit.ts +177 -0
- package/src/{tui.ts → cli/terminal.ts} +13 -8
- package/src/cli/worker-adapters.ts +34 -0
- package/src/cli/worker-entry.ts +272 -0
- package/src/cli/worker-unit.ts +179 -0
- package/src/engine/adapter-operation.ts +26 -0
- package/src/engine/cache-services.ts +114 -0
- package/src/engine/completion.ts +39 -0
- package/src/engine/generation-gateway.ts +358 -0
- package/src/engine/index.ts +59 -0
- package/src/engine/kv-budget.ts +120 -0
- package/src/engine/media-preparation.ts +232 -0
- package/src/engine/model-binding.ts +24 -0
- package/src/engine/model-host.ts +513 -0
- package/src/engine/model-serving.ts +89 -0
- package/src/{serve → engine}/preparation.ts +7 -5
- package/src/{serve → engine}/session-completion-engine.ts +6 -6
- package/src/engine/telemetry.ts +109 -0
- package/src/hub/downloads.ts +116 -0
- package/src/jobs/db.ts +16 -7
- package/src/jobs/events.ts +29 -0
- package/src/jobs/executable.ts +5 -0
- package/src/jobs/host.ts +51 -0
- package/src/jobs/in-process.ts +55 -0
- package/src/{contracts/jobs.ts → jobs/protocol.ts} +7 -9
- package/src/jobs/runner.ts +150 -231
- package/src/jobs/service.ts +75 -0
- package/src/jobs/sse.ts +59 -23
- package/src/jobs/worker-memory.ts +46 -0
- package/src/jobs/worker-process.ts +163 -0
- package/src/jobs/worker-supervisor.ts +258 -0
- package/src/modules.ts +58 -0
- package/src/publishing/catalog-hub.ts +18 -0
- package/src/publishing/credentials.ts +31 -0
- package/src/publishing/upload.ts +37 -0
- package/src/residency/leased-adapters.ts +21 -0
- package/src/residency/local-records.ts +16 -0
- package/src/residency/model-residency.ts +405 -0
- package/src/residency/record-index.ts +28 -0
- package/src/residency/resident-estimate.ts +50 -0
- package/src/{anthropic.ts → server/anthropic.ts} +3 -81
- package/src/server/cache-routes.ts +36 -0
- package/src/{serve → server}/chat-request.ts +10 -10
- package/src/{serve → server}/chat-stage.ts +14 -14
- package/src/{client.ts → server/client.ts} +28 -2
- package/src/{serve → server}/completion-executor.ts +33 -41
- package/src/server/decision-body.ts +55 -0
- package/src/server/decision-routes.ts +134 -0
- package/src/server/decision-wire.ts +228 -0
- package/src/{serve → server}/discovery-routes.ts +25 -82
- package/src/{serve → server}/http.ts +25 -13
- package/src/{serve → server}/inference-request.ts +5 -5
- package/src/server/job-routes.ts +20 -0
- package/src/server/media-prompt.ts +63 -0
- package/src/server/memory-completion-client.ts +46 -0
- package/src/server/model-routes.ts +192 -0
- package/src/{serve → server}/openai-wire.ts +3 -2
- package/src/{serve → server}/pipeline.ts +1 -1
- package/src/server/prompt-builder.ts +13 -0
- package/src/server/prompt-contracts.ts +17 -0
- package/src/server/proxy-routes.ts +187 -0
- package/src/server/publishing-routes.ts +41 -0
- package/src/{serve → server}/request-plan.ts +6 -8
- package/src/{serve → server}/request-prep.ts +47 -50
- package/src/{serve → server}/responses-client.ts +30 -13
- package/src/{responses.ts → server/responses.ts} +12 -93
- package/src/server/routes.ts +205 -0
- package/src/server/start.ts +72 -0
- package/src/server/status-routes.ts +108 -0
- package/src/{serve → server}/text-completion-stage.ts +25 -4
- package/src/server/text-prompt.ts +12 -0
- package/src/{serve → server}/token-streams.ts +36 -38
- package/src/server/worker-routes.ts +311 -0
- package/src/storage/paths.ts +61 -0
- package/src/web/assets.ts +37 -0
- package/src/web/{src → browser}/api.ts +5 -23
- package/src/web/browser/chat-host.ts +17 -0
- package/src/web/browser/installed-panels.ts +6 -0
- package/src/web/browser/main.ts +55 -0
- package/src/web/browser/markdown.ts +279 -0
- package/src/web/browser/memory-panel.ts +9 -0
- package/src/web/browser/palette.ts +64 -0
- package/src/web/browser/protocol.ts +13 -0
- package/src/web/browser/shell.ts +467 -0
- package/src/web/{src → browser}/status.ts +32 -36
- package/src/web/build.ts +51 -0
- package/src/web/public/app.html +1054 -0
- package/src/web/{sw.js → public/sw.js} +4 -3
- package/src/web/{vendor → public/vendor}/hljs-theme.css +2 -2
- package/src/web/{vendor → public/vendor}/hljs.js +2 -2
- package/THIRD_PARTY_LICENSES.md +0 -51
- package/docs/README.md +0 -107
- package/docs/archive/hlg-sampling.md +0 -350
- package/docs/archive/investigations/audio-input-plan.md +0 -356
- package/docs/archive/investigations/benchmark-ledger-through-v0.4.0.md +0 -3617
- package/docs/archive/investigations/chunk-finetune-experiment.md +0 -84
- package/docs/archive/investigations/colibri-glm52-port.md +0 -1486
- package/docs/archive/investigations/colibri-oracle-pin.md +0 -1284
- package/docs/archive/investigations/curve-bisector-routing.md +0 -123
- package/docs/archive/investigations/decode-roofline-lookagain.md +0 -348
- package/docs/archive/investigations/diffusion-gemma-port.md +0 -602
- package/docs/archive/investigations/dspark-handoff.md +0 -224
- package/docs/archive/investigations/expert-offload-single-user-moe.md +0 -292
- package/docs/archive/investigations/faithful-l1-consolidation.md +0 -310
- package/docs/archive/investigations/hlg-sampling-investigation.md +0 -970
- package/docs/archive/investigations/indexshare-performance-spike.md +0 -357
- package/docs/archive/investigations/kernel-perf-review-2026-07.md +0 -171
- package/docs/archive/investigations/lab-build-journal.md +0 -157
- package/docs/archive/investigations/minicpm5-decode-megakernel.md +0 -489
- package/docs/archive/investigations/openjarvis-fit.md +0 -198
- package/docs/archive/investigations/openwiki-evaluation.md +0 -249
- package/docs/archive/investigations/optimization_plan.md +0 -346
- package/docs/archive/investigations/orpo-base-uf-experiment-and-directions.md +0 -120
- package/docs/archive/investigations/orpo-flash-cce-pin-leak.md +0 -167
- package/docs/archive/investigations/orpo-uf-testing-handoff.md +0 -126
- package/docs/archive/investigations/pareto-specialized-runtime-findings.md +0 -92
- package/docs/archive/investigations/pi-builtin-investigation.md +0 -308
- package/docs/archive/investigations/pre-colibri-stabilization.md +0 -329
- package/docs/archive/investigations/qwen38-27b-campaign-log.md +0 -1092
- package/docs/archive/investigations/segmented-backward-handoff.md +0 -148
- package/docs/archive/investigations/starter-model-port-handoff.md +0 -342
- package/docs/archive/investigations/steel-flash-cce-handoff.md +0 -489
- package/docs/archive/investigations/the-dreaming-handoff.md +0 -141
- package/docs/archive/investigations/trainer-validation-experiment.md +0 -173
- package/docs/archive/planning/chat-ui-vision-memory-first.md +0 -199
- package/docs/archive/planning/chat-ui-vision.md +0 -50
- package/docs/archive/planning/chunk-task-roadmap.md +0 -77
- package/docs/archive/planning/curve-sampler-research-plan.md +0 -331
- package/docs/archive/planning/journal.md +0 -316
- package/docs/archive/planning/memory-docs-and-dag-plan.md +0 -194
- package/docs/archive/planning/pi-integration-review.md +0 -178
- package/docs/archive/planning/release-notes-v0.0.10.md +0 -57
- package/docs/archive/planning/release-notes-v0.0.11.md +0 -239
- package/docs/archive/planning/release-notes-v0.0.12.md +0 -80
- package/docs/archive/planning/release-notes-v0.0.13.md +0 -77
- package/docs/archive/planning/release-notes-v0.0.9.md +0 -122
- package/docs/archive/planning/release-notes-v0.2.0.md +0 -49
- package/docs/archive/planning/release-notes-v0.3.0.md +0 -35
- package/docs/archive/planning/release-notes-v0.4.0.md +0 -45
- package/docs/archive/planning/release-notes-v0.5.0.md +0 -37
- package/docs/archive/planning/web-ui-pass-plan.md +0 -213
- package/docs/archive/planning/website-readme-pass-plan.md +0 -224
- package/docs/design/batching.md +0 -2054
- package/docs/design/decode-speed-program.md +0 -2404
- package/docs/design/dreaming-nightly-pipeline.md +0 -684
- package/docs/design/generic-model-support.md +0 -821
- package/docs/design/kv-cache.md +0 -993
- package/docs/design/orpo-training.md +0 -680
- package/docs/design/speculative-decoding.md +0 -2129
- package/docs/design/turboquant.md +0 -2225
- package/docs/design/unified-engine-frontier-plan.md +0 -1987
- package/docs/design/web-chat-redesign.md +0 -695
- package/docs/planning/PRODUCT_ROADMAP.md +0 -593
- package/docs/planning/ResearchTopics.md +0 -119
- package/docs/planning/public-readiness-handoff.md +0 -244
- package/docs/planning/public-readiness.md +0 -149
- package/docs/planning/video-series.md +0 -421
- package/docs/reference/benchmarks.md +0 -3587
- package/docs/reference/cli.md +0 -646
- package/docs/reference/distribution.md +0 -380
- package/docs/reference/environment.md +0 -494
- package/docs/reference/glossary.md +0 -39
- package/docs/reference/library-api.md +0 -688
- package/docs/reference/memory.md +0 -260
- package/docs/reference/models.md +0 -346
- package/docs/reference/server-api.md +0 -1945
- package/docs/reference/server-config.md +0 -973
- package/docs/reference/training.md +0 -462
- package/docs/reference/troubleshooting.md +0 -158
- package/src/admission-plan.ts +0 -18
- package/src/audio/audiotoolbox.ts +0 -112
- package/src/audio/conformer.ts +0 -655
- package/src/audio/decode.ts +0 -133
- package/src/audio/features.ts +0 -202
- package/src/audio/mic-capture.ts +0 -98
- package/src/audio/silero-vad.ts +0 -379
- package/src/audio/transcode.ts +0 -67
- package/src/audio/whisper-decode.ts +0 -774
- package/src/audio/whisper-fast.ts +0 -732
- package/src/audio/whisper-format.ts +0 -73
- package/src/audio/whisper-mel.ts +0 -185
- package/src/audio/whisper-timing.ts +0 -274
- package/src/audio/whisper-tokenizer.ts +0 -239
- package/src/audio/whisper-transcribe.ts +0 -410
- package/src/backends/mlx/assistant-target.ts +0 -46
- package/src/backends/mlx/autoregressive-draft-rows.ts +0 -120
- package/src/backends/mlx/autoregressive.ts +0 -129
- package/src/backends/mlx/batch-group.ts +0 -1874
- package/src/backends/mlx/cache-attachment.ts +0 -67
- package/src/backends/mlx/cache-layout.ts +0 -31
- package/src/backends/mlx/checkpoint-state.ts +0 -53
- package/src/backends/mlx/continuation-persistence.ts +0 -107
- package/src/backends/mlx/continuation-request.ts +0 -43
- package/src/backends/mlx/continuation.ts +0 -77
- package/src/backends/mlx/diffusion.ts +0 -39
- package/src/backends/mlx/draft-target.ts +0 -32
- package/src/backends/mlx/encoder-cache.ts +0 -25
- package/src/backends/mlx/evaluation.ts +0 -105
- package/src/backends/mlx/fill-append.ts +0 -58
- package/src/backends/mlx/fill-group.ts +0 -497
- package/src/backends/mlx/full-kv-row-append.ts +0 -32
- package/src/backends/mlx/full-kv-row-donor.ts +0 -54
- package/src/backends/mlx/full-transitioning-kv-rows.ts +0 -65
- package/src/backends/mlx/gateway-binding.ts +0 -174
- package/src/backends/mlx/graph.ts +0 -38
- package/src/backends/mlx/kv-codec.ts +0 -9
- package/src/backends/mlx/kv-maintenance.ts +0 -161
- package/src/backends/mlx/kv-tensor-rows.ts +0 -212
- package/src/backends/mlx/memory-client.ts +0 -189
- package/src/backends/mlx/methods.ts +0 -90
- package/src/backends/mlx/mixed-iteration.ts +0 -62
- package/src/backends/mlx/model-prompt.ts +0 -178
- package/src/backends/mlx/model-serving.ts +0 -80
- package/src/backends/mlx/paged-cache-codec.ts +0 -27
- package/src/backends/mlx/prefill-cohort.ts +0 -100
- package/src/backends/mlx/prefill-policy.ts +0 -26
- package/src/backends/mlx/prefill-rows.ts +0 -244
- package/src/backends/mlx/prefill.ts +0 -33
- package/src/backends/mlx/projected-context-rows.ts +0 -72
- package/src/backends/mlx/prompt-input.ts +0 -29
- package/src/backends/mlx/qwen-prompt-input.ts +0 -40
- package/src/backends/mlx/request-policy.ts +0 -20
- package/src/backends/mlx/request-state-policy.ts +0 -54
- package/src/backends/mlx/rollback.ts +0 -92
- package/src/backends/mlx/row-sampling.ts +0 -49
- package/src/backends/mlx/serial-executor.ts +0 -251
- package/src/backends/mlx/speculative-group.ts +0 -438
- package/src/backends/mlx/speculative-round.ts +0 -161
- package/src/backends/mlx/speculative.ts +0 -131
- package/src/backends/mlx/state-rows.ts +0 -104
- package/src/backends/mlx/state-views.ts +0 -46
- package/src/backends/mlx/target-layout-capability.ts +0 -35
- package/src/backends/mlx/text-engine.ts +0 -73
- package/src/backends/mlx/transitioning-kv-rows.ts +0 -173
- package/src/chat-template.ts +0 -382
- package/src/cli.ts +0 -3490
- package/src/config.ts +0 -399
- package/src/contracts/completion.ts +0 -16
- package/src/contracts/execution.ts +0 -70
- package/src/contracts/generation.ts +0 -103
- package/src/contracts/host.ts +0 -7
- package/src/contracts/object-cache.ts +0 -8
- package/src/contracts/pi-provider.ts +0 -30
- package/src/contracts/pi.ts +0 -261
- package/src/contracts/prefix-cache.ts +0 -33
- package/src/contracts/resources.ts +0 -25
- package/src/contracts/sampling.ts +0 -23
- package/src/contracts/scheduling.ts +0 -54
- package/src/contracts/tsconfig.json +0 -14
- package/src/dataset/generators.ts +0 -1087
- package/src/dataset/index.ts +0 -12
- package/src/dataset/job.ts +0 -81
- package/src/dataset/llm.ts +0 -71
- package/src/dataset/registry.ts +0 -528
- package/src/diffusion/diffusion-generate.ts +0 -507
- package/src/download.ts +0 -505
- package/src/embed.ts +0 -77
- package/src/engine/admission.ts +0 -59
- package/src/engine/cancellation.ts +0 -38
- package/src/engine/engine.ts +0 -56
- package/src/engine/execution-coordinator.ts +0 -70
- package/src/engine/execution-plan.ts +0 -64
- package/src/engine/execution-tasks.ts +0 -44
- package/src/engine/namespaced-cache.ts +0 -13
- package/src/engine/resources.ts +0 -53
- package/src/engine/scheduler.ts +0 -92
- package/src/engine/session.ts +0 -247
- package/src/eval/README.md +0 -130
- package/src/eval/ifeval.ts +0 -81
- package/src/eval/kl-prompts.ts +0 -29
- package/src/eval/kl.ts +0 -590
- package/src/eval/perplexity.ts +0 -164
- package/src/eval/quality-db.ts +0 -92
- package/src/eval/reference-logits.ts +0 -207
- package/src/eval/runner.ts +0 -124
- package/src/eval/score.ts +0 -49
- package/src/eval/tasks/bfcl.ts +0 -535
- package/src/eval/tasks/gsm8k.ts +0 -98
- package/src/eval/tasks/hashhop.ts +0 -139
- package/src/eval/tasks/humaneval.ts +0 -275
- package/src/eval/tasks/ifeval.ts +0 -525
- package/src/eval/tasks/mmlu.ts +0 -157
- package/src/eval/ultrafeedback.ts +0 -60
- package/src/evaldb.ts +0 -199
- package/src/expert-io.ts +0 -393
- package/src/expert-offload-build.ts +0 -77
- package/src/expert-offload.ts +0 -76
- package/src/expert-residency.ts +0 -1134
- package/src/expert-usage.ts +0 -415
- package/src/fill/echo-index.ts +0 -188
- package/src/fill/fill-session.ts +0 -463
- package/src/fill/proposal.ts +0 -68
- package/src/fill/schema-rows.ts +0 -506
- package/src/fill/tool-boundary.ts +0 -103
- package/src/fit.ts +0 -249
- package/src/generate.ts +0 -1352
- package/src/grammar.ts +0 -604
- package/src/harness-pi.ts +0 -184
- package/src/hf-push.ts +0 -628
- package/src/hub-rest.ts +0 -242
- package/src/index.ts +0 -63
- package/src/inference/denoising.ts +0 -17
- package/src/inference/draft-acceptance.ts +0 -41
- package/src/inference/draft-output.ts +0 -49
- package/src/inference/graph.ts +0 -33
- package/src/inference/prefill.ts +0 -45
- package/src/inference/rollback.ts +0 -7
- package/src/jobs/index.ts +0 -31
- package/src/jobs/job-entry.ts +0 -107
- package/src/jobs/task-client.ts +0 -19
- package/src/jobs/types.ts +0 -2
- package/src/kv-scheme.ts +0 -279
- package/src/kv-store.ts +0 -1135
- package/src/lab/README.md +0 -22
- package/src/lab/curve/curve-designer.html +0 -303
- package/src/lab/curve/curve-sampler.ts +0 -122
- package/src/lab/expert-trace/expert-trace.ts +0 -69
- package/src/lab/paged-kv/paged-attention.ts +0 -117
- package/src/lab/paged-kv/paged-kv-rows.ts +0 -111
- package/src/lab/paged-kv/paged-kv.ts +0 -336
- package/src/library.ts +0 -40
- package/src/lora.ts +0 -408
- package/src/md-modules.d.ts +0 -54
- package/src/media-fetch.ts +0 -442
- package/src/memory/article.ts +0 -558
- package/src/memory/chunk-validation.ts +0 -150
- package/src/memory/chunk.ts +0 -318
- package/src/memory/cluster.ts +0 -351
- package/src/memory/coverage.ts +0 -134
- package/src/memory/crosslink.ts +0 -0
- package/src/memory/db.ts +0 -253
- package/src/memory/entity.ts +0 -203
- package/src/memory/gate.ts +0 -187
- package/src/memory/history.ts +0 -152
- package/src/memory/ingest.ts +0 -335
- package/src/memory/model.ts +0 -183
- package/src/memory/normalize.ts +0 -671
- package/src/memory/parse.ts +0 -22
- package/src/memory/pipeline.ts +0 -275
- package/src/memory/prompts.ts +0 -65
- package/src/memory/query.ts +0 -334
- package/src/memory/reconcile.ts +0 -734
- package/src/memory/redirect.ts +0 -108
- package/src/memory/reindex.ts +0 -325
- package/src/memory/resolve.ts +0 -307
- package/src/memory/rest.ts +0 -245
- package/src/memory/route.ts +0 -272
- package/src/memory/schedule.ts +0 -165
- package/src/memory/stages.ts +0 -777
- package/src/memory/synthesize.ts +0 -1638
- package/src/memory/tools.ts +0 -749
- package/src/memory/vault.ts +0 -1194
- package/src/memory/wikify.ts +0 -1064
- package/src/mlx/array.ts +0 -425
- package/src/mlx/autograd.ts +0 -304
- package/src/mlx/checkpoint.ts +0 -149
- package/src/mlx/compile.ts +0 -168
- package/src/mlx/custom-vjp.ts +0 -188
- package/src/mlx/ffi.ts +0 -531
- package/src/mlx/materialize.ts +0 -23
- package/src/mlx/metal-kernel.ts +0 -159
- package/src/mlx/normalized-argmax.ts +0 -116
- package/src/mlx/ops.ts +0 -1108
- package/src/mlx/quantized-rows.ts +0 -36
- package/src/mlx/token-bitmask.ts +0 -52
- package/src/mlx/turboquant-kv-decode.ts +0 -82
- package/src/mlx/turboquant-kv-inverse.ts +0 -122
- package/src/mlx/turboquant-ops.ts +0 -861
- package/src/mlx/turboquant-tables.ts +0 -237
- package/src/mmap.ts +0 -90
- package/src/model/artifact-identity.ts +0 -73
- package/src/model/batched-kv.ts +0 -235
- package/src/model/batched-mask.ts +0 -279
- package/src/model/batched-quant.ts +0 -212
- package/src/model/batched-quantized-kv.ts +0 -144
- package/src/model/batched-rotating-quant.ts +0 -353
- package/src/model/batched-rotating-state.ts +0 -149
- package/src/model/batched-rotating.ts +0 -338
- package/src/model/batched-row-storage.ts +0 -179
- package/src/model/batched-ssm.ts +0 -52
- package/src/model/batched-turboquant-kv.ts +0 -94
- package/src/model/compiled-decode.ts +0 -712
- package/src/model/decoded-kv-donor.ts +0 -12
- package/src/model/delayed-quantized-kv.ts +0 -72
- package/src/model/delayed-rotating-quantized-kv.ts +0 -93
- package/src/model/delayed-turboquant-kv.ts +0 -57
- package/src/model/diffusion-gemma.ts +0 -1026
- package/src/model/factory.ts +0 -215
- package/src/model/fingerprint.ts +0 -45
- package/src/model/flash-attention.ts +0 -694
- package/src/model/full-prefill-padding.ts +0 -56
- package/src/model/full-prefill-row.ts +0 -105
- package/src/model/gemma4-base.ts +0 -2370
- package/src/model/gemma4.ts +0 -1395
- package/src/model/generated/gemma4-12b.ts +0 -429
- package/src/model/generated/gemma4-26b.ts +0 -448
- package/src/model/generated/gemma4-e4b.ts +0 -717
- package/src/model/generated/index.ts +0 -18
- package/src/model/glm52-atlas.ts +0 -511
- package/src/model/glm52-cache.ts +0 -792
- package/src/model/glm52-config.ts +0 -262
- package/src/model/glm52-container.ts +0 -305
- package/src/model/glm52-coupling.ts +0 -388
- package/src/model/glm52-dsa.ts +0 -606
- package/src/model/glm52-expert-layout.ts +0 -253
- package/src/model/glm52-layout.ts +0 -152
- package/src/model/glm52-memory.ts +0 -500
- package/src/model/glm52-mla.ts +0 -792
- package/src/model/glm52-moe.ts +0 -223
- package/src/model/glm52-pilot.ts +0 -537
- package/src/model/glm52-reference.ts +0 -445
- package/src/model/glm52-residency.ts +0 -557
- package/src/model/glm52-resident-weights.ts +0 -135
- package/src/model/glm52-streamed-experts.ts +0 -453
- package/src/model/glm52-streamed-metal.ts +0 -610
- package/src/model/glm52-weights.ts +0 -503
- package/src/model/glm52.ts +0 -1132
- package/src/model/implementation.ts +0 -69
- package/src/model/kv-attention-view.ts +0 -70
- package/src/model/minicpm5.ts +0 -376
- package/src/model/profile.ts +0 -468
- package/src/model/quantized-append-attention.ts +0 -31
- package/src/model/qwen-append.ts +0 -12
- package/src/model/qwen-conv.ts +0 -52
- package/src/model/qwen3-delta-state.ts +0 -74
- package/src/model/qwen3-delta.ts +0 -451
- package/src/model/qwen3-moe.ts +0 -404
- package/src/model/qwen3-mrope.ts +0 -250
- package/src/model/qwen3.ts +0 -277
- package/src/model/qwen3_5-checkpoint.ts +0 -164
- package/src/model/qwen3_5.ts +0 -881
- package/src/model/rotating-kv-donor.ts +0 -35
- package/src/model/rotating-kv-layout.ts +0 -262
- package/src/model/rotating-row-transaction.ts +0 -35
- package/src/model/speculative-rotating-kv.ts +0 -101
- package/src/model/ssm-prefill-padding.ts +0 -39
- package/src/model/support.ts +0 -110
- package/src/model/token-groups.ts +0 -66
- package/src/model/trellis-balanced-scatter.ts +0 -51
- package/src/model/trellis-linear.ts +0 -672
- package/src/model/trellis-shared-m.ts +0 -151
- package/src/model/trellis-shared-scatter.ts +0 -144
- package/src/model/trellis-splitk-prefill.ts +0 -158
- package/src/model/trellis-tiled-prefill.ts +0 -136
- package/src/model/trellis-vector-expand.ts +0 -62
- package/src/model/trellis-wide-prefill.ts +0 -94
- package/src/model/turboquant-codec.ts +0 -89
- package/src/model/universal/archs.ts +0 -332
- package/src/model/universal/dense.ts +0 -612
- package/src/model/universal/modules.ts +0 -170
- package/src/model/universal/rope.ts +0 -381
- package/src/model/whisper.ts +0 -435
- package/src/native/expert_io.c +0 -523
- package/src/native/frame_extract.swift +0 -140
- package/src/native/mic_capture.swift +0 -92
- package/src/native-pack.ts +0 -163
- package/src/pi-provider.ts +0 -53
- package/src/pi-session.ts +0 -81
- package/src/pi-terminal.ts +0 -274
- package/src/pi-web.ts +0 -1940
- package/src/preflight.ts +0 -158
- package/src/prompt-cache.ts +0 -682
- package/src/quantize/allocator.ts +0 -627
- package/src/quantize/atomic-output.ts +0 -38
- package/src/quantize/calibration.ts +0 -181
- package/src/quantize/config-writer.ts +0 -145
- package/src/quantize/index.ts +0 -84
- package/src/quantize/job.ts +0 -162
- package/src/quantize/quantizer.ts +0 -666
- package/src/quantize/rotate.ts +0 -603
- package/src/quantize/safetensors-writer.ts +0 -249
- package/src/quantize/sensitivity.ts +0 -216
- package/src/quantize/trellis.ts +0 -586
- package/src/quantize/weight-transform.ts +0 -292
- package/src/registry.ts +0 -602
- package/src/runtime-config.ts +0 -77
- package/src/safetensors.ts +0 -165
- package/src/sampler.ts +0 -1012
- package/src/serve/admin-routes.ts +0 -184
- package/src/serve/assets/curve-terrain.html +0 -105
- package/src/serve/assets/training-inference-map.html +0 -575
- package/src/serve/audio-routes.ts +0 -323
- package/src/serve/aux-routes.ts +0 -132
- package/src/serve/batch-scheduler.ts +0 -8
- package/src/serve/checkpoint-identity.ts +0 -64
- package/src/serve/generation-gateway.ts +0 -537
- package/src/serve/isolate.ts +0 -609
- package/src/serve/kv-budget.ts +0 -14
- package/src/serve/lab-routes.ts +0 -341
- package/src/serve/lane-registry.ts +0 -45
- package/src/serve/model-admin-routes.ts +0 -155
- package/src/serve/model-binding.ts +0 -49
- package/src/serve/model-host.ts +0 -511
- package/src/serve/parent-application.ts +0 -56
- package/src/serve/prompt-response-trace.ts +0 -161
- package/src/serve/response-lease.ts +0 -24
- package/src/serve/session-search.ts +0 -326
- package/src/serve/static-routes.ts +0 -101
- package/src/serve/transcription-server.ts +0 -64
- package/src/serve/transcription-service.ts +0 -502
- package/src/server.ts +0 -1282
- package/src/spec/assistant-rows.ts +0 -93
- package/src/spec/assistant-source.ts +0 -126
- package/src/spec/cache-identity.ts +0 -22
- package/src/spec/deepspec-rows.ts +0 -29
- package/src/spec/deepspec-source.ts +0 -145
- package/src/spec/dflash-source.ts +0 -149
- package/src/spec/drafter.ts +0 -304
- package/src/spec/dspark/ab-stats.ts +0 -136
- package/src/spec/dspark/calibration.ts +0 -112
- package/src/spec/dspark/data-dflash.ts +0 -156
- package/src/spec/dspark/data.ts +0 -201
- package/src/spec/dspark/deepspec-module.ts +0 -776
- package/src/spec/dspark/generate-dflash.ts +0 -245
- package/src/spec/dspark/generate.ts +0 -290
- package/src/spec/dspark/loader.ts +0 -23
- package/src/spec/dspark/loss.ts +0 -213
- package/src/spec/dspark/module-dflash.ts +0 -560
- package/src/spec/dspark/module.ts +0 -540
- package/src/spec/dspark/quantize-drafter.ts +0 -91
- package/src/spec/dspark/sample.ts +0 -112
- package/src/spec/generate.ts +0 -276
- package/src/spec/glm52-mtp-graph.ts +0 -29
- package/src/spec/glm52-mtp-rows.ts +0 -132
- package/src/spec/glm52-mtp-source.ts +0 -318
- package/src/spec/glm52-mtp-state.ts +0 -33
- package/src/spec/ngram-source.ts +0 -226
- package/src/spec/projected-draft-rows.ts +0 -73
- package/src/spec/qwen-mtp-module.ts +0 -171
- package/src/spec/qwen-mtp-rows.ts +0 -230
- package/src/spec/qwen-mtp-source.ts +0 -386
- package/src/spec/qwen-mtp-state.ts +0 -30
- package/src/spec/serve-loop.ts +0 -587
- package/src/spec/source.ts +0 -228
- package/src/spec/two-model-rows.ts +0 -62
- package/src/spec/two-model.ts +0 -113
- package/src/ssd-cache.ts +0 -431
- package/src/ssd-durability.ts +0 -209
- package/src/storage/host-buffer.ts +0 -24
- package/src/storage/kv-writer.ts +0 -83
- package/src/storage/kv-writer.worker.js +0 -264
- package/src/storage/retention-policy.ts +0 -37
- package/src/tiered-prompt-cache.ts +0 -45
- package/src/tokenizer.ts +0 -335
- package/src/tool-approvals.ts +0 -131
- package/src/tool-call.ts +0 -695
- package/src/train/dataset.ts +0 -484
- package/src/train/diffusion-lora.ts +0 -216
- package/src/train/export.ts +0 -32
- package/src/train/flash-cce.ts +0 -1234
- package/src/train/forward.ts +0 -266
- package/src/train/fuse.ts +0 -243
- package/src/train/index.ts +0 -46
- package/src/train/job.ts +0 -205
- package/src/train/lora-params.ts +0 -254
- package/src/train/loss.ts +0 -1591
- package/src/train/merge.ts +0 -195
- package/src/train/optimizer.ts +0 -183
- package/src/train/prefix-shared.ts +0 -490
- package/src/train/rank.ts +0 -137
- package/src/train/segmented.ts +0 -1828
- package/src/train/steel-qmm-header.ts +0 -1461
- package/src/train/trainer.ts +0 -1221
- package/src/train/watch.ts +0 -542
- package/src/vision/diffusion-vision.ts +0 -620
- package/src/vision/embedder.ts +0 -176
- package/src/vision/preprocess.ts +0 -247
- package/src/vision/prompt.ts +0 -409
- package/src/vision/qwen3vl-preprocess.ts +0 -409
- package/src/vision/qwen3vl-prompt.ts +0 -233
- package/src/vision/qwen3vl-tower.ts +0 -566
- package/src/vision/siglip.ts +0 -607
- package/src/vision/video-frames.ts +0 -148
- package/src/web/app.html +0 -2155
- package/src/web/app.js +0 -5863
- package/src/web/skills/memory/SKILL.md +0 -120
- package/src/web/skills/web-research/SKILL.md +0 -46
- package/src/web/skills.ts +0 -97
- package/src/web/src/adapters-panel.ts +0 -288
- package/src/web/src/assistant.ts +0 -451
- package/src/web/src/chat.ts +0 -1060
- package/src/web/src/composer.ts +0 -962
- package/src/web/src/dataset.ts +0 -132
- package/src/web/src/finetune.ts +0 -267
- package/src/web/src/hub.ts +0 -428
- package/src/web/src/main.ts +0 -98
- package/src/web/src/markdown.ts +0 -0
- package/src/web/src/memory-panel.ts +0 -572
- package/src/web/src/model-picker.ts +0 -159
- package/src/web/src/palette.ts +0 -346
- package/src/web/src/protocol.ts +0 -26
- package/src/web/src/quantize.ts +0 -167
- package/src/web/src/rag.ts +0 -274
- package/src/web/src/sessions.ts +0 -469
- package/src/web/src/shell.ts +0 -804
- package/src/web/src/ui-catalog.ts +0 -78
- package/src/web/src/voice.ts +0 -141
- package/src/web/vendor/README.md +0 -61
- package/src/web-assets.ts +0 -47
- package/src/web-tools.ts +0 -478
- package/src/weights.ts +0 -255
- /package/src/{serve → server}/completion-sink.ts +0 -0
- /package/src/{serve → server}/generated-token-history.ts +0 -0
- /package/src/web/{icon.svg → public/icon.svg} +0 -0
- /package/src/web/{manifest.webmanifest → public/manifest.webmanifest} +0 -0
- /package/src/web/{vendor → public/vendor}/hljs-LICENSE +0 -0
|
@@ -1,1092 +0,0 @@
|
|
|
1
|
-
# Qwen3.8-27B optimization campaign — execution log (2026-09-04 → 2026-09-08)
|
|
2
|
-
|
|
3
|
-
Verbatim move of `docs/design/decode-speed-program.md` §7.8 ("Execution progress and next measurements"); the per-row outcomes, retained flags and open gates it fed are in that doc's §7.13. Evidence filenames resolve to `reports/qwen38-rd/` on the measuring host (Apple M4 Pro, 24 GB unless stated); host names are provenance, not scope.
|
|
4
|
-
|
|
5
|
-
## §7.8 Execution progress and next measurements (as archived)
|
|
6
|
-
|
|
7
|
-
Use the integrated memory safeguards and relevant numerical controls in
|
|
8
|
-
section 7.1, then measure the expensive computation. The existing benchmark
|
|
9
|
-
accepts an exact local artifact and can print its
|
|
10
|
-
commands without loading a model. The first prepared jobs are the affine
|
|
11
|
-
flagship on mlx-bun serial versus mlx-lm, followed by packed Q3 on mlx-bun
|
|
12
|
-
serial. Start at 4k context; widen only after the measured memory row.
|
|
13
|
-
The commands and preparation mode are documented in
|
|
14
|
-
[benchmarks.md](../reference/benchmarks.md#running-the-benchmark).
|
|
15
|
-
|
|
16
|
-
The harness now keeps all five decode samples, uses reproducible nonces with
|
|
17
|
-
`--workload-seed`, pins thinking mode across arms, and saves request bodies,
|
|
18
|
-
counts, finish reasons, errors and wall times in a JSON companion. It rejects
|
|
19
|
-
missing token usage instead of counting SSE chunks as tokens. Each block
|
|
20
|
-
still needs an explicit AB/BA order and a distinct output path; one harness
|
|
21
|
-
pass is a screening block, not the full paired-session confidence interval.
|
|
22
|
-
Identical decoded text and prompt counts remain a smoke check; engine logit
|
|
23
|
-
and token-ID gates provide the stronger correctness evidence.
|
|
24
|
-
|
|
25
|
-
The matched-prefill MTP control exposed a separate ordinary-generation
|
|
26
|
-
latency cost: the serial loop constructs the next decode step before yielding
|
|
27
|
-
token zero. A runtime-only source transform yields the first sampled token
|
|
28
|
-
before that construction, retaining the later pipeline and excluding fill,
|
|
29
|
-
grammar and resumed generation. Its initial packed-model pair preserves every
|
|
30
|
-
token ID, live cache state, cache key, usage count and finish reason at raw
|
|
31
|
-
prompt lengths 6/128/512. Native first-token latency improves while complete
|
|
32
|
-
generation time is approximately flat. Six lifecycle tests, the 26 existing
|
|
33
|
-
fill-loop tests and 15 binding tests pass with the prototype. One binding
|
|
34
|
-
cancellation expectation needs the new event order: token zero may arrive
|
|
35
|
-
before cancellation triggered inside the subsequent forward; no token arrives
|
|
36
|
-
after cancellation. Consumer return at that first yield leaves a correctly
|
|
37
|
-
described prompt-only cache. Those screens changed only the runtime-loaded module.
|
|
38
|
-
|
|
39
|
-
The first serial HTTP pair preserves all seven warm/measured responses but
|
|
40
|
-
does not reproduce the native TTFT improvement. Client-visible output can lag
|
|
41
|
-
token zero through detokenizer buffering. A separate sink observer confirms
|
|
42
|
-
that these raw prompts first generate bare-space token 220, which emits no
|
|
43
|
-
event, followed by token 17 (`2`), which emits content and yields for network
|
|
44
|
-
progress. Both arms preserve that sequence; earlier delivery of the hidden
|
|
45
|
-
space cannot improve client TTFT. Keep this negative result and test chat
|
|
46
|
-
fixtures before attributing a serving win or integrating the prototype.
|
|
47
|
-
Both screens keep sources fixed and exit cleanly. Evidence:
|
|
48
|
-
`first-yield-native-screen{,-review}.json`, `first-yield-http-screen.json`,
|
|
49
|
-
`first-yield-http-observe.json` and its per-server `*.sink.json` records,
|
|
50
|
-
`first-yield-smoke-candidate-v2.txt`, `first-yield-existing-loop-tests.txt` and
|
|
51
|
-
`first-yield-binding-order-tests.txt` in the campaign report directory.
|
|
52
|
-
|
|
53
|
-
The subsequent three-fixture chat HTTP screen preserves all seven paired
|
|
54
|
-
responses and improves first visible output on each measured fixture, with
|
|
55
|
-
approximately flat complete-request time. Evidence:
|
|
56
|
-
`first-yield-chat-http-screen{,-review}.json`. A simplified version captures
|
|
57
|
-
the current sample index before yielding and increments the normal generated
|
|
58
|
-
count immediately, avoiding a second stats counter. Its control passes eight
|
|
59
|
-
tests and the candidate passes 49 lifecycle, binding and fill-loop tests,
|
|
60
|
-
including two- and three-token budgets. The first budget test expected an
|
|
61
|
-
explicit native `length` reason, but the incumbent leaves budget completion
|
|
62
|
-
implicit; the corrected assertion preserves that contract. Evidence:
|
|
63
|
-
`first-yield-v2-{control-tests,tests,tests-corrected}.txt`. The simplified
|
|
64
|
-
prototype then completes six fresh-process native pairs. All 36 warm/measured
|
|
65
|
-
token, live-state, cache-key and usage comparisons agree; every measured pair
|
|
66
|
-
improves first-token latency at all three prompt lengths. Complete generation
|
|
67
|
-
time is approximately flat. All 12 children exit cleanly with fixed sources
|
|
68
|
-
and the same remaining active allocation after explicit cleanup. Evidence:
|
|
69
|
-
`first-yield-native-v2-repeat{,-review}.json`. Six chat server pairs then
|
|
70
|
-
complete all 84 requests with 42 exact response/count/finish comparisons.
|
|
71
|
-
Every measured pair improves first visible output, with approximately flat
|
|
72
|
-
complete-request time. The sampled native audit also preserves token IDs,
|
|
73
|
-
requested log probabilities and live cache state across two seeds and two
|
|
74
|
-
prompt lengths, with penalties enabled. Both runs keep sources fixed and
|
|
75
|
-
exit cleanly. Evidence: `first-yield-chat-http-v2-repeat{,-review}.json` and
|
|
76
|
-
`first-yield-sampled-native.json`. Other artifacts and cached/pressure
|
|
77
|
-
acceptance remain, including first-token consumer return and follow-up reuse.
|
|
78
|
-
|
|
79
|
-
The serial change is now integrated behind `MLX_BUN_EARLY_FIRST_TOKEN=1`,
|
|
80
|
-
default off. Its scheduling decision comes from the binding's captured
|
|
81
|
-
runtime; request and execution interfaces are unchanged. Eight permanent
|
|
82
|
-
binding tests cover both settings, captured-policy isolation, short budgets,
|
|
83
|
-
early return, cancellation and initial EOS. The focused tests and enabled-fill
|
|
84
|
-
regression pass, as do all three typechecks, hygiene and the complete
|
|
85
|
-
model-free suite: 1,831 pass, 10 skip, zero failures. The first cancellation
|
|
86
|
-
test incorrectly expected final stats after an exception; the corrected test
|
|
87
|
-
preserves the existing null-stats contract for aborted runs. Orderly consumer
|
|
88
|
-
return still reports the emitted token and exact cache key. Real-model and
|
|
89
|
-
HTTP flag comparisons follow the prototype measurements before this thread
|
|
90
|
-
can close. Evidence: `first-yield-production-unit{,-v2}.txt`,
|
|
91
|
-
`first-yield-production-fill-enabled.txt`, `first-yield-production-typecheck.txt`,
|
|
92
|
-
`first-yield-production-hygiene.txt` and `first-yield-production-model-free.txt`.
|
|
93
|
-
The integrated packed-model native pair preserves all six warm/measured
|
|
94
|
-
token/state/key/usage comparisons. Its serial HTTP pair completes 14 responses
|
|
95
|
-
with all seven paired text/count/finish checks exact. Both reproduce earlier
|
|
96
|
-
first-token delivery and keep sources fixed with clean child exits. A slow
|
|
97
|
-
HTTP warmup is retained; these integration screens do not replace the six
|
|
98
|
-
balanced prototype pairs for timing evidence. Evidence:
|
|
99
|
-
`first-yield-production-native-r6{,-review}.json` and
|
|
100
|
-
`first-yield-production-http-r6{,-review}.json`. Closed source-transform and
|
|
101
|
-
duplicate test helpers are removed; permanent tests and raw reports remain.
|
|
102
|
-
The first integrated RTN4 native pair also preserves all six token/state/key
|
|
103
|
-
comparisons. Its apparent large complete-time difference is not accepted as
|
|
104
|
-
a speed gain: step intervals change substantially within the control process,
|
|
105
|
-
system swap grows and final preflight records substantial Chrome CPU use.
|
|
106
|
-
Keep this correctness result and repeat timing before attribution. Evidence:
|
|
107
|
-
`first-yield-production-native-rtn4{,-review}.json` and per-token arrival times
|
|
108
|
-
in the same report. No unrelated application was stopped.
|
|
109
|
-
|
|
110
|
-
The continuous scheduler has its own first-output boundary: an empty group
|
|
111
|
-
finishes preparation and emits token zero, then advances decode before its
|
|
112
|
-
event-loop yield. A separate prototype adds a yield only when preparation
|
|
113
|
-
leaves exactly one active row and no queued arrivals. It preserves grouped
|
|
114
|
-
short admissions and stops immediately if the group closes during that await.
|
|
115
|
-
Nine scheduling tests pass for each control/candidate arm; an actual
|
|
116
|
-
continuous HTTP screen must verify wire placement and client arrival time.
|
|
117
|
-
Evidence: `first-prepare-scheduler-{control,candidate}.txt` and the frozen
|
|
118
|
-
`first-prepare-http-screen-plan.json` in the campaign report directory.
|
|
119
|
-
|
|
120
|
-
Six subsequent AB/BA blocks complete on the M4 Pro with 12 clean server exits,
|
|
121
|
-
84 responses and 42 exact paired responses, including counts, finish reasons
|
|
122
|
-
and cache usage. The actual continuous lane and submitted-row increment are
|
|
123
|
-
checked for every request. Median paired TTFT changes are -7.66% for code,
|
|
124
|
-
-7.90% for explanation and -5.63% for JSON, about 74–77 ms earlier. Complete
|
|
125
|
-
request time changes by +0.15%, +0.04% and +0.08%, respectively. One code pair
|
|
126
|
-
has 2.20% worse TTFT and remains in the report. The machine begins with Chrome
|
|
127
|
-
CPU activity and existing swap, so these are diagnostic measurements. Chrome
|
|
128
|
-
is unrelated background load; a Bun HTTP client sends requests directly to
|
|
129
|
-
the server without the chat UI. Source hashes remain fixed. Evidence is
|
|
130
|
-
`first-prepare-http-repeat{,-review}.json`; scheduler lifecycle and broader
|
|
131
|
-
request gates remain before integration.
|
|
132
|
-
|
|
133
|
-
The continuous option is now integrated under `MLX_BUN_EARLY_FIRST_TOKEN`,
|
|
134
|
-
default off. The MLX backend reads its captured runtime and passes a boolean
|
|
135
|
-
to the generic scheduler. No request or execution-contract field is added.
|
|
136
|
-
After the early yield, the scheduler restarts its policy loop so new arrivals,
|
|
137
|
-
cancelled queued work, admission holds and shutdown are observed before the
|
|
138
|
-
next step. Eight added unit cases cover those transitions, short-admission
|
|
139
|
-
grouping, an existing active row and cleanup on a failed yield. All 1,839
|
|
140
|
-
model-free tests, the three typechecks and hygiene pass. Integrated real HTTP,
|
|
141
|
-
cache, pressure and quiet gates remain. The integrated native option also
|
|
142
|
-
passes four sampled cases per artifact on packed Q3 and RTN4, preserving all
|
|
143
|
-
32 token IDs, requested log probabilities, cache keys, live KV/recurrent state
|
|
144
|
-
and usage. Each arm returns to the same measured native allocation baseline
|
|
145
|
-
after disposal. These are correctness checks, not repeated timing claims.
|
|
146
|
-
Evidence is `first-prepare-production-{unit,model-free,typecheck,hygiene}.txt`
|
|
147
|
-
and `first-yield-production-sampled-{r6,rtn4}.json`.
|
|
148
|
-
|
|
149
|
-
The first integrated continuous HTTP attempt is retained as a setup failure.
|
|
150
|
-
Its driver set the new option after MLX imports had captured the runtime, so
|
|
151
|
-
the candidate's execution counter remained zero and rejected the run. The
|
|
152
|
-
corrected driver sets the flag in the child environment before imports. Both
|
|
153
|
-
arms then execute the same instrumented production source, with seven early
|
|
154
|
-
yields in the candidate and zero in the control. All seven paired responses
|
|
155
|
-
and usage/finish checks pass, with fixed source and clean exits. TTFT improves
|
|
156
|
-
by 68–90 ms across the three measured fixtures; this one-block integration
|
|
157
|
-
check does not replace the six prototype timing pairs. Evidence is
|
|
158
|
-
`first-prepare-production-http-r6-v2{,-review}.json`; the original unsuffixed
|
|
159
|
-
report preserves the failed path-coverage check.
|
|
160
|
-
|
|
161
|
-
Nine packed-Q3 native cache-lifecycle pairs also pass. At prompt lengths
|
|
162
|
-
6/128/512, each arm either returns after one token, returns after two, or
|
|
163
|
-
aborts after one, then reuses its own borrowed cache for a 16-token follow-up.
|
|
164
|
-
An early first-token return/abort covers the prompt alone; the incumbent has
|
|
165
|
-
already fed token zero. Clean-return cache keys reflect those exact positions,
|
|
166
|
-
and an aborted generation retains the existing null-stats contract. A
|
|
167
|
-
one-token follow-up suffix with ordinary tail splitting gives matched M=1
|
|
168
|
-
forwards for any missing emitted token. All subsequent tokens, requested log
|
|
169
|
-
probabilities, final live cache states and cache keys match. Both processes
|
|
170
|
-
return to 16,390 native active bytes after disposal, without forced GC, and
|
|
171
|
-
the source stays fixed. This proves the covered native reuse transitions;
|
|
172
|
-
HTTP cache/SSD pressure and broader suffix shapes remain. Evidence is
|
|
173
|
-
`first-yield-production-cache-r6.json`. The same nine pairs also pass on RTN4,
|
|
174
|
-
including every follow-up token, requested log probability, cache key and live
|
|
175
|
-
state. Both RTN4 arms return to six native active bytes after disposal. Its
|
|
176
|
-
separate evidence is `first-yield-production-cache-rtn4.json`.
|
|
177
|
-
|
|
178
|
-
The broader native suffix screen completes 110 follow-ups across both Qwen
|
|
179
|
-
quants at suffix lengths 1/2/3/4/5/8/31/127/511/512/513. It does not pass
|
|
180
|
-
universal identity. After returning at token one, the early arm's prompt-only
|
|
181
|
-
cache makes the next prefill one token longer. Seven packed and six RTN4
|
|
182
|
-
cases change log probabilities or live state; two packed cases and one RTN4
|
|
183
|
-
case also change emitted IDs. Every two-token-return case remains exact.
|
|
184
|
-
Feeding the missing emitted token separately at M=1 restores exact stopped
|
|
185
|
-
state and all 22 aligned follow-ups, including requested log probabilities
|
|
186
|
-
and cache keys. Both arms return to their original active-allocation baselines.
|
|
187
|
-
This identifies a prefill-shape effect, not a seed mismatch or a corrupted
|
|
188
|
-
snapshot. Keep the option experimental; reconciling the first-token cache
|
|
189
|
-
boundary needs an implementation and performance gate before default
|
|
190
|
-
promotion. Evidence is `first-yield-suffix-qwen{,-review}.json`. The preceding
|
|
191
|
-
Llama smoke also records a natural 512-token suffix state/logprob difference.
|
|
192
|
-
|
|
193
|
-
The integrated option also passes the saved seven-request agent-boundary/SSD
|
|
194
|
-
gate in serial and actual continuous serving on the M4 Pro 24 GB. The first
|
|
195
|
-
six one-token budgets retain their original path; each lane's counter proves
|
|
196
|
-
the new option runs once on the final 512-token request. All 14 paired choices
|
|
197
|
-
and complete usage records match. The longest prompt has 14,465 tokens and
|
|
198
|
-
reuses the same 12,953-token prefix in every arm. All four final flushes report
|
|
199
|
-
14 durable entries, no pending/missing/failed snapshots, and a longest durable
|
|
200
|
-
prefix of 14,976 tokens. Sources stay fixed and all servers exit cleanly.
|
|
201
|
-
These non-streaming responses establish the covered memory/cache lifecycle,
|
|
202
|
-
not a TTFT result or an agent task success. Broader suffix shapes remain.
|
|
203
|
-
Evidence is
|
|
204
|
-
`first-token-production-long-{serial,continuous}{,-review}.json`.
|
|
205
|
-
|
|
206
|
-
Actual streaming HTTP cancellation and arrival checks now pass 120 requests
|
|
207
|
-
across eight Qwen servers, covering packed Q3 and RTN4, serial and continuous
|
|
208
|
-
serving, and both option settings. Each server aborts twice at headers and
|
|
209
|
-
twice at first output, then completes an independent recovery request after
|
|
210
|
-
each abort. The server observes all 32 cancellations and settles before
|
|
211
|
-
consuming the 512-token budget. Every recovery response, usage record and
|
|
212
|
-
finish reason matches its reference. Final active MLX allocation equals the
|
|
213
|
-
loaded-model baseline exactly, with no cache entries or active/pending rows.
|
|
214
|
-
One-token budgets also remain exact. Both overlapping-arrival fixtures
|
|
215
|
-
observe two active rows in continuous serving, with actual admission counts;
|
|
216
|
-
serial serving remains serial. All sources stay fixed and servers exit
|
|
217
|
-
cleanly. A preceding Llama smoke adds 60 requests and 16 cancellations.
|
|
218
|
-
These instrumented checks establish lifecycle behavior, not speed. Concurrent
|
|
219
|
-
trajectories are not compared across differing admission timing and batch
|
|
220
|
-
shapes. Evidence is `first-token-lifecycle-{llama,qwen}{,-review}.json`.
|
|
221
|
-
|
|
222
|
-
The first actual continuous HTTP pair then completes all 14 requests with
|
|
223
|
-
seven exact response/count/finish comparisons and verified batched placement.
|
|
224
|
-
First visible output improves on all three measured chat fixtures; complete
|
|
225
|
-
time varies slightly. Both servers exit cleanly with fixed sources. This
|
|
226
|
-
remains a prototype pending balanced repeats and broader scheduling gates.
|
|
227
|
-
Evidence: `first-prepare-http-screen{,-review}.json`.
|
|
228
|
-
|
|
229
|
-
The first performance work after the pull uses the packed artifact's actual
|
|
230
|
-
k2/k3/k4 matrices. The M=1/2/3/4/5/8 screen identifies the gate/up crossover
|
|
231
|
-
and the down-projection bit-width asymmetry. Shared-M reduce and fused gate/up
|
|
232
|
-
kernels are retained as experimental variant 7 after exact matrix/MLP checks
|
|
233
|
-
and six balanced diagnostic A/B blocks. Variant 8 adds a balanced and aligned
|
|
234
|
-
3-bit down kernel; it improves the observed M=1/2/4 full-model forwards while
|
|
235
|
-
preserving logits, live state and subsequent-token checks. A device LUT for the existing f32
|
|
236
|
-
code values loses on this M4 and is recorded as a negative result. Kernel
|
|
237
|
-
implementation, commands and evidence live in turboquant.md's packed-kernel section.
|
|
238
|
-
|
|
239
|
-
The full packed 27B passes logits, live recurrent/KV state and subsequent-token
|
|
240
|
-
identity at M=1..5. Six paired native-forward blocks also retain the gain at
|
|
241
|
-
M=2/4, but they use a short synthetic prefix and project every output position.
|
|
242
|
-
They are not HTTP decode, verified MTP or strict-fill throughput measurements.
|
|
243
|
-
The existing exact-artifact graph/session/cache gate passes on the packed
|
|
244
|
-
model as well. Variant 6 remains the default.
|
|
245
|
-
|
|
246
|
-
The packed 27B strict-fill regression passes on variants 6 and 7: nonzero
|
|
247
|
-
assert injection, no verification events and exactly matching emitted tokens.
|
|
248
|
-
This is one tool-call fixture, not a held-out determinism or timing result.
|
|
249
|
-
The last-position-only native append sweep covers M=1/2/3/4/5/8/9/16 with
|
|
250
|
-
six paired blocks, preserving candidate/current logits and live state in every
|
|
251
|
-
cell. It retains the small-M gain and confirms the M=4/5 whole-model cost
|
|
252
|
-
discontinuity. Raw evidence: `reports/qwen38-rd/shared-m-append-lengths.json`.
|
|
253
|
-
|
|
254
|
-
Variant 10 now shares scatter decode across small M as well. It passes the
|
|
255
|
-
same exact full-model gates and improves M=2..4 against variant 8 in six
|
|
256
|
-
paired native blocks. Variant 9 separately moves expanded-projection
|
|
257
|
-
evaluation to the existing layer boundary. Its observed outputs agree, but
|
|
258
|
-
peak memory rises. Extending the packed crossover to M=8 is a distinct Lab
|
|
259
|
-
candidate with observed output differences. The packed-kernel section in
|
|
260
|
-
turboquant.md owns these implementations and evidence.
|
|
261
|
-
|
|
262
|
-
Integrated variant 11 adds direct tiled gate/up prefill for M=5..32, with
|
|
263
|
-
the same full-model logit/state gates and paired native improvement against
|
|
264
|
-
variant 10. The operation has no model-name dependency; its dispatch profile
|
|
265
|
-
currently covers the measured Qwen MLP geometry. It also improves the strict
|
|
266
|
-
fill fixture's complete generation time in six paired fill/no-fill blocks,
|
|
267
|
-
with identical emitted tokens and no verification forwards. This remains
|
|
268
|
-
fixture evidence, not a universal determinism proof. Evidence:
|
|
269
|
-
`variant11-full-model-review.json` and
|
|
270
|
-
`strict-fill-v11-cap32-served-eos.review.json`. Six paired raw-completion
|
|
271
|
-
HTTP blocks per method improve first-token and complete-request latency,
|
|
272
|
-
with identical output, through strict serial and continuous B=1 execution.
|
|
273
|
-
They cover one six-token prompt and eight/64 output tokens; concurrency and
|
|
274
|
-
broader-workload conclusions remain open. Evidence: `trellis-v11-http.json`
|
|
275
|
-
and `trellis-v11-http-review.json`.
|
|
276
|
-
|
|
277
|
-
Variant 12 adds tiled split-K down projection at M=5..8. The integrated
|
|
278
|
-
kernel passes exact full-model logits/state/continuation checks and improves
|
|
279
|
-
six native paired blocks without changing the paths outside that range.
|
|
280
|
-
Its implementation and sweep evidence live in turboquant.md. Serving and
|
|
281
|
-
combined-candidate measurements remain separate gates. The combined variant
|
|
282
|
-
12 versus original variant 6 now passes six raw-completion HTTP pairs for
|
|
283
|
-
each serial/default scheduling method, with matching text and actual token
|
|
284
|
-
counts at eight/64 output tokens. Source hashes stay fixed throughout all
|
|
285
|
-
24 bounded server processes. These one-prompt, B=1 diagnostics improve both
|
|
286
|
-
TTFT and complete-request latency; they do not establish concurrent load or
|
|
287
|
-
quiet-machine performance. Evidence: `trellis-v12-combined-http.json` and
|
|
288
|
-
`trellis-v12-combined-http-review.json`. The exact-input native control also
|
|
289
|
-
improves first-token and complete-request time in six paired blocks per
|
|
290
|
-
output length, with identical emitted IDs. One candidate worker escaped
|
|
291
|
-
through Bun with a C++ exception; its traced replay and the complete repeated
|
|
292
|
-
pair succeed. The original failed block is retained and excluded from timing
|
|
293
|
-
aggregation. This does not close the runtime reliability issue. Evidence:
|
|
294
|
-
`trellis-v12-combined-native-review.json`, its original/resumed reports and
|
|
295
|
-
`trellis-v12-native-failure-replay.json`.
|
|
296
|
-
|
|
297
|
-
The packed serving comparison now also covers four simultaneous raw
|
|
298
|
-
completions. Six fresh-process pairs compare variants 6 and 12, with a warm
|
|
299
|
-
four-request wave followed by a measured wave. Every arm observes four active
|
|
300
|
-
batch rows, all responses/counts/finish reasons agree, and the candidate
|
|
301
|
-
improves complete-wave throughput in every pair. Prompt and SSD caches are
|
|
302
|
-
disabled; the source snapshot stays fixed and all twelve servers exit cleanly.
|
|
303
|
-
These diagnostics establish that the shared small-M kernels improve actual
|
|
304
|
-
concurrent serving, alongside the earlier B=1 results. Mixed lengths, larger
|
|
305
|
-
concurrency and quiet-machine acceptance remain separate gates.
|
|
306
|
-
Evidence: `trellis-concurrent-http.json` and
|
|
307
|
-
`trellis-concurrent-http-review.json`.
|
|
308
|
-
|
|
309
|
-
The operation trace led to smaller M=5..8 matrix tiles and deferred evaluation
|
|
310
|
-
for direct tiles. Dense expansion retains its projection boundary. The
|
|
311
|
-
integrated kernels pass targeted units and an old-source/new-source comparison
|
|
312
|
-
at ten append lengths, including logits, live cache bytes and continuation.
|
|
313
|
-
Six subsequent HTTP process pairs compare the previous and updated variant 12
|
|
314
|
-
at B=1 and eight concurrent requests. Every wave observes the expected active
|
|
315
|
-
row count; all paired warmup and measured responses, token counts and finish
|
|
316
|
-
reasons agree. Eight-request throughput improves consistently; B=1 first-token
|
|
317
|
-
latency improves, with a much smaller complete-request gain. All twelve servers
|
|
318
|
-
exit cleanly and the source hashes remain fixed. The initial explicit-seed
|
|
319
|
-
pilot routed through serial and is excluded from batching evidence. These
|
|
320
|
-
remain loaded-machine diagnostics (measured on the M4 Pro), with variant 6 unchanged. Evidence:
|
|
321
|
-
`trellis-tile-integrated-forward-review.json`, `trellis-tile-http-review.json`
|
|
322
|
-
and `trellis-tile-seeded-serial-http-review.json` in the campaign directory.
|
|
323
|
-
Six old/new native process pairs also preserve all 64 emitted IDs and finish
|
|
324
|
-
reasons in warmup and measurement. First-token latency improves in every pair;
|
|
325
|
-
the complete native request improves slightly because single-row decode is
|
|
326
|
-
unchanged. All twelve workers complete with fixed source hashes. Evidence:
|
|
327
|
-
`trellis-tile-native.json` and `trellis-tile-native-review.json`.
|
|
328
|
-
The tile and evaluation-boundary experiments are detailed in turboquant.md.
|
|
329
|
-
|
|
330
|
-
The existing `bench-serve.ts all` suite also completes two AB/BA process pairs
|
|
331
|
-
for packed variants 6 and 12 with the serial arm, fixed workload seed and 192
|
|
332
|
-
decode tokens. Source snapshots match across all four runs. All 38 paired
|
|
333
|
-
recorded requests and the separate raw/chat parity probes agree; every server
|
|
334
|
-
exits cleanly, all SSD entries are durable, and no failed samples are dropped.
|
|
335
|
-
Single-request decode improves consistently at both tested contexts. Cold
|
|
336
|
-
prefill improves modestly; warm first-token latency varies between pairs and
|
|
337
|
-
sampled RSS shows no reduction. The requested context target produces 2,679
|
|
338
|
-
actual prompt tokens. The four-request aggregate leg is serial queue throughput,
|
|
339
|
-
not batching evidence. This loaded-machine diagnostic (M4 Pro 24 GB) does not promote a default or
|
|
340
|
-
replace quiet-machine acceptance. Evidence:
|
|
341
|
-
`single-request-suite-packed.json` and `single-request-suite-packed-review.json`,
|
|
342
|
-
with all four raw suite reports in the campaign directory.
|
|
343
|
-
|
|
344
|
-
Variant 13 adds vectorized packed-weight expansion after a larger fused-tile
|
|
345
|
-
screen failed to beat native matmul. The operation and packing contract are
|
|
346
|
-
documented in turboquant.md. Focused tests cover every codebook state, circular
|
|
347
|
-
windows, scale dtypes, strided inputs and fallback. The integrated 12/13
|
|
348
|
-
comparison preserves logits, live cache bytes and continuation at five append
|
|
349
|
-
lengths across seven blocks, including six measured AB/BA pairs. Actual kernel
|
|
350
|
-
calls confirm the eligible prefills improve while M=1/8 retain their existing
|
|
351
|
-
path. All three typechecks, hygiene and 1,795 model-free tests pass. Evidence:
|
|
352
|
-
`trellis-vector-integrated-full-model-review.json` and
|
|
353
|
-
`trellis-vector-integrated-{unit,typecheck,hygiene,model-free}.txt` in the
|
|
354
|
-
campaign report directory.
|
|
355
|
-
|
|
356
|
-
Two subsequent AB/BA pairs through the existing serving suite preserve all 38
|
|
357
|
-
paired requests, raw/chat parity and SSD restart durability. All four servers
|
|
358
|
-
exit cleanly with fixed source snapshots and no failures. Cold TTFT at the
|
|
359
|
-
smaller prefill improves modestly, while decode, long-context TTFT and RSS are
|
|
360
|
-
approximately flat. Cached TTFT varies substantially, so it is not an accepted
|
|
361
|
-
kernel gain. An external browser/build/test burst occurs near the first pair's
|
|
362
|
-
transition and is retained in the observations. This result does not establish
|
|
363
|
-
a broad serving improvement or promote variant 13. Quiet-machine acceptance
|
|
364
|
-
remains. Evidence: `vector-expand-suite-packed.json`,
|
|
365
|
-
`vector-expand-suite-packed-review.json` and
|
|
366
|
-
`vector-expand-suite-load-observations.json` in the campaign directory.
|
|
367
|
-
|
|
368
|
-
Six further serial HTTP AB/BA pairs isolate 6/16/128/512-token prompts with
|
|
369
|
-
64 generated tokens and prompt/SSD caching disabled. Each shape receives a
|
|
370
|
-
separate warmup; all first-shape timings are retained. Every paired response,
|
|
371
|
-
token count and finish reason matches across all 54 warmup/measured requests,
|
|
372
|
-
sources remain fixed, and all twelve servers shut down cleanly. TTFT and
|
|
373
|
-
complete-request time improve in every 16/128-token pair. The six-token
|
|
374
|
-
control and decode speed are flat; the 512-token and sampled RSS results are
|
|
375
|
-
less consistent. Six default-scheduler pairs repeat the improvement at
|
|
376
|
-
16/128 tokens, with exact responses, fixed sources and clean shutdowns.
|
|
377
|
-
Per-request telemetry proves scheduler admission. Existing swap usage and
|
|
378
|
-
background CPU activity keep both series (measured on the M4 Pro) diagnostic; the 512-token
|
|
379
|
-
effect remains less consistent. Evidence:
|
|
380
|
-
`trellis-vector-short-http-paired-{serial,default}.json` and the corresponding
|
|
381
|
-
`-review.json` files in the campaign directory. Quiet, second-machine and
|
|
382
|
-
pressure acceptance remain before any default promotion.
|
|
383
|
-
|
|
384
|
-
The updated affine controls now complete six alternating Bun/MLX-LM process
|
|
385
|
-
pairs for each flagship, compact and RTN4 artifact. They use the same six raw
|
|
386
|
-
prompt IDs, 64 output tokens, tokenizer/model EOS handling, production wiring
|
|
387
|
-
decisions and fresh-cache cleanup. Every pair emits identical IDs. Complete
|
|
388
|
-
native request time is close, with a small median Bun advantage; MLX-LM has
|
|
389
|
-
slightly lower first-token latency. These diagnostic controls establish no
|
|
390
|
-
new kernel win or HTTP conclusion. All 36 workers finish and the source
|
|
391
|
-
snapshot stays fixed. Evidence: `native-affine-paired.json` and
|
|
392
|
-
`native-affine-paired-review.json` in the campaign report directory.
|
|
393
|
-
|
|
394
|
-
The shared grammar bitmask candidate compares host expansion, direct Metal,
|
|
395
|
-
compiled Metal and XGrammar's compiled MLX bitmap-table approach. The compiled
|
|
396
|
-
Metal operation preserves the additive mask's bytes for bf16/f16/f32,
|
|
397
|
-
strided inputs, missing words, signed zero and nonfinite values. Its owned
|
|
398
|
-
host snapshot survives matcher mutation before lazy evaluation. Repeated
|
|
399
|
-
calls release their arrays after stream synchronization. Complete greedy,
|
|
400
|
-
sampled and logprob-enabled sampling retains identical selected tokens and
|
|
401
|
-
logprob bytes across changing masks at three vocabulary sizes, and improves
|
|
402
|
-
eight paired blocks against the actual host loop. An earlier probe used a
|
|
403
|
-
slower host callback expansion and is excluded from performance evidence.
|
|
404
|
-
Grammar integration is opt-in pending actual serving measurements. Evidence:
|
|
405
|
-
`token-mask-probe.json`, `token-bitmask-unit.txt` and
|
|
406
|
-
`token-bitmask-grammar-metal.txt`, plus `token-mask-sampling.json` and
|
|
407
|
-
`token-mask-sampling-review.json` in the report directory.
|
|
408
|
-
|
|
409
|
-
The first dense attention prototype adapts vLLM-Metal's register-resident
|
|
410
|
-
online softmax. It reduces temporary memory but loses the timing screen.
|
|
411
|
-
Instantiating pinned MLX Steel attention at head dimension 256 is faster on
|
|
412
|
-
some self-attention shapes, while the long-K/short-Q suffix case remains
|
|
413
|
-
slower. Tiling must follow both lengths and the device's workspace limit.
|
|
414
|
-
This changes numerics relative to the current unfused bf16 path and stays
|
|
415
|
-
Lab pending model and task-quality checks. Evidence:
|
|
416
|
-
`steel-attention-tune-manifest.json` and its per-tile reports. The initial
|
|
417
|
-
probe's small-head error metrics used physical output order; the corrected
|
|
418
|
-
contiguous readback agrees with the pinned oracle and CPU reference in
|
|
419
|
-
`attention-cpu-check.json` and `attention-oracle-check.json`.
|
|
420
|
-
The full packed-model Steel test is flat at 128/512 prompt tokens; one
|
|
421
|
-
512-token cell exceeds its predeclared last-logit KL screen, despite matching
|
|
422
|
-
the observed argmax. It has no model-level speed or quality acceptance.
|
|
423
|
-
Moving Q into threadgroup storage and transposing K storage did not rescue
|
|
424
|
-
the separate register-based prototype's timing. Evidence:
|
|
425
|
-
`attention-full-model-packed-128-512-review.json` and
|
|
426
|
-
`dense-attention-memory-tune-review.json`. Larger-context and exact-arithmetic
|
|
427
|
-
attention candidates remain separate experiments.
|
|
428
|
-
|
|
429
|
-
Graph export now records the existing evaluation boundaries for variants
|
|
430
|
-
6/8 at M=1/4/5. Small-M forward has one final evaluation boundary. M=5 has
|
|
431
|
-
192 projection evaluations, 64 layer evaluations and a final evaluation.
|
|
432
|
-
The exported graphs identify the exercised operations, including affine
|
|
433
|
-
projections, packed custom kernels, GDN, convolution, norms, RoPE, attention
|
|
434
|
-
and casts. Counts are exported operation occurrences, not GPU dispatches.
|
|
435
|
-
Raw graphs and the manifest are in `reports/qwen38-rd/graph-captures/`.
|
|
436
|
-
|
|
437
|
-
An attached Metal System Trace captures the warmed Bun target and its GPU
|
|
438
|
-
encoder intervals. The installed release MLX labels only command buffers
|
|
439
|
-
and encoders, so individual-kernel duration attribution remains open. The
|
|
440
|
-
capture covers part of prefill and decode; it is not a complete TTFT trace.
|
|
441
|
-
The first launch-based capture contains no target GPU work and is excluded.
|
|
442
|
-
Evidence: `variant8-attached.trace` and `attached-trace-summary.json` in the
|
|
443
|
-
same report directory. A pinned MLX source checkout supports inspection of
|
|
444
|
-
the actual dispatch and an isolated profiling build without changing the
|
|
445
|
-
oracle or installed runtime.
|
|
446
|
-
|
|
447
|
-
The isolated profiling build now records the kernel name, dispatch grid,
|
|
448
|
-
threadgroup geometry and pipeline limits for each submitted dispatch. A second
|
|
449
|
-
attached trace adds operation labels to encoder scopes. Those scopes contain
|
|
450
|
-
multiple operations, including zero-work views, so their GPU duration cannot
|
|
451
|
-
be attributed to the label's final operation. The selected Xcode counter
|
|
452
|
-
profile is unsupported on this M4 and exports no shader or counter samples.
|
|
453
|
-
Use the dispatch inventory to select isolated operation experiments while
|
|
454
|
-
individual GPU timing remains open. Evidence: `labelled-v8-analysis.json`,
|
|
455
|
-
`labelled-v8-kernels.txt` and `variant8-labelled.trace` in the report directory.
|
|
456
|
-
|
|
457
|
-
A direct device capability query exposes timestamp counters only at compute
|
|
458
|
-
stage boundaries on this M4 Pro. Dispatch-level sampling is unsupported.
|
|
459
|
-
The isolated pinned runtime now samples each operation in a separate encoder,
|
|
460
|
-
reserving two slots in a shared counter buffer and resolving them once per
|
|
461
|
-
completed command buffer. A per-operation allocation first exhausted Metal's
|
|
462
|
-
sample-buffer resources; a larger pool exceeded its documented-in-error size
|
|
463
|
-
limit. Both failed attempts are retained, and the final pool fits that limit.
|
|
464
|
-
The installed native library and Python oracle are unchanged.
|
|
465
|
-
|
|
466
|
-
Calibration compares the release library, the isolated build without
|
|
467
|
-
segmentation, segmentation alone, and counters. At B=1 and append lengths
|
|
468
|
-
1/4/8/128 from a 32-token prefix, every arm preserves logits, live cache bytes
|
|
469
|
-
and one continuation across one warmup and three measured forwards. The
|
|
470
|
-
instrumented full-forward overhead is small in this screen. All recorded
|
|
471
|
-
timestamps are valid, and sampled CPU/GPU clock pairs agree. These are
|
|
472
|
-
operation-encoder intervals: operations with multiple dispatches stay grouped,
|
|
473
|
-
intervals can overlap and include waits, and their sum is not GPU wall time
|
|
474
|
-
or critical-path attribution. The small-M trace directs further work toward
|
|
475
|
-
packed projections and affine matvecs; the eight-token trace exposes the
|
|
476
|
-
cost of the tiled prefill path. Evidence: `metal-counter-capabilities.json`,
|
|
477
|
-
`mlx-counter-source-manifest.json`, `mlx-counter-build.patch`,
|
|
478
|
-
`metal-counter-pooled-unit.stderr.txt` and
|
|
479
|
-
`metal-counter-calibration-review.json` in the report directory.
|
|
480
|
-
|
|
481
|
-
A separate schedule recorder now preserves MLX's normal encoder and command
|
|
482
|
-
buffer boundaries. It counts existing dispatches, barriers, fence waits and
|
|
483
|
-
temporary references, and reads command-buffer GPU start/end times in the
|
|
484
|
-
completion handler, following [Metal's timing contract](https://developer.apple.com/documentation/metal/mtlcommandbuffer/gpustarttime).
|
|
485
|
-
It rejects simultaneous operation segmentation. The first smoke test exposes
|
|
486
|
-
a unit mistake in the recorder: the pinned runtime's `buffer_sizes_` adds
|
|
487
|
-
`data_size()`, which counts dtype elements. Correct the recorder to report
|
|
488
|
-
that heuristic as elements and multiply by item size for temporary bytes.
|
|
489
|
-
The effective M4 Pro submission defaults are 50 dispatches and 50 shifted
|
|
490
|
-
element-count units. The setting's upstream name remains
|
|
491
|
-
`MLX_MAX_MB_PER_BUFFER`; it is not a literal byte ceiling. Temporary-reference
|
|
492
|
-
totals are also not peak resident memory.
|
|
493
|
-
|
|
494
|
-
The corrected recorder passes 45 complete generations across Llama 1B and
|
|
495
|
-
Qwen packed/RTN4, comparing the ordinary library, the isolated library without
|
|
496
|
-
telemetry and the recorder with native/raw/compiled sampler arms. Every
|
|
497
|
-
token, live state byte and usage record agrees. Warmed complete timings show
|
|
498
|
-
no clear systematic instrumentation shift in this screen; repeated overhead
|
|
499
|
-
calibration remains necessary for quantitative timing attribution. The
|
|
500
|
-
64-token packed sampling trace loses four dispatches per token with fusion,
|
|
501
|
-
but all three sampler arms still submit 3,905 buffers containing dispatches.
|
|
502
|
-
Many additional buffers contain no kernel dispatches; they may still carry
|
|
503
|
-
event waits or signals. Audit callers before attempting to remove them.
|
|
504
|
-
Command-buffer spans include internal waits, so their union is not kernel
|
|
505
|
-
active time or device utilization. Evidence is `mlx-schedule-source-manifest.json`,
|
|
506
|
-
`mlx-schedule-smoke-v2.log` and `top-p-schedule-screen{,-review}.json`.
|
|
507
|
-
|
|
508
|
-
A separate caller trace attributes 24 zero-dispatch submissions during steady
|
|
509
|
-
packed greedy decode to the pressure branch in MLX's `eval_impl`, reached
|
|
510
|
-
through `async_eval`. That branch finalizes open GPU streams before waiting
|
|
511
|
-
for outstanding work. All three traced generations preserve emitted IDs,
|
|
512
|
-
live cache bytes and usage against the calibrated recorder. Startup-only
|
|
513
|
-
stacks had instead reached final evaluation and synchronization, so they
|
|
514
|
-
could not establish the steady decode cause. The trace adds CPU logging and
|
|
515
|
-
is not timing evidence. These observations do not establish that an empty
|
|
516
|
-
dispatch list has no event work. Keep the validated recorder separate from
|
|
517
|
-
the caller-trace build. Evidence is `empty-submit-r6-steady-trace{,-review}.json`
|
|
518
|
-
and `mlx-empty-submit-steady-source-manifest.json`.
|
|
519
|
-
|
|
520
|
-
The next stock-library screen varies MLX's command-buffer submission limits,
|
|
521
|
-
bounded breadth-first graph traversal and optional Metal synchronization
|
|
522
|
-
implementation. Measure complete warmed generation, with matching token IDs,
|
|
523
|
-
requested log probabilities and live state, before changing native code or
|
|
524
|
-
retaining a setting. New-shape prefill cells are correctness screens until
|
|
525
|
-
their shapes are warmed in both arms. Positive cells require balanced native
|
|
526
|
-
and actual serial/continuous HTTP repeats, plus memory and disposal checks.
|
|
527
|
-
The frozen screen is `graph-schedule-screen-plan.json`.
|
|
528
|
-
|
|
529
|
-
That first screen passes all 120 generations and 27 complete arm comparisons
|
|
530
|
-
on Llama 1B and Qwen packed/RTN4. No packed-model decode setting has a
|
|
531
|
-
compelling first-pass gain. The later RTN4 timings overlap with unrelated
|
|
532
|
-
disburse TypeScript/Vite/Playwright jobs, including higher load and swap use.
|
|
533
|
-
Exclude RTN4 timing from tuning decisions and repeat it after those workers
|
|
534
|
-
exit; retain its exactness results. Llama's smaller-buffer observation needs
|
|
535
|
-
balanced repeats. Evidence is `graph-schedule-screen{,-review}.json` and
|
|
536
|
-
`graph-schedule-screen-contamination.json`. Retained tuning belongs at the
|
|
537
|
-
existing model-owned execution seams; these experiments do not establish
|
|
538
|
-
new global defaults.
|
|
539
|
-
|
|
540
|
-
The RTN4 rescreen completes 40 generations with nine exact arm comparisons,
|
|
541
|
-
including a return to the default settings at the end. The apparent 0.94%
|
|
542
|
-
greedy gain with traversal width 64 matches the ending default's 0.92% drift;
|
|
543
|
-
sampled generation is flat in both. Larger submission limits also fail to
|
|
544
|
-
improve both decode fixtures. No Qwen setting advances from this screen.
|
|
545
|
-
New-shape prefill timings remain excluded. Evidence is
|
|
546
|
-
`graph-schedule-rtn4-rescreen-v2{,-review}.json`.
|
|
547
|
-
|
|
548
|
-
Llama's six balanced native pairs preserve all 30 paired generations, including
|
|
549
|
-
requested log probabilities and live state. Reducing both submission limits
|
|
550
|
-
to 25 lowers complete warmed generation time by 2.44% for greedy and 2.30%
|
|
551
|
-
for sampled output; all six pairs improve in each cell. TTFT is effectively
|
|
552
|
-
flat. Peak MLX allocation falls in the measured cells, which is not a claim
|
|
553
|
-
about physical RAM savings. Six actual HTTP pairs per lane then preserve all
|
|
554
|
-
84 paired responses across 168 requests. Complete time improves by
|
|
555
|
-
1.86–3.02% in serial and 2.22–3.00% in continuous serving across the three
|
|
556
|
-
fixtures, with every pair faster. These results (measured on the M4 Pro) remain diagnostic pending a quiet-machine repeat.
|
|
557
|
-
The controls are `graph-schedule-llama-repeat{,-review}.json` and
|
|
558
|
-
`graph-schedule-llama-http-repeat{,-review}.json`. MLX caches these settings
|
|
559
|
-
at device initialization; assigning environment variables from a later
|
|
560
|
-
model forward would not apply the measured policy. Broader contexts,
|
|
561
|
-
lifecycle coverage and scoped integration remain.
|
|
562
|
-
|
|
563
|
-
A separate native prototype elides `finalize` only when the command buffer
|
|
564
|
-
has not been touched since the preceding commit. Access to the buffer,
|
|
565
|
-
encoder creation, output registration and temporary registration all make it
|
|
566
|
-
ineligible. This preserves event-only and completion-handler work, and leaves
|
|
567
|
-
explicit synchronization unchanged. The isolated build and its disabled arm
|
|
568
|
-
each pass 84 stream/lifetime cases against the installed library, spanning
|
|
569
|
-
three dtypes, two sizes, two memory limits, CPU/GPU and GPU/GPU dependencies,
|
|
570
|
-
view-only events and disposal before asynchronous completion. All cases
|
|
571
|
-
return active memory to zero. The subsequent 45 complete generations also
|
|
572
|
-
preserve IDs, requested log probabilities, live state and usage across the
|
|
573
|
-
three artifacts and both library controls. Packed generation is effectively
|
|
574
|
-
flat. Six subsequent RTN4 AB/BA pairs preserve all 30 paired generations but
|
|
575
|
-
find no reliable gain: complete greedy time changes by -0.069%, sampled by
|
|
576
|
-
+0.108% and warmed prefill by +0.011%. Peak MLX allocation is flat. Close the
|
|
577
|
-
prototype without production integration. Evidence
|
|
578
|
-
is `mlx-untouched-finalize-source-manifest.json` and
|
|
579
|
-
`untouched-finalize-stream-default{,-review}.json`, plus
|
|
580
|
-
`untouched-finalize-native{,-review}.json` and
|
|
581
|
-
`untouched-finalize-rtn4-repeat{,-review}.json`.
|
|
582
|
-
|
|
583
|
-
The separate exact traces confirm that the prototype removes the intended
|
|
584
|
-
submissions. For 64 packed sampled tokens, zero-dispatch buffers fall from
|
|
585
|
-
3,311 to 194, while all 116,164 dispatches and 3,905 buffers containing
|
|
586
|
-
dispatches remain. RTN4's corresponding zero-dispatch count falls from 4,083
|
|
587
|
-
to two; its 115,947 dispatches remain. The sampled skip counters record
|
|
588
|
-
3,113/4,072 omitted calls. Counts need not subtract exactly between runs
|
|
589
|
-
because pressure callbacks and completion timing vary. This is mechanism
|
|
590
|
-
evidence, not an end-to-end speed claim. Evidence is
|
|
591
|
-
`untouched-finalize-trace{,-review}.json`.
|
|
592
|
-
|
|
593
|
-
The optional upstream `MLX_METAL_FAST_SYNCH=1` mode stalls in the installed
|
|
594
|
-
library's large bf16 three-stream case under the probe's small submission
|
|
595
|
-
limits. A stack sample finds the host in `scheduler::wait_for_one` and a
|
|
596
|
-
worker in `Fence::wait`. Stop only that probe after more than 100 seconds
|
|
597
|
-
without progress, retain its partial results, and rerun all default-mode
|
|
598
|
-
cases successfully. Do not attribute this stock-library failure to the new
|
|
599
|
-
prototype or treat the unrun experimental-mode arms as passes. Evidence is
|
|
600
|
-
`untouched-finalize-stream.json`, `untouched-finalize-stream-fast1-interruption.json`
|
|
601
|
-
and `untouched-finalize-stream-fast1-default.sample.txt`.
|
|
602
|
-
The initial interruption annotation mislabeled that case as f32; the partial
|
|
603
|
-
report's dtype 12 identifies bf16. The corrected attribution is recorded in
|
|
604
|
-
`untouched-finalize-stream-fast1-failure-review.json`.
|
|
605
|
-
|
|
606
|
-
The existing GDN stage profiler has also been run at M=1/4/128/512 against
|
|
607
|
-
unprofiled forwards from the same prefix. Observed logits agree. Its added
|
|
608
|
-
stage/layer evaluations substantially inflate small-M time, so those stage
|
|
609
|
-
durations cannot substitute for GPU kernel attribution. Evidence:
|
|
610
|
-
`reports/qwen38-rd/gdn-stage-probe.json`. A fused convolution/SiLU/copied-tail
|
|
611
|
-
prototype matches the tested bf16/f32 outputs and live tail at B=1/2. It
|
|
612
|
-
requires MLX's typed sigmoid expression; a float32 rewrite changes bf16
|
|
613
|
-
results. The opt-in operation now passes full packed-model logits, live
|
|
614
|
-
state, continuation and speculative rollback checks. Its initial memory
|
|
615
|
-
benefit exposed an aliasing baseline: `mlx_copy` retains the source buffer.
|
|
616
|
-
The default path now uses a shared compact materialization operation backed
|
|
617
|
-
by stock MLX DynamicSlice, with gradient and compiled-execution gates.
|
|
618
|
-
Replacing the alias preserves all tested packed-model logits, live state,
|
|
619
|
-
continuation and rollback bytes. Explicit disposal still owns handle cleanup;
|
|
620
|
-
the copy change allows the large backing allocation to be released.
|
|
621
|
-
Against an independently materialized baseline, convolution fusion has
|
|
622
|
-
approximately flat full-model timing and similar peak memory. It remains an
|
|
623
|
-
unpromoted R8 experiment. Evidence: `qwen-conv-materialized-packed.json`,
|
|
624
|
-
`materialize-final-packed-comparison.json`, and `conv-probe-typed-sigmoid.json`.
|
|
625
|
-
The final stock-copy rerun is a correctness gate; concurrent CPU trace exports
|
|
626
|
-
exclude its diagnostic timings from performance comparisons.
|
|
627
|
-
|
|
628
|
-
GDN specialization now covers threadgroup layouts, fixed sequence lengths,
|
|
629
|
-
loop unrolling, compiled wrappers and typed sigmoid fusion. Correcting the
|
|
630
|
-
initial float32 sigmoid rewrite restores exact bf16 recurrence and state.
|
|
631
|
-
The subsequent shape sweep passes all 114 cells. A compiled fixed-length
|
|
632
|
-
candidate preserves full-model logits, live state and continuation, but its
|
|
633
|
-
isolated gains mostly disappear in full forwards. A separate fused recurrence,
|
|
634
|
-
output RMS normalization and gate kernel passes 60 isolated shape/dtype cells
|
|
635
|
-
and the small-M full-model checks. Its full-forward improvement is too small
|
|
636
|
-
to justify integration at this point. Neither candidate changes production
|
|
637
|
-
dispatch. Evidence: `gdn-specialization-typed.json`,
|
|
638
|
-
`gdn-static-full-model-review.json`, `gdn-fused-norm-probe.json` and
|
|
639
|
-
`gdn-fused-norm-full-model-review.json`.
|
|
640
|
-
|
|
641
|
-
The affine matvec layout screen preserves pinned MLX's reduction arithmetic
|
|
642
|
-
while varying output rows per SIMD group and groups per threadgroup. Actual
|
|
643
|
-
packed-artifact head and GDN projection weights pass exact checks with both
|
|
644
|
-
direct and compiled wrappers. The best isolated head cells improve only
|
|
645
|
-
slightly, and the small-M projection results are mixed. There is no accepted
|
|
646
|
-
whole-model gain. Combined projection dispatch remains a separate candidate.
|
|
647
|
-
Evidence: `affine-qmv-screen.json` and `affine-qmv-compiled.json`.
|
|
648
|
-
|
|
649
|
-
A second affine prototype shares packed weights and quantization metadata
|
|
650
|
-
across four or eight input rows, preserving MLX's dot-product and SIMD
|
|
651
|
-
reduction order. The corrected real-matrix screen passes all 50 cases; larger
|
|
652
|
-
GDN projections improve in isolation, while vocabulary-head gains are smaller.
|
|
653
|
-
An initial bf16 failure was large, not rounding noise: some shared-row layouts
|
|
654
|
-
read incorrect scale/bias values. Explicit bf16 bit expansion avoids the
|
|
655
|
-
observed failure without resident float32 metadata copies. Direct and compiled
|
|
656
|
-
bf16/f32 debug cells then agree exactly. The underlying compiler cause is not
|
|
657
|
-
established. Six full-model pairs preserve logits, live cache bytes and
|
|
658
|
-
continuation on both packed and plain RTN4 artifacts. RTN4 improves consistently
|
|
659
|
-
at M=4/8 with unchanged peak allocation and flat unused-shape controls. Packed
|
|
660
|
-
improves little; its unused M=128 control also shifts, so the smaller packed
|
|
661
|
-
timing difference needs an independent check. Six RTN4 HTTP process pairs
|
|
662
|
-
then preserve all 108 paired warmup/measured responses, token counts and
|
|
663
|
-
finish reasons. Every measured eight-request wave reaches eight active rows
|
|
664
|
-
and improves throughput; the single-request control is approximately flat.
|
|
665
|
-
All twelve servers exit cleanly with fixed source hashes. Evidence:
|
|
666
|
-
`affine-shared-m-http-rtn4-review.json`, `affine-shared-m-probe.json`,
|
|
667
|
-
`affine-shared-m-probe-initial.json` and
|
|
668
|
-
`affine-shared-m-debug-scale-bits.json`, plus
|
|
669
|
-
`affine-shared-m-full-model-{packed,rtn4}-review.json`.
|
|
670
|
-
|
|
671
|
-
The retained shared operation is `src/mlx/affine-shared-m.ts`, opt-in via
|
|
672
|
-
`MLX_BUN_AFFINE_SHARED_M=1` [both later removed with the MLX 0.32.2 runtime
|
|
673
|
-
consolidation, §7.12 of the design doc; frozen source controls retain them]. Eligibility follows dtype, quantization, shape
|
|
674
|
-
and stream rather than a model name. It retains native MLX for unsupported
|
|
675
|
-
cells and during shapeless compile traces: the native CustomKernel primitive
|
|
676
|
-
cannot infer output shapes there. The trace context is restored on return or
|
|
677
|
-
exception. Shape-specific compiled calls remain eligible. Focused tests cover
|
|
678
|
-
strided activations and metadata, leading dimensions, shape changes and
|
|
679
|
-
fallbacks. A cleaned-up kernel passes another six RTN4 full-model pairs and
|
|
680
|
-
retains the gain. Six final production-flag HTTP pairs preserve all 156 paired
|
|
681
|
-
warmup/measured responses with fixed source hashes and clean server exits.
|
|
682
|
-
Both four- and eight-request throughput improve in every pair; the
|
|
683
|
-
single-request control is flat. Dispatch counters confirm M4 and M8 use the
|
|
684
|
-
shared operation. Broader artifacts and quiet-machine gates remain. Evidence:
|
|
685
|
-
`affine-shared-m-production-full-model-rtn4-review.json`,
|
|
686
|
-
`affine-shared-m-shapeless.json`, `affine-shared-m-integrated-unit.txt` and
|
|
687
|
-
`affine-shared-m-integrated-http-rtn4-review.json`.
|
|
688
|
-
|
|
689
|
-
The next row-width screen passes all 112 real RTN4 matrix cases at
|
|
690
|
-
M=2/3/5/6/7. Six full-model pairs per width also preserve logits, live state
|
|
691
|
-
and continuation. M2 loses and retains native dispatch. M3 improves slightly;
|
|
692
|
-
M5/6/7 improve consistently without a material peak-memory increase. The large
|
|
693
|
-
head needs separate geometry: its M6/7 shared-row cells lose even when smaller
|
|
694
|
-
projections win. Wider integration therefore keeps those head cells native.
|
|
695
|
-
Evidence: `affine-shared-m-width-rtn4-review.json` and
|
|
696
|
-
`affine-shared-m-width-full-model-rtn4-review.json`.
|
|
697
|
-
|
|
698
|
-
A broader-format prototype initially fails nine of 216 arithmetic cells,
|
|
699
|
-
all bf16 M8 layouts with 3- or 5-bit weights. The errors are large and survive
|
|
700
|
-
float32 output storage. Float32 activations remove the large error but also
|
|
701
|
-
change the reference's typed arithmetic. Explicit bf16 input expansion plus
|
|
702
|
-
rounding after each typed addition preserves that arithmetic and passes all
|
|
703
|
-
216 dtype/bit/group-size cells. Evidence:
|
|
704
|
-
`affine-shared-m-all-bits-correctness-review.json`,
|
|
705
|
-
`affine-shared-m-all-bits-debug.json` and
|
|
706
|
-
`affine-shared-m-all-bits-explicit-input-correctness-review.json`.
|
|
707
|
-
|
|
708
|
-
The compact artifact supplies actual 3-bit head/MLP and 8-bit attention/GDN
|
|
709
|
-
matrices. All 80 real-matrix cells agree exactly, including compiled calls.
|
|
710
|
-
Reusing each packed load for two input rows at 3-bit and four at 8-bit wins
|
|
711
|
-
the retained M4/8 cells. Both compute four output rows per SIMD group, with
|
|
712
|
-
two SIMD groups per threadgroup. Six full-model pairs
|
|
713
|
-
with the prototype and another six with the cleaned production operation
|
|
714
|
-
preserve logits, live cache bytes and continuation; both row counts improve,
|
|
715
|
-
unused-shape controls stay approximately flat and peak allocation is unchanged.
|
|
716
|
-
The 3/8-bit implementation now lives in `src/mlx/affine-shared-quant.ts`, under
|
|
717
|
-
the same opt-in flag and native fallback rules [also removed in the §7.12
|
|
718
|
-
consolidation]. Other bit widths and group
|
|
719
|
-
sizes remain research-only. Evidence:
|
|
720
|
-
`affine-shared-m-all-bits-explicit-compact-review.json`,
|
|
721
|
-
`affine-shared-m-all-bits-full-model-compact-review.json` and
|
|
722
|
-
`affine-shared-m-broader-full-model-compact-review.json`.
|
|
723
|
-
|
|
724
|
-
The final 4-bit operation includes M3/5/6/7, retaining native M2 and the large
|
|
725
|
-
head at M5/6/7. Six complete-model pairs per width preserve logits, state and
|
|
726
|
-
continuation. Six production-flag HTTP pairs at B1/3/5/6/7 preserve all 264
|
|
727
|
-
paired warmup/measured responses. Each measured wave reaches the requested
|
|
728
|
-
active width; candidate dispatch is observed and all twelve servers exit
|
|
729
|
-
cleanly. Concurrent throughput improves in every pair. Single-request decode
|
|
730
|
-
is approximately flat. All pairs are retained, including noisier final runs:
|
|
731
|
-
the machine has residual swap, XProtect is active at the initial preflight,
|
|
732
|
-
and unrelated build/browser activity is observed after the run. This remains
|
|
733
|
-
a diagnostic result. Wider model coverage remains open.
|
|
734
|
-
Evidence: `affine-shared-m-broader-full-model-rtn4-review.json` and
|
|
735
|
-
`shared-affine-frontier-http-rtn4-review.json`. Current focused tests, all
|
|
736
|
-
three typechecks, hygiene and the complete model-free tier pass; the latter
|
|
737
|
-
has 1,785 passes, ten skips and no failures. Evidence:
|
|
738
|
-
`affine-shared-m-broader-{unit,typecheck,hygiene,model-free}.txt`.
|
|
739
|
-
|
|
740
|
-
Six final compact production-flag HTTP pairs preserve all 156 paired warmup
|
|
741
|
-
and measured responses, usage counts and stop reasons. Both B4 and B8 improve
|
|
742
|
-
in every measured pair; the median B1 control is flat, with individual noisy
|
|
743
|
-
outliers retained. Actual active widths and both 3/8-bit dispatches are
|
|
744
|
-
observed, all twelve servers exit cleanly and source hashes remain fixed.
|
|
745
|
-
Residual swap keeps this diagnostic. Evidence:
|
|
746
|
-
`shared-affine-frontier-http-compact-review.json`.
|
|
747
|
-
|
|
748
|
-
A subsequent host-overhead prototype caches shape-specific compiled calls
|
|
749
|
-
around these shared-affine kernels. Every weight/scale/bias/activation remains
|
|
750
|
-
a dynamic input, so one compiled function can serve distinct model layers.
|
|
751
|
-
Six compact full-model pairs retain exact logits, state and continuation;
|
|
752
|
-
24 compiled configurations serve all eligible projections without new traces
|
|
753
|
-
in measured rows. The eligible M4/8 cells improve modestly. Six subsequent
|
|
754
|
-
HTTP process pairs preserve all 156 paired warm/measured responses with clean
|
|
755
|
-
server exits and fixed source hashes. Serving gains shrink to approximately
|
|
756
|
-
flat at B1/4 and a small B8 difference. This does not justify integrating the
|
|
757
|
-
extra compiled-function cache at present. Evidence:
|
|
758
|
-
`affine-compiled-call-cache-full-model-compact-review.json` and
|
|
759
|
-
`affine-compiled-call-cache-http-compact-review.json`.
|
|
760
|
-
|
|
761
|
-
The grammar-mask operation now completes six compact HTTP process pairs at
|
|
762
|
-
B1/4 with shared-affine enabled in both arms and grammar jumping disabled.
|
|
763
|
-
All 60 paired warm/measured responses match and satisfy the frozen JSON
|
|
764
|
-
schema; both arms apply the mask the same number of times. Every concurrent
|
|
765
|
-
wave reaches four active rows, source hashes remain fixed and all servers
|
|
766
|
-
exit cleanly. The timing is inconclusive for promotion: residual swap and
|
|
767
|
-
overlapping unrelated build/browser work are recorded, the B1 median is
|
|
768
|
-
approximately flat and the B4 median regresses. Preserve all samples and
|
|
769
|
-
revisit on a controlled session. Host masking remains default. Evidence:
|
|
770
|
-
`grammar-mask-http-compact-review.json`.
|
|
771
|
-
|
|
772
|
-
A fused affine gate/up/SwiGLU prototype shares activation loads and replaces
|
|
773
|
-
the two projections plus activation dispatch. Its first version preserves
|
|
774
|
-
both projection outputs but fails the activation check: a float32 sigmoid
|
|
775
|
-
expression differs from MLX's dtype-specific expression. The corrected
|
|
776
|
-
kernel passes all 48 real RTN4 small-M cells, including complete MLP output.
|
|
777
|
-
Only M=1 benefits in that isolated screen. Restricting the full-model prototype
|
|
778
|
-
to M=1 preserves logits, live state and continuation across six paired blocks,
|
|
779
|
-
but its full-forward gain is too small to justify integration. Longer-M
|
|
780
|
-
forwards retain the original path. Evidence: `affine-gateup-debug.json`,
|
|
781
|
-
`affine-gateup-debug-typed.json`, `affine-gateup-typed.json` and
|
|
782
|
-
`affine-gateup-full-model-review.json`. The existing packed activation's
|
|
783
|
-
separate arithmetic contract needs its own audit before reusing that code
|
|
784
|
-
in an affine operation.
|
|
785
|
-
|
|
786
|
-
A residual-add/RMSNorm kernel preserves the native reduction topology and
|
|
787
|
-
the rounded residual before normalization. All 90 synthetic bf16/f16/f32
|
|
788
|
-
cases preserve both outputs. Six packed-model pairs at M1/4/8/128 then
|
|
789
|
-
preserve logits, live cache bytes and continuation, with 64 fused calls per
|
|
790
|
-
forward. M1 is slightly slower, M4/8 are approximately flat and M128 varies.
|
|
791
|
-
The complete path does not establish a compelling benefit, so this version
|
|
792
|
-
is not integrated. Operation samples include wrapper/evaluation costs and are
|
|
793
|
-
not GPU-only timestamps. Evidence: `residual-rms-screen-scalar-review.json`
|
|
794
|
-
and `residual-rms-full-model-packed-review.json`. Earlier driver/binding
|
|
795
|
-
failures occurred before timing and remain separate. Closed helpers are
|
|
796
|
-
removed after recording the finding.
|
|
797
|
-
|
|
798
|
-
The first real HTTP screen uses the compact artifact through bounded CLI
|
|
799
|
-
servers. It retains request hashes, actual usage, arrival times, cache hits,
|
|
800
|
-
restart durability, concurrent request completion and failures. Its cold
|
|
801
|
-
context leg required a Bun restart; the retried nonce changed the prompt, so
|
|
802
|
-
that context comparison is unmatched. The chat probe also diverged despite
|
|
803
|
-
equal prompt counts. Frozen chat IDs produce identical direct Bun/Python
|
|
804
|
-
tokens. A cold HTTP control reproduces the Python difference only in its
|
|
805
|
-
seedless BatchGenerator path; `seed=0` selects its serial method and matches
|
|
806
|
-
the direct text. Compare those execution methods separately. The Bun HTTP
|
|
807
|
-
sample also omits a final space, so it has no byte-identical wire-output claim.
|
|
808
|
-
The benchmark records failed-attempt
|
|
809
|
-
stderr and process status, including failures recovered by retry. This screen
|
|
810
|
-
is diagnostic and establishes no serving win. Evidence and exclusions:
|
|
811
|
-
`serving-compact-screen-0.review.json` and
|
|
812
|
-
`serving-primes-native-comparison.json` in the report directory.
|
|
813
|
-
|
|
814
|
-
Repeated native-throw traces identify the continuous serving crash as Metal
|
|
815
|
-
command-buffer out-of-memory. Bun 1.4.2 avoids it in one screen but misses
|
|
816
|
-
one pending SSD snapshot at its first restart boundary; neither issue is
|
|
817
|
-
closed. Continuous preparation and decode now share the serial memory
|
|
818
|
-
guard, entered after cache acquisition under the execution lease. Ownership,
|
|
819
|
-
refusal and guard restoration tests pass. The same context failure still
|
|
820
|
-
reproduces: the affine graph's transient allocations occur at evaluation,
|
|
821
|
-
after the per-layer construction checks. Investigate allocator residency
|
|
822
|
-
and snapshot retention before declaring this fixed. Evidence:
|
|
823
|
-
`serving-compact-bun140-throw.review.json`,
|
|
824
|
-
`serving-compact-bun142-throw.review.json` and
|
|
825
|
-
`serving-compact-shared-guard.review.json`. Source snapshots now include
|
|
826
|
-
untracked kernels as well as tracked changes.
|
|
827
|
-
|
|
828
|
-
The frozen compact request isolates a cache-consumption cause: after one
|
|
829
|
-
warm repeat transfers the exact recurrent boundary out of RAM, a third
|
|
830
|
-
identical prompt loses that prefix and prefills again. Stopping after two
|
|
831
|
-
requests also reproduces a missing SSD snapshot followed by a false-success
|
|
832
|
-
flush; restart cannot reuse the longer untrimmable descendant. Persisting the
|
|
833
|
-
boundary before transfer preserves the third request's prefix. Durability
|
|
834
|
-
records now remain dirty until actually covered, and already-durable records
|
|
835
|
-
avoid another clone. Ownership/failure and coordinator regression gates pass.
|
|
836
|
-
The three-request HTTP replay preserves output and cached tokens through
|
|
837
|
-
repeat and restart, with no missing flush. The two-request replay also writes
|
|
838
|
-
the consumed boundary before restart. This requires a synchronous SSD write
|
|
839
|
-
on the first transfer when that boundary is not already durable. The complete
|
|
840
|
-
compact serving diagnostic now finishes context repeats, SSD flush/restart
|
|
841
|
-
and four concurrent streams without a recorded failure. One diagnostic pass
|
|
842
|
-
does not close long-agent or repeated reliability acceptance. Evidence:
|
|
843
|
-
`ssd-boundary-before.json`, `ssd-boundary-two-before.json`,
|
|
844
|
-
`ssd-boundary-after.json`, `ssd-boundary-two-after.json`,
|
|
845
|
-
`ssd-boundary-tests.txt` and `serving-compact-boundary-fixed.review.json`
|
|
846
|
-
in the campaign report directory.
|
|
847
|
-
|
|
848
|
-
The merged packed path now passes the seven saved Pi tool-result boundaries
|
|
849
|
-
in separate serial and continuous server processes. Both arms use variant 12
|
|
850
|
-
and the same frozen requests. Each completes the longest prompt, emits the
|
|
851
|
-
requested 512 tokens, demotes old cache entries under pressure, and finishes
|
|
852
|
-
with a durable SSD flush and no pending, missing or failed snapshots. Responses
|
|
853
|
-
match across the two methods and the source snapshot stays fixed. The system
|
|
854
|
-
prompt was reconstructed once with the installed Pi package and frozen;
|
|
855
|
-
historical system-prompt byte identity is not established. This is a bounded
|
|
856
|
-
memory/integration check, not a long-running agent success claim. No returned
|
|
857
|
-
tools execute. Evidence: `agent-boundary-fixture.json`,
|
|
858
|
-
`agent-boundary-current.json` and `agent-boundary-current-review.json`.
|
|
859
|
-
|
|
860
|
-
The M4 DeltaNet fixture discrepancy is now traced to the cached reference,
|
|
861
|
-
not a Bun/oracle disagreement. Both implementations match gate values, output
|
|
862
|
-
bytes and complete recurrent state on the frozen inputs. The explicit
|
|
863
|
-
replay changes one older expected output and adds oracle provenance/state
|
|
864
|
-
hashes. The platform evidence and regeneration procedure live in
|
|
865
|
-
[environment.md](../reference/environment.md).
|
|
866
|
-
|
|
867
|
-
R22 now tests immutable file-backed weights through page-aligned Metal roots
|
|
868
|
-
and ordinary MLX tensor views. The existing external-buffer entry point is
|
|
869
|
-
sufficient for element-aligned tensors; each root includes the leading page
|
|
870
|
-
padding and the tensor view carries the offset. This resembles
|
|
871
|
-
[llama.cpp's mapped Metal buffer views](https://github.com/ggml-org/llama.cpp/blob/427291b5b34cd914a31b3fd3b61a68f6184f4b9f/ggml/src/ggml-metal/ggml-metal-device.m#L1999),
|
|
872
|
-
which align the root pointer and split oversized mappings into overlapping
|
|
873
|
-
views. The prototype uses no new artifact and no new production loader.
|
|
874
|
-
Small metadata and unsupported element alignment retain native loading.
|
|
875
|
-
All 32 operation cases match payload bytes and GPU add/matmul results;
|
|
876
|
-
pointer equality proves that the candidate aliases the file, and file hashes
|
|
877
|
-
stay unchanged. The Llama 1B artifact is ineligible because its large payloads
|
|
878
|
-
start at odd byte offsets, so that initial native/native control establishes
|
|
879
|
-
no candidate performance result.
|
|
880
|
-
|
|
881
|
-
The first packed 27B native pair maps 758 tensors, 11,895,111,680 payload
|
|
882
|
-
bytes, through 11,907,530,752 bytes of page windows. Prefix state, ten
|
|
883
|
-
full-forward logit/live-state/continuation cases and both generation token
|
|
884
|
-
sequences match. The subsequent six-pair repeat preserves all 60 full-forward
|
|
885
|
-
logit/state/continuation cases, every prefix state and all 12 generation
|
|
886
|
-
comparisons. Sources stay fixed and all 12 child processes exit cleanly.
|
|
887
|
-
The measured 64-token generation is 0.25% slower by median paired wall-time
|
|
888
|
-
ratio, with no faster pair; TTFT is approximately flat. M1 is about 0.6%
|
|
889
|
-
faster, while M4/8/128/512 give no consistent useful improvement. Evidence:
|
|
890
|
-
`mmap-weights-native-packed-paired{,-review}.json`. Readiness varies strongly
|
|
891
|
-
with order and file-cache state, so it has no cold-start improvement claim. Process RSS and macOS
|
|
892
|
-
physical-footprint accounting fall sharply because most private copied weights
|
|
893
|
-
become file-backed mappings. That does not shrink model bytes or establish a
|
|
894
|
-
corresponding reduction in total physical RAM: clean file pages and GPU
|
|
895
|
-
residency require separate accounting. Preserve MLX active/peak bytes, RSS,
|
|
896
|
-
`vmmap` output and system pressure together. Evidence:
|
|
897
|
-
`reports/qwen38-rd/mmap-page-window{,-pointer}-screen.json` and
|
|
898
|
-
`mmap-weights-native-{llama1,packed}-screen.json`.
|
|
899
|
-
|
|
900
|
-
The serial HTTP follow-up completes six fresh-server pairs with all 42
|
|
901
|
-
warm/measured response texts, usage counts and finish reasons exact. Sources
|
|
902
|
-
remain fixed and all servers exit cleanly. Warm complete-response time is
|
|
903
|
-
0.04% to 0.14% slower by median paired ratio; decode is 0.14% to 0.21% slower.
|
|
904
|
-
Median per-server peak RSS changes from 12,182,749,184 to 482,508,800 bytes.
|
|
905
|
-
The recorded physical-footprint summaries show the same private/file-backed
|
|
906
|
-
accounting change, not a smaller tensor working set. Evidence:
|
|
907
|
-
`mmap-weights-http-serial{,-review}.json`. Default scheduling, system-memory
|
|
908
|
-
pressure and cold file-cache behavior remain separate gates.
|
|
909
|
-
|
|
910
|
-
The initial prototype retains immutable roots and mapping owners for the
|
|
911
|
-
process, matching the existing external-array lifetime requirement. A retained
|
|
912
|
-
loader must also prove unload, outstanding GPU-reference ownership, repeated
|
|
913
|
-
model replacement, pressure behavior and HTTP performance. No default or
|
|
914
|
-
production lifetime change follows from this screen. A subsequent ownership
|
|
915
|
-
prototype stores array/root handles with each `Weights` instance and releases
|
|
916
|
-
them on disposal. Existing shard mappings remain mapped for the process. Three
|
|
917
|
-
full-artifact cycles each load 2,019 tensors and release all 13,056,265,696
|
|
918
|
-
active bytes. An outstanding GPU consumer survives weight disposal, produces
|
|
919
|
-
the exact expected output and releases the remaining 2,048 bytes on disposal;
|
|
920
|
-
active memory is zero before GC. Evidence:
|
|
921
|
-
`mmap-weights-ownership-packed{,-mapping}.json`. Three additional cycles
|
|
922
|
-
retain a single-input lazy negation, dispose the weights before submitting it,
|
|
923
|
-
and then evaluate it. Outputs remain exact; the pending view retains
|
|
924
|
-
39,747,584 bytes until its disposal, after which active memory returns to zero
|
|
925
|
-
before GC. Evidence: `mmap-weights-single-consumer-lazy{,-mapping}.json`.
|
|
926
|
-
The whole-tensor follow-up fails output identity on the first cycle after
|
|
927
|
-
owner disposal, although active memory returns to zero and the source tensor
|
|
928
|
-
still matches the untouched original artifact. The earlier small view did
|
|
929
|
-
not qualify for unary buffer donation: MLX also bounds excess backing-buffer
|
|
930
|
-
bytes. Thus those passing cases did not establish donation safety. Keep this
|
|
931
|
-
read-only loader out of production; reduce the failure on scratch data and
|
|
932
|
-
test writable private mappings with native lifetime ownership. Evidence:
|
|
933
|
-
`mmap-weights-whole-consumer-lazy.json`, its log and
|
|
934
|
-
`mmap-whole-consumer-source-integrity.json`. Full serving, default-scheduler
|
|
935
|
-
and pressure gates remain for any corrected loader.
|
|
936
|
-
|
|
937
|
-
Scratch files isolate the failure across float32/bfloat16 and aligned/offset
|
|
938
|
-
views. With a retained root, all read-only cases are exact and output uses a
|
|
939
|
-
separate buffer. After root release, all four donated read-only cases return
|
|
940
|
-
the original input bytes instead of the negation. Private writable mappings
|
|
941
|
-
preserve every output, including donation, and leave each file unchanged.
|
|
942
|
-
Evidence: `mmap-donation-{ro,cow}-screen.json`. The corrected prototype gives
|
|
943
|
-
each private page window a native payload destructor that unmaps it on the
|
|
944
|
-
last MLX buffer release. It uses no JavaScript destructor or new production
|
|
945
|
-
API. All eight scratch ownership cases preserve output and file bytes, retain
|
|
946
|
-
the mapping through the live consumer, and release every mapping afterward.
|
|
947
|
-
Three full-artifact cycles then preserve the whole-tensor lazy negation after
|
|
948
|
-
weight disposal. Only its 1,654,784-byte mapping survives until the pending
|
|
949
|
-
consumer is disposed; native mapping counts and MLX active bytes return to
|
|
950
|
-
zero before GC. Evidence: `mmap-managed-donation-screen.json` and
|
|
951
|
-
`mmap-weights-managed-whole-consumer-lazy{,-mapping}.json`. A further 64-cycle
|
|
952
|
-
scratch gate submits chained operations asynchronously and disposes the
|
|
953
|
-
input handles. Half the cycles check every output value; the others dispose
|
|
954
|
-
the final output before synchronization. All release every native mapping and
|
|
955
|
-
return MLX active memory to zero. Evidence: `mmap-managed-submitted.json`.
|
|
956
|
-
Six subsequent private-mapping native blocks on the M4 Pro 24 GB preserve 60 full-forward
|
|
957
|
-
logit/state/continuation cases and 12 8/64-token generation comparisons, with
|
|
958
|
-
fixed sources, clean exits and zero remaining native mapping windows. The
|
|
959
|
-
64-token warm generation median paired wall-time change is +0.02%; TTFT is
|
|
960
|
-
+0.13%. Warm full forwards at M1/4/8/128/512 have no useful consistent speed
|
|
961
|
-
gain. The opening-plus-first-hidden-forward phase is about 7.38 seconds slower
|
|
962
|
-
by median paired difference, but that observation materializes different
|
|
963
|
-
amounts of the model. After the hidden-only forward, native head tensors are
|
|
964
|
-
still lazy while mapped roots already account for their full extent. The
|
|
965
|
-
727,580,672-byte active-allocation difference is exactly the 715,161,600-byte
|
|
966
|
-
head plus 12,419,072 bytes of page padding, in all six pairs. Large changes in
|
|
967
|
-
RSS and `vmmap` physical-footprint accounting still do not establish how much
|
|
968
|
-
system RAM is saved. Child wall time includes `vmmap` inspection and is not a
|
|
969
|
-
performance metric. Evidence is
|
|
970
|
-
`mmap-weights-managed-native-repeat{,-review}.json` and
|
|
971
|
-
`mmap-initial-residency-attribution.json`.
|
|
972
|
-
|
|
973
|
-
A separate lazy-view control removes per-tensor evaluation and pointer checks
|
|
974
|
-
from loading. All 64 unsubmitted consumers and 64 submitted consumers remain
|
|
975
|
-
valid after releasing their weight owners, then release every mapping and
|
|
976
|
-
return active allocation to zero without forced GC. Its model screen preserves
|
|
977
|
-
ten full-forward cases and both generations, but warm 64-token generation is
|
|
978
|
-
+0.22% slower and the first hidden-forward phase does not improve. This rules
|
|
979
|
-
out retaining the lazy change on that screen; it does not isolate the cause
|
|
980
|
-
of the first-use cost. Evidence is
|
|
981
|
-
`mmap-lazy-view-ownership.json` and
|
|
982
|
-
`mmap-weights-lazy-managed-native-screen{,-review}.json`. Neither prototype is
|
|
983
|
-
integrated.
|
|
984
|
-
|
|
985
|
-
A subsequent four-arm screen measures opening the model through the first
|
|
986
|
-
generated token, completing all 64 tokens, then a warm 64-token generation.
|
|
987
|
-
Native loading, lazy private mappings, mapped pages with an OS read-ahead
|
|
988
|
-
hint, and mapped pages read once per page preserve all token IDs, live state
|
|
989
|
-
and usage, then release every mapping. On the M4 Pro 24 GB, native first-token
|
|
990
|
-
time from opening is 14.09 seconds; lazy mapping is 13.62 seconds, read-ahead
|
|
991
|
-
19.97 seconds and explicit reads 30.50 seconds. These timings include the
|
|
992
|
-
preparation itself. Warm generation is approximately flat. The two CPU
|
|
993
|
-
preparation methods lose this screen. Lazy mapping's small first-generation
|
|
994
|
-
gain needs balanced repeats: this is one fixed-order block with unpurged
|
|
995
|
-
filesystem cache. Neither a cold-storage result nor a physical-memory saving
|
|
996
|
-
is established. Evidence is `mmap-prefault-native-screen.json`.
|
|
997
|
-
|
|
998
|
-
The balanced follow-up rejects that apparent cold-generation gain. All six
|
|
999
|
-
fresh-process pairs preserve both 64-token generations, live state and usage,
|
|
1000
|
-
with fixed sources, clean exits and all 758 mappings released. First-token
|
|
1001
|
-
time from opening is worse in five pairs: the median paired change is +18.42%
|
|
1002
|
-
or +2.24 seconds. Completing the first generation is +12.93% or +2.29 seconds;
|
|
1003
|
-
warm generation is approximately flat at +0.24%. One large native outlier
|
|
1004
|
-
remains in the report. The filesystem cache is unpurged and the machine is
|
|
1005
|
-
not quiet, so these are diagnostic results. RSS accounting falls sharply for
|
|
1006
|
-
file-backed pages but physical-memory savings are still unproven. Close this
|
|
1007
|
-
loader as a performance candidate on the measured workload; no integration
|
|
1008
|
-
or HTTP speed claim follows. Closed loader, page-preparation and ownership
|
|
1009
|
-
helpers are removed; raw plans and evidence remain in
|
|
1010
|
-
`mmap-cold-native-repeat{,-review}.json`.
|
|
1011
|
-
|
|
1012
|
-
The first full-model pair with native private mappings preserves prefix state,
|
|
1013
|
-
all ten checked logit/live-state/continuation cases and both 8/64-token
|
|
1014
|
-
generation sequences. Sources remain fixed; both children exit cleanly and
|
|
1015
|
-
the mapped child releases all 758 native windows before exit. Its 64-token
|
|
1016
|
-
wall time is approximately flat. This single pair is a correctness screen,
|
|
1017
|
-
not a performance acceptance. Evidence:
|
|
1018
|
-
`mmap-weights-managed-native-screen{,-review}.json`. Repeated native/HTTP,
|
|
1019
|
-
and pressure gates still apply. A subsequent API ownership gate preserves
|
|
1020
|
-
pending-consumer output and rematerialized source bytes after `release`,
|
|
1021
|
-
`releaseShard` and `dispose`. It rejects a late view change and releases the
|
|
1022
|
-
mapping after an intentional tensor-fixup failure. All native mapping counts
|
|
1023
|
-
and MLX active bytes return to zero. Evidence:
|
|
1024
|
-
`mmap-managed-shard-release{,-mapping}.json`.
|
|
1025
|
-
|
|
1026
|
-
Plan at this point (the MTP and strict-fill measurements were later
|
|
1027
|
-
completed; see speculative-decoding.md §4.7/§7.4 and the design doc §7.13):
|
|
1028
|
-
finish MTP and strict-fill request measurements after the kernel
|
|
1029
|
-
changes, broaden their correctness and state audits, and obtain individual
|
|
1030
|
-
kernel attribution. Continue shared GDN/convolution/affine/prefill work and
|
|
1031
|
-
the exact-artifact controls across quants. Quiet application A/Bs, pressure
|
|
1032
|
-
replay and quiet-machine gates remain. Recheck process ownership and preflight
|
|
1033
|
-
before each GPU run; diagnostic measurements cannot promote a default.
|
|
1034
|
-
|
|
1035
|
-
The native-owned managed mapping is visible to MLX allocation accounting.
|
|
1036
|
-
Across all ten full-model rows in its paired screen, mapped peak allocation
|
|
1037
|
-
exceeds the incumbent by exactly 12,419,072 bytes, the difference between
|
|
1038
|
-
page-aligned root and payload bytes. The low process RSS is not evidence of
|
|
1039
|
-
an unaccounted model in the async-scheduling threshold. Combining these
|
|
1040
|
-
experiments still needs a separate pressure gate. Evidence:
|
|
1041
|
-
`mmap-managed-active-accounting-review.json`.
|
|
1042
|
-
|
|
1043
|
-
A dedicated KV append dispatch probe covers 18 bf16 cases with four KV heads
|
|
1044
|
-
and dimension 256, at depths 65/256/2049/2048/8193/8192. Every active prefix,
|
|
1045
|
-
new row and retained snapshot remains exact; explicit cleanup returns MLX
|
|
1046
|
-
active allocation to zero. With spare capacity and no retained view, each
|
|
1047
|
-
SliceUpdate dispatches only the new-row copy. Holding an evaluated temporal
|
|
1048
|
-
view adds a full-buffer copy; releasing it restores donation. At a 256-step
|
|
1049
|
-
growth boundary, the pair allocates padding, concatenates old/new storage
|
|
1050
|
-
and appends, totaling eight dispatches regardless of retained views. This
|
|
1051
|
-
rejects the assumption that ordinary cache append always copies the full
|
|
1052
|
-
buffer. The next gate is a real-generation census of retained views and
|
|
1053
|
-
growth; instrumented one-shot timings do not establish a speed win. Evidence:
|
|
1054
|
-
`kv-append-donation-probe{,-review}.json` and its native dispatch log.
|
|
1055
|
-
|
|
1056
|
-
A real native-generation census on the interleaved v13 artifact uses a
|
|
1057
|
-
2,049-token synthetic prompt and 32 generated tokens. Without a prompt
|
|
1058
|
-
snapshot, all 1,024 observed one-row K/V appends dispatch only the new-row
|
|
1059
|
-
copy. Retaining a real `cloneKvCaches` snapshot produces 32 full-buffer copies,
|
|
1060
|
-
one per K/V buffer, then 992 new-row-only appends. Both runs emit identical
|
|
1061
|
-
IDs with fixed sources. This rejects a repeated whole-cache copy in the
|
|
1062
|
-
tested native path; serving, deeper contexts and other cache types remain
|
|
1063
|
-
separate coverage. The counter build is for attribution, not timing claims.
|
|
1064
|
-
Explicit cleanup leaves 16,390 active bytes, so this is not a zero-allocation
|
|
1065
|
-
claim. Evidence: `kv-append-model-trace-2049{,-review}.json` and its dispatch
|
|
1066
|
-
log under campaign reports.
|
|
1067
|
-
|
|
1068
|
-
The actual HTTP census confirms the same append behavior at a verified
|
|
1069
|
-
2,049-token text prompt. Serial and continuous servers each complete two
|
|
1070
|
-
16-token warmups and a 32-token measured response. All three paired outputs,
|
|
1071
|
-
counts and finish reasons match, the continuous lane is verified, and both
|
|
1072
|
-
servers exit cleanly with fixed source. Each measured request has 1,024
|
|
1073
|
-
one-row K/V update encoders, all writing only the new row; neither performs
|
|
1074
|
-
a full-buffer copy for those appends. No matching update records fall outside
|
|
1075
|
-
the request phase markers. This rejects a repeated whole-cache-copy hypothesis
|
|
1076
|
-
for both tested HTTP lanes with prefix caching disabled. Deeper context,
|
|
1077
|
-
retained snapshots, growth boundaries and compressed caches remain separate
|
|
1078
|
-
regimes. The original token-array HTTP fixture was correctly rejected by the
|
|
1079
|
-
endpoint; the corrected text fixture is encoded and hashed by the Bun
|
|
1080
|
-
tokenizer before tracing. Evidence is
|
|
1081
|
-
`kv-append-http-text-census{,-review}.json` and its per-server dispatch logs.
|
|
1082
|
-
|
|
1083
|
-
The native census also passes at an 8,193-token prompt with 32 generated
|
|
1084
|
-
tokens. Ordinary ownership again gives 1,024 new-row-only K/V writes. A held
|
|
1085
|
-
snapshot gives 32 whole-buffer copies followed by 992 new-row-only writes.
|
|
1086
|
-
The two runs emit identical IDs, cover the same 8,224 cached tokens, keep
|
|
1087
|
-
sources fixed and return to 16,390 active bytes after explicit cleanup.
|
|
1088
|
-
Each phase also contains 480 larger prefill updates. These counts classify
|
|
1089
|
-
`SliceUpdate` encoders only; allocation/growth and copy traffic in other
|
|
1090
|
-
operations remain separate measurements. Evidence is
|
|
1091
|
-
`kv-append-native-8193{,-review}.json` and its dispatch log. There is no timing
|
|
1092
|
-
claim or new append kernel from this attribution result.
|