mlx-bun 0.0.4 → 0.0.5
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 +166 -93
- package/docs/design/adapters-end-to-end.md +50 -46
- package/docs/design/compat-cli-surface-design.md +10 -8
- package/docs/design/docs-reorg-plan.md +14 -1
- package/docs/design/hlg-sampling.md +12 -2
- package/docs/design/memory-system.md +1 -1
- package/docs/design/optimization_plan.md +4 -2
- package/docs/design/orpo-future-enhancements.md +298 -0
- package/docs/design/orpo-training.md +1199 -0
- package/docs/design/parallel-slots.md +34 -26
- package/docs/design/runtime-isolation.md +1 -1
- package/docs/design/segmented-backward-training.md +58 -39
- package/docs/design/tauri-desktop-app.md +127 -0
- package/docs/{segmented-backward-handoff.md → investigations/segmented-backward-handoff.md} +1 -1
- package/docs/investigations/starter-model-port-handoff.md +32 -13
- package/docs/investigations/steel-flash-cce-handoff.md +431 -0
- package/docs/planning/IDEAS.md +29 -0
- package/docs/planning/PRODUCT_ROADMAP.md +147 -27
- package/docs/planning/chunk-task-roadmap.md +1 -1
- package/docs/planning/journal.md +161 -0
- package/docs/reference/distribution.md +61 -5
- package/docs/reference/library-api.md +29 -14
- package/docs/reference/orpo-quickstart.md +91 -0
- package/docs/reference/server-api.md +105 -7
- package/docs/reference/server-config.md +12 -5
- package/docs/reference/training.md +292 -0
- package/package.json +1 -1
- package/src/eval/ifeval.ts +138 -0
- package/src/eval/ultrafeedback.ts +60 -0
- package/src/lora.ts +12 -7
- package/src/mlx/metal-kernel.ts +18 -4
- package/src/model/flash-attention.ts +32 -16
- package/src/model/fused-geglu-kernel.ts +111 -0
- package/src/model/gemma4-base.ts +39 -1
- package/src/model/gemma4.ts +196 -21
- package/src/model/minicpm5.ts +44 -3
- package/src/server.ts +3 -3
- package/src/train/dataset.ts +18 -3
- package/src/train/flash-cce.ts +1162 -0
- package/src/train/job.ts +26 -2
- package/src/train/lora-params.ts +53 -4
- package/src/train/loss.ts +941 -0
- package/src/train/optimizer.ts +10 -3
- package/src/train/prefix-shared.ts +435 -0
- package/src/train/rank.ts +36 -0
- package/src/train/segmented.ts +1148 -3
- package/src/train/steel-qmm-header.ts +1461 -0
- package/src/train/trainer.ts +509 -52
- package/src/web/app.html +21 -5
- /package/{docs → src/assets}/curve-designer.html +0 -0
package/src/web/app.html
CHANGED
|
@@ -702,6 +702,7 @@
|
|
|
702
702
|
<div class="seg" id="f-method">
|
|
703
703
|
<button data-v="sft" class="on">SFT</button>
|
|
704
704
|
<button data-v="dpo">DPO</button>
|
|
705
|
+
<button data-v="orpo">ORPO</button>
|
|
705
706
|
</div>
|
|
706
707
|
<div class="hint" id="f-method-hint">Supervised fine-tuning — data is messages or prompt+completion.</div>
|
|
707
708
|
</div>
|
|
@@ -713,7 +714,18 @@
|
|
|
713
714
|
<div class="hpgrid" style="margin-bottom:18px">
|
|
714
715
|
<div class="field"><label>DPO beta (KL strength)</label><input type="number" id="f-beta" value="0.1" step="0.01" min="0.01" max="1"></div>
|
|
715
716
|
<div class="field"><label>LR schedule</label>
|
|
716
|
-
<select id="f-sched"><option value="cosine">cosine (recommended)</option><option value="constant">constant</option
|
|
717
|
+
<select id="f-sched"><option value="cosine">cosine (recommended)</option><option value="constant">constant</option></select></div>
|
|
718
|
+
</div>
|
|
719
|
+
</div>
|
|
720
|
+
|
|
721
|
+
<div id="f-orpo-extra" style="display:none">
|
|
722
|
+
<div class="flash warn" style="margin-bottom:18px">
|
|
723
|
+
<strong>ORPO is reference-free.</strong> One monolithic loss (SFT + odds-ratio), no reference model — half the forwards of DPO. Default LR 1e-5 (lower than DPO: the loss carries a full SFT term). λ weights only the odds-ratio term. Data is {prompt, chosen, rejected}.
|
|
724
|
+
</div>
|
|
725
|
+
<div class="hpgrid" style="margin-bottom:18px">
|
|
726
|
+
<div class="field"><label>ORPO λ (odds-ratio weight)</label><input type="number" id="f-orpo-lambda" value="0.1" step="0.05" min="0.01" max="2"></div>
|
|
727
|
+
<div class="field"><label>LR schedule</label>
|
|
728
|
+
<select id="f-orpo-sched"><option value="cosine">cosine (recommended)</option><option value="constant">constant</option></select></div>
|
|
717
729
|
</div>
|
|
718
730
|
</div>
|
|
719
731
|
|
|
@@ -2024,10 +2036,13 @@ controllers.finetune = (() => {
|
|
|
2024
2036
|
method = m;
|
|
2025
2037
|
$("f-method").querySelectorAll("button").forEach((b) => b.classList.toggle("on", b.dataset.v === m));
|
|
2026
2038
|
$("f-dpo-extra").style.display = m === "dpo" ? "" : "none";
|
|
2039
|
+
$("f-orpo-extra").style.display = m === "orpo" ? "" : "none";
|
|
2027
2040
|
$("f-method-hint").textContent = m === "dpo"
|
|
2028
2041
|
? "Direct Preference Optimization — data is {prompt, chosen, rejected}."
|
|
2029
|
-
:
|
|
2030
|
-
|
|
2042
|
+
: m === "orpo"
|
|
2043
|
+
? "Odds Ratio Preference Optimization (reference-free) — data is {prompt, chosen, rejected}."
|
|
2044
|
+
: "Supervised fine-tuning — data is messages or prompt+completion.";
|
|
2045
|
+
if (!lrTouched) $("f-lr").value = m === "dpo" ? 0.00005 : m === "orpo" ? 0.00001 : 0.0002;
|
|
2031
2046
|
}
|
|
2032
2047
|
|
|
2033
2048
|
function collectHP() {
|
|
@@ -2036,11 +2051,12 @@ controllers.finetune = (() => {
|
|
|
2036
2051
|
model_dir: $("f-model").value.trim(),
|
|
2037
2052
|
data_dir: $("f-data").value.trim(),
|
|
2038
2053
|
method,
|
|
2039
|
-
rank: +$("f-rank").value, scale: +$("f-scale").value,
|
|
2054
|
+
rank: +$("f-rank").value, scale: +$("f-scale").value, lora_dropout: +$("f-dropout").value,
|
|
2040
2055
|
target_modules: modules, num_layers: +$("f-layers").value, iters: +$("f-iters").value,
|
|
2041
2056
|
batch_size: +$("f-batch").value, learning_rate: +$("f-lr").value, max_seq_length: +$("f-seq").value,
|
|
2042
2057
|
};
|
|
2043
|
-
if (method === "dpo") { hp.dpo_beta = +$("f-beta").value; hp.
|
|
2058
|
+
if (method === "dpo") { hp.dpo_beta = +$("f-beta").value; hp.dpo_lr_schedule = $("f-sched").value; }
|
|
2059
|
+
if (method === "orpo") { hp.orpo_lambda = +$("f-orpo-lambda").value; hp.orpo_lr_schedule = $("f-orpo-sched").value; }
|
|
2044
2060
|
return hp;
|
|
2045
2061
|
}
|
|
2046
2062
|
|
|
File without changes
|