Is torch 2.0 any better than torch 1.13.1 #6455
Replies: 23 comments 128 replies
-
torch 1.13.1 is not as good. I have been using 1.31.1 since this repo existed, and I only see the performance improvement when I upgraded to 2.0 AND compiled xformer with 2.0. Did you compile xformer with 2.0 too? |
Beta Was this translation helpful? Give feedback.
-
I wonder if @brkirch can weigh in here and say if upgrading to Torch 2.0 could make a meaningful difference on macOS + Apple Silicon, too. |
Beta Was this translation helpful? Give feedback.
-
I was able to update the wubui to torch==1.13.1+cu117 and torchvision==0.14.1+cu117 (Windows 10 + Python 3.10.9) Now, Xformers doesnt work anymore after this update.. I tried to rebuild Xformers, to look for new wheels, etc etc etc... I have literally 7 hours trying to update Xformers to 0.0.16 and Im not able to do it, I have searched all github, reedit, google.. followed 21374628746 tutorials, steps... and nothing... I just cant... and I need Xformers because i just have an 1660ti 6gb vram, so Xformers helps me a lot... Anyone knows how to do it? and please, something for dummies, im not an expert as you can see... thanks in advance... my head is going to blow... |
Beta Was this translation helpful? Give feedback.
-
is anyone able to still train after upgrading to torch 2.0? am considering upgrading, but don't want to waste time if it results in the inability to train. |
Beta Was this translation helpful? Give feedback.
-
Ok gents I have down time and motivation going to give this a go. |
Beta Was this translation helpful? Give feedback.
-
Ok, im here with my test and results: OS Name: Microsoft Windows 10 Pro Processor: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz, 2592 Mhz, 6 Core(s), 12 Logical Processor(s) I have 4 Stable Diffusions WebUI venv installed:
Prompt: portrait photo of a asia old warrior chief <- (Random prompt from the internet) Restore faces: NO
My conclusions of the test in my config: ( Vanilla = Torch 1.13.1 ) < Torch 2.0.0
Everything was installed correctly following the steps, no errors in the process, just the triton one:
Anyone has a clue about the noise generation in 2.0.0? Could be the --precision full --no-half Arguments not optimized for torch 2.0.0 and/or new Xformers?
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Troubleshooting#green-or-black-screen as I have a 1660 ti, I always use those arguments and always worked. Still working with previous torch versions. I know my Graphics card is not the ideal for SD, but is what I have. I hope this information helps. |
Beta Was this translation helpful? Give feedback.
-
anyone tried on make those checkups on linux and install this triton too? |
Beta Was this translation helpful? Give feedback.
-
Looks like I was doing it wrong or maybe It just doesn't work with T4 yet. I was following the instruction from this https://pytorch.org/get-started/pytorch-2.0/#requirements and then clone the xformers from its github, and lastly compile them. and after it was done, I created the wheel file to make sure I would not compile it again. |
Beta Was this translation helpful? Give feedback.
-
4090 here |
Beta Was this translation helpful? Give feedback.
-
Dell 3070 (8GB) OC, Win 10 Home, 16GB DDR4 Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 3508515359, Size: 512x512, Model hash: a9263745, Model: v1-5-pruned |
Beta Was this translation helpful? Give feedback.
-
Gave it a test myself with my RTX 3070 Fresh installs for both: 8850fc2
Torch 2.0.0 + Xformers Compiled with Torch 2.0.0 + cuda116 (No Triton) Torch 1.13.1 + Xformers from Automatic No major change, but it didn't absolutely break things. Edit: Changed some of the Compiler options, set it to just |
Beta Was this translation helpful? Give feedback.
-
Hey guys, I'm a novice when it comes to all the lingo, (I was fine 10+ years ago, but a lot has changed that I haven't caught up on...) Is installing torch 2.0 better than the torch I have now (whatever version I was told to install....) My card is a GTX 1080, if I want to install the new torch, what steps do I need to do? Install python whatever, then do I need to change any files in my Auto WebUI folder? I read that xformers is installed automatically when I just type --xformers into my bat file, is that not true, or if it is true... after installing torch 2.0, do I need to manually rebuild/install/whatever? I haven't updated because all the information that I've read/watched has told me autoui was built around python 3.10 (or whatever...) Are we updating python, or just the torch. Does this affect any other extensions I've installed recently? Thanks ya'll! |
Beta Was this translation helpful? Give feedback.
-
xformers is far more important than torch 2.0.
I see no perf improvement with torch 2.0 but others claim so.
The problem is that no one quotes image generation times and only it/s.
I won't even try to test torch 2.0 anymore until someone says they can
generate, on a 4090, 96 images (nbatches=6 X batchsize=16) in under 57
seconds. I get this with torch 1.13.1. Torch 2.0 is no faster.
opt-channelslast only slows things down for me.
…On Tue, Jan 10, 2023 at 3:54 PM Croestalker ***@***.***> wrote:
Hey guys, I'm a novice when it comes to all the lingo, (I was fine 10+
years ago, but a lot has changed that I haven't caught up on...) Is
installing torch 2.0 better than the torch I have now (whatever version I
was told to install....) My card is a GTX 1080, if I want to install the
new torch, what steps do I need to do? Install python whatever, then do I
need to change any files in my Auto WebUI folder? I read that xformers is
installed automatically when I just type --xformers into my bat file, is
that not true, or if it is true... after installing torch 2.0, do I need to
manually rebuild/install/whatever?
I haven't updated because all the information that I've read/watched has
told me autoui was built around python 3.10 (or whatever...) Are we
updating python, or just the torch. Does this affect any other extensions
I've installed recently?
Thanks ya'll!
—
Reply to this email directly, view it on GitHub
<#6455 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3YFZABVF2MICWBHUCGFRH3WRXZC7ANCNFSM6AAAAAATTUV6EU>
.
You are receiving this because you authored the thread.Message ID:
<AUTOMATIC1111/stable-diffusion-webui/repo-discussions/6455/comments/4650926
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Status for anybody interested ... Premise 2: If you build Torch 2 locally you can get a 3X perf improvement on a 4090. Something is wrong with the nightly builds that pytorch.org provides. I had claimed this before and today someone else has just confirmed this. I was contacted on Facebook by an ex CTO that had access to various GPU's in the cloud and offered me hardware to test and his expertise in exchange for my help in speeding up his Linux based SD service. Spent 12 hours online figure out how to build Torch 2.0 locally and when it worked it was indeed as fast as I hoped for. We also confirmed some speed up on a 3090 and tomorrow he will test an A4000 GPU which currently is only doing 7 it/s. Because I spent all day doing this I'm still trying to figure out why I can't build Torch 2.0 for a second time so I can document all the steps to give to everyone on LInux. |
Beta Was this translation helpful? Give feedback.
-
Well, this is fun! NOT!!! |
Beta Was this translation helpful? Give feedback.
-
So this is a long discussion, but I will post random observations from CachyOS Linux/a 2060 laptop:
|
Beta Was this translation helpful? Give feedback.
-
Started discussion #6932 |
Beta Was this translation helpful? Give feedback.
-
The performance differences in pytorch has more to do with the libcudnn version than anything else. I have found the root cause of why some see 13 it/s on a 4090 and others see ~40 it/s. See #6954 I've let the pytorch community know. |
Beta Was this translation helpful? Give feedback.
-
Torch 2.0.0 is >>NOT<< a lot faster, faster nor even a little bit faster than 1.13.1. If I am wrong, show me results where you get over 45 it/s with a regular 4090. Torch 2 is NOT faster. Now xformers does give me a 28% speedup over the 30.5it/s I see when it is not used. That is a real example of a lot faster. I get very consistent results. Of course, there might be some edge case that isn't what someone doing normal image generation will see. Maybe by GA in Mar? we'll see some improvements with inference. |
Beta Was this translation helpful? Give feedback.
-
i agree, torch 2.0 is not any better on its own than torch 1.13.1 if everything is configured correctly torch 2.0 has a long term potential due to inclusion of |
Beta Was this translation helpful? Give feedback.
-
How would I get this to work for the new launch.py where line 182 and 242 are the relevant lines? The xformers install is different. Clean install of windows and I'm starting from scratch. |
Beta Was this translation helpful? Give feedback.
-
24.) Automatic1111 Web UI - PC - Free |
Beta Was this translation helpful? Give feedback.
-
For my setup I can confirm the superiority of torch 2.0 / cuda 11.8 over torch 1.13.1 / cuda 11.7. This seems to be mostly due to improvements in cuda 11.8 which is supported by torch 2.0 (source). Performance went up from 5.97 it/s to 8.59 it/s while VRAM usage being much lower. I wasn't using xformers so that explains the larger gain. System: |
Beta Was this translation helpful? Give feedback.
-
Yesterday I was experimenting with building torch 2.0 so that I could ALSO use CUDA-12.0. I was excited it was so fast. Today I explored deeper and to do so I did a clean install of A1111 and it was very fast without torch 2. ??? I found an older A1111 I still had and it was slow. After a lot of work to figure out what the difference was I found the old version had torch 1.12.1+cu113 and if you remove and reinstall you get 1.13.1+cu117.
Indeed it was much faster. I now have learned that "git pull" to update A1111 doesn't upgrade python packages to newer versions.
Then I installed torch 2.0.0.dev20230106+cu117 and I no longer see a perf improvement over 1.13.1. I have a feeling that CUDA-12.0 won't make any further difference. A valuable lesson learned.
I can still get another 16% perf improvement with the two other changes I mentioned in another post but now torch 2.0 has nothing to do with it. I was going to post those changes today but trying to figure out why the baseline was so much faster has consumed most of the day.
@hippopotamus1000
@DustyCooper
@aliencaocao See if torch 1.13.1 is just as good as torch 2.
Beta Was this translation helpful? Give feedback.
All reactions