Add Metal execution preferences
This commit is contained in:
@@ -305,6 +305,17 @@ impl App {
|
||||
.generation()
|
||||
.ok()
|
||||
.map(|generation| generation.effective(self.preference_draft.model));
|
||||
let execution = self
|
||||
.preference_draft
|
||||
.execution()
|
||||
.ok()
|
||||
.map(|execution| execution.engine_settings());
|
||||
let mut power = text_input("100", &self.preference_draft.power_percent);
|
||||
let mut prefill = text_input("Automatic", &self.preference_draft.prefill_chunk);
|
||||
if self.preference_draft.model != ModelChoice::Glm52 {
|
||||
power = power.on_input(Message::PreferencePowerChanged);
|
||||
prefill = prefill.on_input(Message::PreferencePrefillChunkChanged);
|
||||
}
|
||||
|
||||
let mut fields = column![
|
||||
text("MODEL").size(11),
|
||||
@@ -322,6 +333,38 @@ impl App {
|
||||
})
|
||||
.size(12),
|
||||
Space::with_height(8),
|
||||
text("EXECUTION").size(11),
|
||||
preference_input_row(
|
||||
"CPU helper threads",
|
||||
text_input("Automatic", &self.preference_draft.cpu_threads)
|
||||
.on_input(Message::PreferenceCpuThreadsChanged),
|
||||
),
|
||||
preference_input_row("GPU power percent", power),
|
||||
preference_input_row("Prefill chunk", prefill),
|
||||
checkbox("Prefer exact quality kernels", self.preference_draft.quality)
|
||||
.on_toggle(Message::PreferenceQualityChanged),
|
||||
checkbox("Warm mapped weights at load time", self.preference_draft.warm_weights)
|
||||
.on_toggle(Message::PreferenceWarmWeightsChanged),
|
||||
text(if self.preference_draft.model == ModelChoice::Glm52 {
|
||||
"GLM 5.2 uses full GPU power and selects prefill chunks automatically."
|
||||
} else {
|
||||
"Blank numeric values preserve DS4's automatic engine behavior."
|
||||
})
|
||||
.size(12),
|
||||
text(execution.map_or_else(
|
||||
|| "Effective execution settings will appear after valid values are entered."
|
||||
.to_owned(),
|
||||
|settings| format!(
|
||||
"Metal engine: threads {} • power {}% • prefill {} • quality {} • warm weights {}",
|
||||
if settings.cpu_threads == 0 { "auto".to_owned() } else { settings.cpu_threads.to_string() },
|
||||
if settings.power_percent == 0 { 100 } else { settings.power_percent },
|
||||
if settings.prefill_chunk == 0 { "auto".to_owned() } else { settings.prefill_chunk.to_string() },
|
||||
if settings.quality { "on" } else { "off" },
|
||||
if settings.warm_weights { "on" } else { "off" },
|
||||
),
|
||||
))
|
||||
.size(12),
|
||||
Space::with_height(8),
|
||||
text("CAPACITY").size(11),
|
||||
preference_input_row(
|
||||
"Context tokens",
|
||||
@@ -424,12 +467,19 @@ impl App {
|
||||
]
|
||||
.spacing(8);
|
||||
|
||||
let panel = container(column![header, scrollable(fields), footer].spacing(16))
|
||||
.padding(24)
|
||||
.width(600)
|
||||
.height(Length::Fill)
|
||||
.max_height(660)
|
||||
.style(overview_style);
|
||||
let panel = container(
|
||||
column![
|
||||
header,
|
||||
scrollable(container(fields).padding(iced::Padding::ZERO.right(18))),
|
||||
footer
|
||||
]
|
||||
.spacing(16),
|
||||
)
|
||||
.padding(24)
|
||||
.width(700)
|
||||
.height(Length::Fill)
|
||||
.max_height(660)
|
||||
.style(overview_style);
|
||||
opaque(
|
||||
container(panel)
|
||||
.padding(24)
|
||||
|
||||
Reference in New Issue
Block a user