Skip to content

Commit

Permalink
Update comment on to_be_evaluated blocking (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilykuleshov authored Oct 3, 2024
1 parent d50855c commit 81bd12b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions torchode/adjoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ def solve(
# Evaluate the solution at all evaluation points that have been passed in
# this step.
#
# We always build the interpolation and evaluate it, even if no evaluation
# points have actually been passed, because this avoids a CPU-GPU
# synchronization and for time series models we expect that most steps will
# pass at least one evaluation point across the whole batch (usually more).
# This causes a blocking CPU-GPU sync point at to_be_evaluated.any
# when t_eval is not None, but deferring this sync doesn't seem to
# yield a speedup. A sync is necessary at each evaluation point anyway
# since nonzero produces a variable-shape result.
# See https://github.com/martenlienen/torchode/issues/46
if t_eval is not None:
to_be_evaluated = (
torch.addcmul(
Expand Down

0 comments on commit 81bd12b

Please sign in to comment.