-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into layerwise-fp8-upcasting
- Loading branch information
Showing
12 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .cogvideox_lora import COGVIDEOX_T2V_LORA_CONFIG | ||
from .full_finetune import COGVIDEOX_T2V_FULL_FINETUNE_CONFIG | ||
from .lora import COGVIDEOX_T2V_LORA_CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .full_finetune import HUNYUAN_VIDEO_T2V_FULL_FINETUNE_CONFIG | ||
from .hunyuan_video_lora import HUNYUAN_VIDEO_T2V_LORA_CONFIG | ||
from .lora import HUNYUAN_VIDEO_T2V_LORA_CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .full_finetune import LTX_VIDEO_T2V_FULL_FINETUNE_CONFIG | ||
from .ltx_video_lora import LTX_VIDEO_T2V_LORA_CONFIG | ||
from .lora import LTX_VIDEO_T2V_LORA_CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import gc | ||
import inspect | ||
from typing import Optional, Tuple, Union | ||
|
||
import torch | ||
|
||
logger = get_logger(__name__) | ||
|
||
def reset_memory(device: Union[str, torch.device]) -> None: | ||
gc.collect() | ||
torch.cuda.empty_cache() | ||
torch.cuda.reset_peak_memory_stats(device) | ||
torch.cuda.reset_accumulated_memory_stats(device) | ||
|
||
|
||
def print_memory(device: Union[str, torch.device]) -> None: | ||
memory_allocated = torch.cuda.memory_allocated(device) / 1024**3 | ||
max_memory_allocated = torch.cuda.max_memory_allocated(device) / 1024**3 | ||
max_memory_reserved = torch.cuda.max_memory_reserved(device) / 1024**3 | ||
print(f"{memory_allocated=:.3f} GB") | ||
print(f"{max_memory_allocated=:.3f} GB") | ||
print(f"{max_memory_reserved=:.3f} GB") |