log_util
Author: Heli Qi Affiliation: NAIST Date: 2022.07
distributed_zero_first(distributed, rank)
Decorator to make all other processes in distributed training wait for the master process to do something. Have no influence on the single-GPU training case.
However, this ContextManager function will cause an extra GPU memory consumption for each process in the multi-GPU training setting. These memory occupations are neither allocated memory nor reserved memory, which may be the CUDA context memory. I haven't found any effective solutions to release them so far.
Source code in speechain/utilbox/log_util.py
logger_stdout_file(log_path, file_name=None, distributed=False, rank=0, name_candidate=1000)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
log_path
|
|
required | |
file_name
|
str
|
|
None
|
rank
|
int
|
|
0
|
log_candidate
|
|
required |
Returns:
Source code in speechain/utilbox/log_util.py
model_summary(model)
Return the information summary of the model for logging.
Codes borrowed from https://github.com/espnet/espnet/blob/a2abaf11c81e58653263d6cc8f957c0dfd9677e7/espnet2/torch_utils/model_summary.py#L48
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Model
|
|
required |
Returns: