Skip to content

Commit 7da18b3

Browse files
[refactor] [4/n] Rename profile → preset; version str→int; stages → stage_schemas (#1234)
Address PR #1234 review feedback. Rename the profile registry to "preset" throughout: - PipelineProfile → InferencePreset, ProfileStageSpec → PresetStageSpec - fastvideo/api/profiles.py → presets.py; 13 pipeline profiles.py → presets.py - Registry API, ConfigInfo.default_profile, PipelineSelection fields renamed Simplify version: str → int; drop the _version_key helper (every registered version is "1", plain int comparison suffices). Rename InferencePreset.stages → stage_schemas to clarify it is validation metadata; the real execution DAG lives in each pipeline's create_pipeline_stages(). Misc review fixes: - logger.exception → logger.warning in SamplingParam.update() - Collapse double config lookup via get_preset_selection() - Fix "image-to-prompt" typo on wan_fun_1_3b_inp - Loosen test_total_profile_count (== 37 → >= 37) - Revert CRLF whitespace churn in test_lingbot_similarity.py - Remove unused _clear_registry
1 parent 89da49f commit 7da18b3

24 files changed

Lines changed: 727 additions & 709 deletions

File tree

docs/design/inference_schema_parity_inventory.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
status_definitions:
22
kept: "Public field remains on a public adapter surface with the same meaning."
33
moved: "Public field remains supported but normalizes into a different nested path."
4-
profile_owned: "Public field remains supported only through a model/profile-specific surface."
4+
preset_owned: "Public field remains supported only through a model/preset-specific surface."
55
compatibility_only: "Legacy public field remains adapter-only during migration and is not part of the canonical typed schema."
66
private_only: "Field should only be handled by private adapters and is not a public FastVideo compatibility promise."
77
internal_only: "Field is runtime/config plumbing and should not be part of the new public typed inference API."
@@ -40,12 +40,12 @@ surfaces:
4040
init_weights_from_safetensors_2: generator.pipeline.components.transformer_2_weights
4141
override_pipeline_cls_name: generator.pipeline.components.override_pipeline_cls_name
4242
boundary_ratio: request.sampling.boundary_ratio
43-
profile_owned:
44-
ltx2_vae_tiling: generator.pipeline.profile_overrides.ltx2.vae_tiling
45-
ltx2_vae_spatial_tile_size_in_pixels: generator.pipeline.profile_overrides.ltx2.vae.spatial_tile_size_in_pixels
46-
ltx2_vae_spatial_tile_overlap_in_pixels: generator.pipeline.profile_overrides.ltx2.vae.spatial_tile_overlap_in_pixels
47-
ltx2_vae_temporal_tile_size_in_frames: generator.pipeline.profile_overrides.ltx2.vae.temporal_tile_size_in_frames
48-
ltx2_vae_temporal_tile_overlap_in_frames: generator.pipeline.profile_overrides.ltx2.vae.temporal_tile_overlap_in_frames
43+
preset_owned:
44+
ltx2_vae_tiling: generator.pipeline.preset_overrides.ltx2.vae_tiling
45+
ltx2_vae_spatial_tile_size_in_pixels: generator.pipeline.preset_overrides.ltx2.vae.spatial_tile_size_in_pixels
46+
ltx2_vae_spatial_tile_overlap_in_pixels: generator.pipeline.preset_overrides.ltx2.vae.spatial_tile_overlap_in_pixels
47+
ltx2_vae_temporal_tile_size_in_frames: generator.pipeline.preset_overrides.ltx2.vae.temporal_tile_size_in_frames
48+
ltx2_vae_temporal_tile_overlap_in_frames: generator.pipeline.preset_overrides.ltx2.vae.temporal_tile_overlap_in_frames
4949
ltx2_initial_latent_path: request.extensions.ltx2.initial_latent_path
5050
compatibility_only:
5151
mode: "Legacy multi-mode FastVideoArgs switch; typed inference config should not expose execution mode."
@@ -69,16 +69,16 @@ surfaces:
6969
pipeline_config_base:
7070
moved:
7171
pipeline_config_path: generator.pipeline.components.pipeline_config_path
72-
profile_owned:
73-
embedded_cfg_scale: generator.pipeline.profile_overrides.embedded_cfg_scale
74-
flow_shift: generator.pipeline.profile_overrides.flow_shift
75-
flow_shift_sr: generator.pipeline.profile_overrides.flow_shift_sr
76-
is_causal: generator.pipeline.profile_overrides.is_causal
77-
vae_tiling: generator.pipeline.profile_overrides.vae_tiling
78-
vae_sp: generator.pipeline.profile_overrides.vae_sp
79-
dmd_denoising_steps: generator.pipeline.profile_overrides.dmd_denoising_steps
80-
ti2v_task: generator.pipeline.profile_overrides.ti2v_task
81-
boundary_ratio: generator.pipeline.profile_overrides.boundary_ratio
72+
preset_owned:
73+
embedded_cfg_scale: generator.pipeline.preset_overrides.embedded_cfg_scale
74+
flow_shift: generator.pipeline.preset_overrides.flow_shift
75+
flow_shift_sr: generator.pipeline.preset_overrides.flow_shift_sr
76+
is_causal: generator.pipeline.preset_overrides.is_causal
77+
vae_tiling: generator.pipeline.preset_overrides.vae_tiling
78+
vae_sp: generator.pipeline.preset_overrides.vae_sp
79+
dmd_denoising_steps: generator.pipeline.preset_overrides.dmd_denoising_steps
80+
ti2v_task: generator.pipeline.preset_overrides.ti2v_task
81+
boundary_ratio: generator.pipeline.preset_overrides.boundary_ratio
8282
compatibility_only:
8383
model_path: "Redundant with generator.model_path."
8484
disable_autocast: "Duplicated by generator.engine.disable_autocast during migration."
@@ -97,7 +97,7 @@ surfaces:
9797
postprocess_text_funcs: "Internal text postprocessing hooks."
9898

9999
pipeline_config_extensions:
100-
profile_owned:
100+
preset_owned:
101101
conditioning_strategy:
102102
sources:
103103
- fastvideo.configs.pipelines.cosmos.CosmosConfig
@@ -309,8 +309,8 @@ surfaces:
309309
compatibility_only:
310310
batch_size: "Gen3C inference-only tuning field pending typed batching design."
311311
gradient_checkpointing: "Gen3C inference-only compatibility field pending typed batching design."
312-
guidance_scale: "Gen3C pipeline-level default pending profile/default-request cleanup."
313-
num_inference_steps: "Gen3C pipeline-level default pending profile/default-request cleanup."
312+
guidance_scale: "Gen3C pipeline-level default pending preset/default-request cleanup."
313+
num_inference_steps: "Gen3C pipeline-level default pending preset/default-request cleanup."
314314
internal_only:
315315
audio_decoder_config: "Legacy internal component config object."
316316
audio_decoder_precision: "Precision override pending dedicated component precision design."
@@ -354,7 +354,7 @@ surfaces:
354354
return_frames: request.output.return_frames
355355
return_trajectory_latents: request.runtime.return_trajectory_latents
356356
return_trajectory_decoded: request.runtime.return_trajectory_decoded
357-
profile_owned:
357+
preset_owned:
358358
t_thresh: request.stage_overrides.refine.t_thresh
359359
spatial_refine_only: request.stage_overrides.refine.spatial_refine_only
360360
num_cond_frames: request.stage_overrides.refine.num_cond_frames

fastvideo/api/__init__.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
)
2323
from fastvideo.api.errors import ConfigValidationError
2424
from fastvideo.api.overrides import apply_overrides, parse_cli_overrides
25-
from fastvideo.api.profiles import (
26-
PipelineProfile,
27-
ProfileStageSpec,
28-
get_all_profile_names,
29-
get_profile,
30-
get_profiles_for_family,
31-
register_profile,
32-
validate_profile_selection,
25+
from fastvideo.api.presets import (
26+
InferencePreset,
27+
PresetStageSpec,
28+
get_all_preset_names,
29+
get_preset,
30+
get_presets_for_family,
31+
register_preset,
32+
validate_preset_selection,
3333
validate_stage_names,
3434
validate_stage_overrides,
3535
)
@@ -67,21 +67,21 @@
6767
"SamplingParam",
6868
"ServeConfig",
6969
"ServerConfig",
70-
"PipelineProfile",
71-
"ProfileStageSpec",
70+
"InferencePreset",
71+
"PresetStageSpec",
7272
"apply_overrides",
7373
"config_to_dict",
7474
"load_config",
7575
"load_raw_config",
7676
"load_run_config",
7777
"load_serve_config",
7878
"parse_cli_overrides",
79-
"get_all_profile_names",
80-
"get_profile",
81-
"get_profiles_for_family",
79+
"get_all_preset_names",
80+
"get_preset",
81+
"get_presets_for_family",
8282
"parse_config",
83-
"register_profile",
84-
"validate_profile_selection",
83+
"register_preset",
84+
"validate_preset_selection",
8585
"validate_stage_names",
8686
"validate_stage_overrides",
8787
]

fastvideo/api/compat.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ def legacy_from_pretrained_to_config(
157157
def generator_config_to_fastvideo_args(config: GeneratorConfig | Mapping[str, Any], ) -> FastVideoArgs:
158158
normalized = normalize_generator_config(config)
159159
unsupported = []
160-
if normalized.pipeline.profile is not None:
161-
unsupported.append("pipeline.profile")
162-
if normalized.pipeline.profile_version is not None:
163-
unsupported.append("pipeline.profile_version")
160+
if normalized.pipeline.preset is not None:
161+
unsupported.append("pipeline.preset")
162+
if normalized.pipeline.preset_version is not None:
163+
unsupported.append("pipeline.preset_version")
164164
if normalized.pipeline.components.config_root is not None:
165165
unsupported.append("pipeline.components.config_root")
166166
if normalized.pipeline.components.vae_weights is not None:
@@ -220,7 +220,7 @@ def generator_config_to_fastvideo_args(config: GeneratorConfig | Mapping[str, An
220220
if components.transformer_2_weights is not None:
221221
kwargs["init_weights_from_safetensors_2"] = components.transformer_2_weights
222222

223-
kwargs.update(deepcopy(normalized.pipeline.profile_overrides))
223+
kwargs.update(deepcopy(normalized.pipeline.preset_overrides))
224224
kwargs.update(deepcopy(normalized.pipeline.experimental))
225225
return FastVideoArgs.from_kwargs(**kwargs)
226226

0 commit comments

Comments
 (0)