Skip to content

Commit 7725271

Browse files
committed
updates
1 parent 1d4bc03 commit 7725271

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/diffusers/utils/torch_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@ def apply_freeu(
154154
def get_torch_cuda_device_capability():
155155
if torch.cuda.is_available():
156156
device = torch.device("cuda")
157-
gpu_name = torch.cuda.get_device_name(device)
158157
compute_capability = torch.cuda.get_device_capability(device)
159158
compute_capability = f"{compute_capability[0]}.{compute_capability[1]}"
160-
print(f"{gpu_name=}, {compute_capability=}")
161159
return float(compute_capability)
162160
else:
163161
return None

tests/models/test_modeling_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,7 @@ def test_layerwise_casting(storage_dtype, compute_dtype):
13851385
@require_torch_gpu
13861386
def test_layerwise_casting_memory(self):
13871387
MB_TOLERANCE = 0.2
1388+
LEAST_COMPUTE_CAPABILITY = 8.0
13881389

13891390
def reset_memory_stats():
13901391
gc.collect()
@@ -1417,7 +1418,7 @@ def get_memory_usage(storage_dtype, compute_dtype):
14171418
self.assertTrue(fp8_e4m3_bf16_memory_footprint < fp8_e4m3_fp32_memory_footprint < fp32_memory_footprint)
14181419
# NOTE: the following assertion will fail on our CI (running Tesla T4) due to bf16 using more memory than fp32.
14191420
# On other devices, such as DGX (Ampere) and Audace (Ada), the test passes.
1420-
if compute_capability >= 8.9:
1421+
if compute_capability >= LEAST_COMPUTE_CAPABILITY:
14211422
self.assertTrue(fp8_e4m3_bf16_max_memory < fp8_e4m3_fp32_max_memory)
14221423
# On this dummy test case with a small model, sometimes fp8_e4m3_fp32 max memory usage is higher than fp32 by a few
14231424
# bytes. This only happens for some models, so we allow a small tolerance.

0 commit comments

Comments
 (0)