Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

推理耗时问题 #49

Open
zeng121 opened this issue Sep 3, 2024 · 1 comment
Open

推理耗时问题 #49

zeng121 opened this issue Sep 3, 2024 · 1 comment

Comments

@zeng121
Copy link

zeng121 commented Sep 3, 2024

我用torch.2.1.0+cuda11.8和torch2.2.0+cuda11.8推理同一张图,前者比后者慢了10多秒,目前定位到耗时主要在unet去噪部分:
latents = self.noise_scheduler.step(
noise_pred, t, latents, **extra_step_kwargs
).prev_sample

求大佬解答

@Zheng-Chong
Copy link
Owner

推理时间与 Inference_step, 是否使用 CFG, 模型精度设置,输入和输出图像尺寸、显卡性能等有关,应该和 torch 版本没有关系,但我并没有进行过 torch 版本的相关测试,无法确定是否有两个版本会导致推理速度差异,建议使用项目中指定的 torch版本 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants