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

Train specific layers #28

Merged
merged 3 commits into from
Sep 7, 2024
Merged

Train specific layers #28

merged 3 commits into from
Sep 7, 2024

Conversation

andreasjansson
Copy link
Member

@andreasjansson andreasjansson commented Sep 6, 2024

This should speed up training and still get good results.

Also turns caching to disk off by default.

Depends on #27


🚀 This description was created by Ellipsis for commit 856d0fc

Summary:

This PR optimizes training layers using regex, updates package versions, changes caching behavior, and modifies GitHub workflow.

Key points:

  • Optimize specific layers during training using regex.
  • Add layer_match.py for match_layers_to_optimize function.
  • Update train.py to accept layers_to_optimize_regex and cache_latents_to_disk as inputs.
  • Modify train.py to use match_layers_to_optimize for layer selection.
  • Change default in train.py to not cache latents to disk.
  • Update cog.yaml to PyTorch 2.4.0 and torchvision 0.19.0.
  • Add PyTorch nightly build installation in cog.yaml.
  • Modify .github/workflows/push.yaml to install a specific Cog version.

Generated with ❤️ by ellipsis.dev

This should speed up training and still get good results.

Also turns caching to disk off by default.
Comment on lines +152 to +155
cache_latents_to_disk: bool = Input(
description="Use this if you have lots of input images and you hit out of memory errors",
default=False,
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What sort of speed up do we get?

sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
#sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
# this is the latest main which has new base images for torch 2.4.0
sudo curl -o /usr/local/bin/cog -L "https://storage.googleapis.com/andreas-scratch-public/cog-26208388-linux-x86_64"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the official GitHub release URL for installing Cog to ensure reliability and security. The current URL points to a Google Cloud Storage location, which might not be as reliable.

@andreasjansson andreasjansson merged commit 011f7df into main Sep 7, 2024
3 checks passed
@andreasjansson andreasjansson deleted the train-specific-layers branch September 7, 2024 06:02
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

Successfully merging this pull request may close these issues.

2 participants