Skip to content

Commit

Permalink
Avoid inplicit cuda call
Browse files Browse the repository at this point in the history
  • Loading branch information
pomonam committed Mar 19, 2024
1 parent bf0cd76 commit a1169fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kronfluence/module/tracked_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,9 @@ def synchronize_covariance_matrices(self) -> None:
if dist.is_initialized() and torch.cuda.is_available() and self._covariance_matrices_available():
# Note that only the main process holds the aggregated covariance matrix.
for covariance_factor_name in COVARIANCE_FACTOR_NAMES:
self._storage[covariance_factor_name] = self._storage[covariance_factor_name].cuda()
dist.reduce(
tensor=self._storage[covariance_factor_name].cuda(),
tensor=self._storage[covariance_factor_name],
op=dist.ReduceOp.SUM,
dst=0,
)
Expand Down

0 comments on commit a1169fb

Please sign in to comment.