Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this does:
This PR works to resolve all deprecation warnings and hard incompatibilities with current versions of PyTorch-Lightning. It also sets
1.7.7
as the requested version inenvironment.yaml
.Switches from the now completely dead and gone
TestTubeLogger
to the now Lightning defaultTensorBoardLogger
. If you need to use another logger, you should be able to set it up in the configs. It seems to work more or less the same asTestTubeLogger
, in-so-far as how Textual Inversion was using it.There are a few other minor code adjustments:
.gitignore
to exclude a few things that have appeared while using TI and probably shouldn't be committed.What this does not do:
The reason for all these deprecation warnings was they were shifting towards a hardware agnostic API. In order to become hardware agnostic, we'd need to apply a few additional changes here and there. I'm leaving that to someone else to resolve, if it interests them.
I don't know if this will run on other accelerators besides GPU and maybe CPU in its current state, but someone else can make those changes if it interests them.
Why?
My AMD system is a house of cards when it comes to compute, and it was having difficulty inter-operating with Anaconda. Having to run on the global installation of Python and it's abysmal package management, I needed to bring Textual Inversion up to date so it was not fighting with other Stable Diffusion libraries that were keeping up with their dependencies.
There's been some big updates to the ROCm stack lately, so maybe I can now use Anaconda!? ...but that was after I had already started this journey. Doing dependency upkeep (especially on your core framework) is a good thing anyways, so here's the PR!
Additionally, after updating and using the new strategies and accelerators system, I got a 60% performance boost, because the hard-coded DDP mode was detrimental to my single-GPU setup. PyTorch-Lightning has actually gotten quite good at auto-detecting the best execution method for compute code, so I left it un-opinionated and updated the readme to demonstrate the
--accellerator gpu
flag, which probably isn't even needed... But since I have not tested the other accelerators besides GPU, it's the one to put there in the demo.If you really want to force the DDP strategy, you can use
--strategy ddp
to set it up.What needs special review attention:
I am not setup for anything besides Stable Diffusion and I'm frankly afraid to jostle this fragile setup trying to test training for other models. I would appreciate it if someone who is setup to test the
autoencoder
andlatent-diffusion
configs could please give this branch a try and make sure no deprecation warnings appear for an epoch or two of training.