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

Update arch check for SD #9783

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ def check_cuda():
dprops = th.cuda.get_device_properties(cur_device)

is_sm75 = dprops.major == 7 and dprops.minor == 5
is_sm8x = dprops.major == 8 and dprops.minor >= 0
is_sm90 = dprops.major == 9 and dprops.minor >= 0
is_sm8x_or_later = dprops.major >= 8

return is_sm8x or is_sm75 or is_sm90
return is_sm75 or is_sm8x_or_later


try:
Expand Down Expand Up @@ -154,7 +153,9 @@ def __init__(
self.use_scale_shift_norm = use_scale_shift_norm

self.in_layers = nn.Sequential(
normalization(channels), nn.SiLU(), conv_nd(dims, channels, self.out_channels, 3, padding=1),
normalization(channels),
nn.SiLU(),
conv_nd(dims, channels, self.out_channels, 3, padding=1),
)

self.updown = up or down
Expand All @@ -173,7 +174,11 @@ def __init__(
self.h_upd = self.x_upd = nn.Identity()

self.emb_layers = nn.Sequential(
nn.SiLU(), linear(emb_channels, 2 * self.out_channels if use_scale_shift_norm else self.out_channels,),
nn.SiLU(),
linear(
emb_channels,
2 * self.out_channels if use_scale_shift_norm else self.out_channels,
),
)
self.out_layers = nn.Sequential(
normalization(self.out_channels),
Expand Down Expand Up @@ -263,7 +268,11 @@ def __init__(
)

self.emb_layers = nn.Sequential(
nn.SiLU(), nn.Linear(emb_channels, 2 * out_channels if use_scale_shift_norm else out_channels,),
nn.SiLU(),
nn.Linear(
emb_channels,
2 * out_channels if use_scale_shift_norm else out_channels,
),
)

self.out_layers = nn.Sequential(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ def check_cuda():
dprops = torch.cuda.get_device_properties(cur_device)

is_sm75 = dprops.major == 7 and dprops.minor == 5
is_sm8x = dprops.major == 8 and dprops.minor >= 0
is_sm90 = dprops.major == 9 and dprops.minor >= 0
is_sm8x_or_later = dprops.major >= 8

return is_sm8x or is_sm75 or is_sm90
return is_sm75 or is_sm8x_or_later


try:
Expand Down
Loading