Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
574 changes: 11 additions & 563 deletions apps/omlx-mac/Resources/Localizable.xcstrings

Large diffs are not rendered by default.

93 changes: 2 additions & 91 deletions apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ private struct AccelerationSection: View {
defaultValue: "Draft Quantization",
comment: "Row label for the DFlash draft quantization toggle"),
sublabel: String(localized: "settings.experimental.dflash.draft_quant.sub",
defaultValue: "Enable quantization for the draft model (weight, activation bits & group size).",
defaultValue: "Enable quantization for the draft model (weight bits & group size).",
comment: "Sublabel for the DFlash draft quantization toggle")) {
RowSwitch(isOn: vm.bindProfile($vm.dflashDraftQuantEnabled))
}
Expand All @@ -1707,15 +1707,6 @@ private struct AccelerationSection: View {
options: ModelSettingsScreenVM.dflashDraftQuantWeightBitsOptions
)
}
Row(label: String(localized: "settings.experimental.dflash.draft_quant_activation.label",
defaultValue: "Activation Bits",
comment: "Row label for the DFlash draft quantization activation bits picker")) {
Popup(
selection: vm.bindProfile($vm.dflashDraftQuantActivationBits),
width: .controlCompact,
options: ModelSettingsScreenVM.dflashDraftQuantActivationBitsOptions
)
}
Row(label: String(localized: "settings.experimental.dflash.draft_quant_group.label",
defaultValue: "Group Size",
comment: "Row label for the DFlash draft quantization group size picker")) {
Expand All @@ -1726,23 +1717,11 @@ private struct AccelerationSection: View {
)
}
}
Row(label: String(localized: "settings.experimental.dflash.max_ctx.label",
defaultValue: "Max Context (fallback)",
comment: "Row label for the DFlash max-context fallback field"),
sublabel: String(localized: "settings.experimental.dflash.max_ctx.sub",
defaultValue: "Prompts at or above this token count switch to BatchedEngine. Empty = unlimited.",
comment: "Sublabel describing the DFlash max-context fallback")) {
TextInput(text: vm.bindProfile($vm.dflashMaxCtx),
placeholder: String(localized: "settings.experimental.dflash.max_ctx.placeholder",
defaultValue: "unlimited",
comment: "Placeholder shown when DFlash max-context is unset (no cap)"),
mono: true, suffix: "tk", width: .controlCompact)
}
Row(label: String(localized: "settings.experimental.dflash.verify_mode.label",
defaultValue: "Verify Mode",
comment: "Row label for the DFlash verifier algorithm picker"),
sublabel: String(localized: "settings.experimental.dflash.verify_mode.sub",
defaultValue: "Verifier algorithm. \"adaptive\" shrinks block size when acceptance drops; \"off\" disables speculative verify.",
defaultValue: "Verifier algorithm. \"adaptive\" picks how many drafts to verify each cycle from measured cost and acceptance; \"dflash\" and \"off\" verify the whole block.",
comment: "Sublabel for the DFlash verify mode picker")) {
Popup(
selection: vm.bindProfile($vm.dflashVerifyMode),
Expand All @@ -1759,15 +1738,6 @@ private struct AccelerationSection: View {
TextInput(text: vm.bindProfile($vm.dflashDraftWindowSize),
placeholder: "2048", mono: true, width: .controlCompact)
}
Row(label: String(localized: "settings.experimental.dflash.sink_size.label",
defaultValue: "Draft Sink Size",
comment: "Row label for the DFlash attention-sink tokens field"),
sublabel: String(localized: "settings.experimental.dflash.sink_size.sub",
defaultValue: "Attention-sink tokens always kept in the window. Empty = dflash default (0).",
comment: "Sublabel for the DFlash draft sink size field")) {
TextInput(text: vm.bindProfile($vm.dflashDraftSinkSize),
placeholder: "0", mono: true, width: .controlCompact)
}
Row(label: String(localized: "settings.experimental.dflash.block_size.label",
defaultValue: "Runtime Block Size",
comment: "Row label for the DFlash runtime block size field"),
Expand All @@ -1777,49 +1747,6 @@ private struct AccelerationSection: View {
TextInput(text: vm.bindProfile($vm.dflashBlockSize),
placeholder: "checkpoint", mono: true, width: .controlCompact)
}
Row(label: String(localized: "settings.experimental.dflash.mem_cache.label",
defaultValue: "DFlash in-memory cache",
comment: "Row label for the DFlash L1 in-memory cache toggle"),
sublabel: String(localized: "settings.experimental.dflash.mem_cache.sub",
defaultValue: "DFlash L1 prefix snapshot cache in RAM.",
comment: "Sublabel for the DFlash L1 in-memory cache toggle")) {
HStack(spacing: 8) {
if vm.dflashInMemoryCache {
TextInput(text: vm.bindProfile($vm.dflashInMemoryCacheGib),
placeholder: "8", mono: true, suffix: "GiB", width: .controlCompact)
}
RowSwitch(isOn: vm.bindProfile($vm.dflashInMemoryCache))
}
}
if vm.dflashInMemoryCache {
Row(label: String(localized: "settings.experimental.dflash.mem_cache_entries.label",
defaultValue: "Cache Entries",
comment: "Row label for the DFlash L1 in-memory cache max entries field"),
sublabel: String(localized: "settings.experimental.dflash.mem_cache_entries.sub",
defaultValue: "Maximum prefix snapshots kept in RAM. Each entry stores KV + draft GDN state.",
comment: "Sublabel for the DFlash L1 cache max entries field")) {
TextInput(text: vm.bindProfile($vm.dflashInMemoryCacheMaxEntries),
placeholder: "4", mono: true, width: .controlCompact)
}
}
Row(label: String(localized: "settings.experimental.dflash.ssd_cache.label",
defaultValue: "DFlash SSD cache",
comment: "Row label for the DFlash L2 SSD cache toggle"),
sublabel: dflashSsdSublabel) {
RowSwitch(isOn: vm.bindProfile($vm.dflashSsdCache))
.disabled(!(vm.model?.dflashSsdCacheAvailable ?? false) || !vm.dflashInMemoryCache)
}
if vm.dflashSsdCache && (vm.model?.dflashSsdCacheAvailable ?? false) {
Row(label: String(localized: "settings.experimental.dflash.ssd_cache_size.label",
defaultValue: "SSD Cache Size",
comment: "Row label for the DFlash L2 SSD cache disk budget field"),
sublabel: String(localized: "settings.experimental.dflash.ssd_cache_size.sub",
defaultValue: "Disk budget for L2 spill; oldest entries are evicted when exceeded.",
comment: "Sublabel for the DFlash SSD cache size field")) {
TextInput(text: vm.bindProfile($vm.dflashSsdCacheGib),
placeholder: "20", mono: true, suffix: "GiB", width: .controlCompact)
}
}
}

// VLM MTP - last row of the acceleration group. Reveals the
Expand Down Expand Up @@ -1901,22 +1828,6 @@ private struct AccelerationSection: View {
comment: "Default sublabel for the DFlash toggle (used when the model is compatible)")
}

private var dflashSsdSublabel: String {
if !(vm.model?.dflashSsdCacheAvailable ?? false) {
return String(localized: "settings.experimental.dflash.ssd_cache.sub.unavailable",
defaultValue: "Enable the global paged SSD cache directory first.",
comment: "Sublabel for the DFlash SSD cache row when the global SSD cache directory isn't configured")
}
if !vm.dflashInMemoryCache {
return String(localized: "settings.experimental.dflash.ssd_cache.sub.needs_l1",
defaultValue: "Requires the in-memory cache to be enabled.",
comment: "Sublabel for the DFlash SSD cache row when the L1 in-memory cache is off")
}
return String(localized: "settings.experimental.dflash.ssd_cache.sub",
defaultValue: "L2 spill of evicted L1 entries to disk.",
comment: "Default sublabel for the DFlash SSD cache toggle")
}

private var vlmMtpToggleDisabled: Bool {
vm.vlmMtpConflictReason != nil
}
Expand Down
5 changes: 2 additions & 3 deletions apps/omlx-mac/Sources/AppView/Screens/ProfileViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -995,11 +995,10 @@ struct ProfileDetailCard: View {

private func dflashQuantLabel(_ s: [String: AnyCodable]) -> String {
let w = intOf(s["dflash_draft_quant_weight_bits"]) ?? 4
let a = intOf(s["dflash_draft_quant_activation_bits"]) ?? 8
let g = intOf(s["dflash_draft_quant_group_size"]) ?? 64
return String(localized: "profile.detail.acceleration.dflash_quant",
defaultValue: "Drafter quant · W\(w)/A\(a) G\(g)",
comment: "DFlash drafter quantization chip; placeholders are weight bits, activation bits, group size")
defaultValue: "Drafter quant · W\(w) G\(g)",
comment: "DFlash drafter quantization chip; placeholders are weight bits, group size")
}

private func specprefillLabel(_ s: [String: AnyCodable], on: Bool) -> String {
Expand Down
32 changes: 0 additions & 32 deletions apps/omlx-mac/Sources/AppView/Utils/DflashByteSize.swift

This file was deleted.

16 changes: 0 additions & 16 deletions apps/omlx-mac/Sources/AppView/Utils/ProfileWorkingState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,10 @@ struct ModelSettingsSnapshot: Equatable {
var dflashDraftModel: String
var dflashDraftQuantEnabled: Bool
var dflashDraftQuantWeightBits: String
var dflashDraftQuantActivationBits: String
var dflashDraftQuantGroupSize: String
var dflashMaxCtx: String
var dflashBlockSize: String
var dflashVerifyMode: String
var dflashDraftWindowSize: String
var dflashDraftSinkSize: String
var dflashInMemoryCache: Bool
var dflashInMemoryCacheGib: String
var dflashInMemoryCacheMaxEntries: String
var dflashSsdCache: Bool
var dflashSsdCacheGib: String
var mtpEnabled: Bool
}

Expand Down Expand Up @@ -179,18 +171,10 @@ enum ProfileSettingsKey {
static let dflashDraftModel = "dflash_draft_model"
static let dflashDraftQuantEnabled = "dflash_draft_quant_enabled"
static let dflashDraftQuantWeightBits = "dflash_draft_quant_weight_bits"
static let dflashDraftQuantActivationBits = "dflash_draft_quant_activation_bits"
static let dflashDraftQuantGroupSize = "dflash_draft_quant_group_size"
static let dflashMaxCtx = "dflash_max_ctx"
static let dflashVerifyMode = "dflash_verify_mode"
static let dflashDraftWindowSize = "dflash_draft_window_size"
static let dflashDraftSinkSize = "dflash_draft_sink_size"
static let dflashBlockSize = "dflash_block_size"
static let dflashInMemoryCache = "dflash_in_memory_cache"
static let dflashInMemoryCacheMaxBytes = "dflash_in_memory_cache_max_bytes"
static let dflashInMemoryCacheMaxEntries = "dflash_in_memory_cache_max_entries"
static let dflashSsdCache = "dflash_ssd_cache"
static let dflashSsdCacheMaxBytes = "dflash_ssd_cache_max_bytes"
static let mtpEnabled = "mtp_enabled"
static let mtpAdaptiveMaxDepth = "mtp_adaptive_max_depth"
static let vlmMtpEnabled = "vlm_mtp_enabled"
Expand Down
Loading
Loading