mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-15 22:19:38 +00:00
[plugin] support get_grad_norm (#6115)
This commit is contained in:
@@ -76,6 +76,8 @@ def run_fn(init_method, model_fn, data_gen_fn, output_transform_fn) -> Optional[
|
||||
|
||||
booster.execute_pipeline(data_iter, model, _criterion, optimizer, return_loss=True)
|
||||
optimizer.step()
|
||||
grad_norm = optimizer.get_grad_norm()
|
||||
assert grad_norm is None or isinstance(grad_norm, float)
|
||||
|
||||
except Exception as e:
|
||||
return repr(e)
|
||||
|
Reference in New Issue
Block a user