Add model compiling to the ui

This commit is contained in:
Jaret Burkett
2026-06-12 11:02:10 -06:00
parent 6b1f89f30b
commit c09b228a35
4 changed files with 37 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ import {
jobTypeOptions, jobTypeOptions,
SampleTags, SampleTags,
} from './options'; } from './options';
import { defaultDatasetConfig } from './jobConfig'; import { defaultCompileOptions, defaultDatasetConfig } from './jobConfig';
import { GroupedSelectOption, JobConfig, SelectOption } from '@/types'; import { GroupedSelectOption, JobConfig, SelectOption } from '@/types';
import { objectCopy, tagsToObj, objToTags } from '@/utils/basic'; import { objectCopy, tagsToObj, objToTags } from '@/utils/basic';
import { import {
@@ -368,7 +368,7 @@ export default function SimpleJob({
)} )}
</Card> </Card>
{disableSections.includes('model.quantize') ? null : ( {disableSections.includes('model.quantize') ? null : (
<Card title="Quantization"> <Card title="Quantize / Compile">
<SelectInput <SelectInput
label="Transformer" label="Transformer"
value={jobConfig.config.process[0].model.quantize ? jobConfig.config.process[0].model.qtype : ''} value={jobConfig.config.process[0].model.quantize ? jobConfig.config.process[0].model.qtype : ''}
@@ -401,6 +401,25 @@ export default function SimpleJob({
options={quantizationOptions} options={quantizationOptions}
/> />
)} )}
<FormGroup label="Compile Options">
<></>
</FormGroup>
<Checkbox
label="Compile Model"
checked={jobConfig.config.process[0].train.compile || false}
onChange={value => {
setJobConfig(value, 'config.process[0].train.compile');
if (value) {
for (const key in defaultCompileOptions) {
setJobConfig((defaultCompileOptions as any)[key], `config.process[0].train.${key}`);
}
} else {
for (const key in defaultCompileOptions) {
setJobConfig(undefined, `config.process[0].train.${key}`);
}
}
}}
/>
</Card> </Card>
)} )}
{modelArch?.additionalSections?.includes('model.multistage') && ( {modelArch?.additionalSections?.includes('model.multistage') && (

View File

@@ -31,6 +31,14 @@ export const defaultSliderConfig: SliderConfig = {
anchor_class: '', anchor_class: '',
}; };
export const defaultCompileOptions = {
block_compile: false,
compile_mode: 'default',
compile_fullgraph: false,
compile_dynamic: false,
cache_size_limit: undefined,
};
export const defaultJobConfig: JobConfig = { export const defaultJobConfig: JobConfig = {
job: 'extension', job: 'extension',
config: { config: {
@@ -94,6 +102,7 @@ export const defaultJobConfig: JobConfig = {
diff_output_preservation_class: 'person', diff_output_preservation_class: 'person',
switch_boundary_every: 1, switch_boundary_every: 1,
loss_type: 'mse', loss_type: 'mse',
compile: false,
}, },
logging: { logging: {
log_every: 1, log_every: 1,

View File

@@ -151,6 +151,12 @@ export interface TrainConfig {
differential_guidance_scale?: number; differential_guidance_scale?: number;
audio_loss_multiplier?: number; audio_loss_multiplier?: number;
max_loss?: number | null; max_loss?: number | null;
compile?: boolean;
block_compile?: boolean;
compile_mode?: 'default' | 'max-autotune' | 'fastest';
compile_fullgraph?: boolean;
compile_dynamic?: boolean;
cache_size_limit?: number;
} }
export interface QuantizeKwargsConfig { export interface QuantizeKwargsConfig {

View File

@@ -1 +1 @@
VERSION = "0.10.6" VERSION = "0.10.7"