MCPcopy Index your code
hub / github.com/OpenGVLab/InternVL / log_model_statistic

Function log_model_statistic

classification/main_deepspeed.py:128–134  ·  view source on GitHub ↗
(model_wo_ddp)

Source from the content-addressed store, hash-verified

126
127
128def log_model_statistic(model_wo_ddp):
129 n_parameters = sum(p.numel() for p in model_wo_ddp.parameters()
130 if p.requires_grad)
131 logger.info(f'number of params: {n_parameters / 1e6} M')
132 if hasattr(model_wo_ddp, 'flops'):
133 flops = model_wo_ddp.flops()
134 logger.info(f'number of GFLOPs: {flops / 1e9}')
135
136
137def get_parameter_groups(model, config):

Callers 1

trainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected