InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[Idea] Possible speedup with TensorRT and/or nvFuser

Open veprogames opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. This goes above my head, but I found this https://github.com/cloneofsimo/sd-various-ideas#accelerating-stable-diffusion-inference-with-nvfuser-jit-compilation and wanna share it here.

Describe the solution you'd like I don't know if it is possible to implement, but if it is, this could yield up to 50 % faster inference times on half precision.

Additional context

  • If I understood this correctly, it will only speed up on NVIDIA Cards. Other Platforms/architectures probably won't profit from it.
  • Some sources:
    • https://www.reddit.com/r/MachineLearning/comments/xa75km/p_pytorchs_newest_nvfuser_on_stable_diffusion_to/
    • https://www.photoroom.com/tech/stable-diffusion-25-percent-faster-and-save-seconds/

veprogames avatar Sep 14 '22 18:09 veprogames

This has been brought up already

  • It's not that much of a speedup (a couple of seconds on already very fast hardware)
  • It requires modifying the model itself
    • Thus we're in a position where we either
      • Distribute a modified model (where are we going to host a 4GB model?), which I don't think @lstein wants to do or
      • Someone comes up with some kind of automation which end-users can use to modify the model they download from Hugging Face
  • Speedup is only good on NVIDIA H/W (and possibly only recent H/W - I'm not sure about that)

tildebyte avatar Sep 15 '22 21:09 tildebyte