Skip to content

Commit

Permalink
build: remove fairscale dependency (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
brycedrennan authored Jan 4, 2024
1 parent 12e4855 commit 0271bff
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
4 changes: 1 addition & 3 deletions imaginairy/vendored/blip/vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import torch
import torch.nn as nn
from fairscale.nn.checkpoint.checkpoint_activations import checkpoint_wrapper
from timm.models.helpers import adapt_input_conv
from timm.models.layers import DropPath, trunc_normal_
from timm.models.vision_transformer import PatchEmbed
Expand Down Expand Up @@ -144,8 +143,7 @@ def __init__(
)

if use_grad_checkpointing:
self.attn = checkpoint_wrapper(self.attn)
self.mlp = checkpoint_wrapper(self.mlp)
raise RuntimeError("not supported")

def forward(self, x, register_hook=False):
x = x + self.drop_path(self.attn(self.norm1(x), register_hook=register_hook))
Expand Down
4 changes: 0 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ exceptiongroup==1.2.0
# pytest
facexlib==0.3.0
# via imaginAIry (setup.py)
fairscale==0.4.13
# via imaginAIry (setup.py)
fastapi==0.108.0
# via imaginAIry (setup.py)
filelock==3.13.1
Expand Down Expand Up @@ -125,7 +123,6 @@ numpy==1.24.4
# contourpy
# diffusers
# facexlib
# fairscale
# filterpy
# imageio
# imaginAIry (setup.py)
Expand Down Expand Up @@ -255,7 +252,6 @@ tomli==2.0.1
torch==2.1.2
# via
# facexlib
# fairscale
# imaginAIry (setup.py)
# kornia
# open-clip-torch
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def get_git_revision_hash() -> str:
"click-shell>=2.0",
"protobuf != 3.20.2, != 3.19.5",
"facexlib>=0.2.1.1",
"fairscale>=0.4.4", # for vendored blip
"fastapi>=0.70.0",
"ftfy>=6.0.1", # for vendored clip
"torch>=2.1.0",
Expand Down

0 comments on commit 0271bff

Please sign in to comment.