The Code:
config = CompilationConfig.Default()
if config.memory_format is not None:
self.unet = self.unet.to(memory_format=config.memory_format)
self.unet = torch.compile(self.unet, backend=functools.partial(
sfast_jit_trace,
ts_compiler=_build_ts_compiler(config)))
I tried aingdiffusion_v12 follows the code,but it didn't work (The time cost is the same comparing to not compile it).
model_path: models/stable_diffusion/aingdiffusion_v12.safetensors, modelname: sd_unet
The Code: config = CompilationConfig.Default() if config.memory_format is not None: self.unet = self.unet.to(memory_format=config.memory_format) self.unet = torch.compile(self.unet, backend=functools.partial( sfast_jit_trace, ts_compiler=_build_ts_compiler(config)))