Skip to content

Commit

Permalink
fp8: override offload/compile config based on what we're doing
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickvP committed Oct 10, 2024
1 parent 257ddaa commit 76003b8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,29 @@ def base_setup(
self.disable_fp8 = disable_fp8

if not self.disable_fp8:
if compile_fp8:
extra_args = {
"compile_whole_model": True,
"compile_extras": True,
"compile_blocks": True
}
else:
extra_args = {
"compile_whole_model": False,
"compile_extras": False,
"compile_blocks": False
}

if self.offload:
extra_args |= {
"offload_text_encoder": True,
"offload_vae": True,
"offload_flow": True
}
self.fp8_pipe = FluxPipeline.load_pipeline_from_config_path(
f"fp8/configs/config-1-{flow_model_name}-h100.json",
shared_models=shared_models,
**extra_args
)

if compile_fp8:
Expand Down

0 comments on commit 76003b8

Please sign in to comment.