Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add faster subTB #102

Merged
merged 1 commit into from
Aug 17, 2023
Merged

add faster subTB #102

merged 1 commit into from
Aug 17, 2023

Conversation

SobhanMP
Copy link
Contributor

self.subtb_loss_fast(log_p_F, log_p_B, log_F_preds, clip_log_R, batch.traj_lens)
  Median: 59.95 ms
  IQR:    0.29 ms (59.84 to 60.13)
  17 measurements, 1 runs per measurement, 1 thread
<torch.utils.benchmark.utils.common.Measurement object at 0x7f89941df130>
self.subtb_cum(log_p_F, log_p_B, log_F_preds, clip_log_R, batch.traj_lens)
  Median: 16.43 ms
  IQR:    0.12 ms (16.41 to 16.53)
  7 measurements, 10 runs per measurement, 1 thread

image

subtb_diff is the mse of the loss between the two implementations.

Diff is not zero because I precompute P_F - P_B, doing cross(P_F) - cross(P_B) instead of cross(P_F - P_B) yields the exact same results.

@SobhanMP SobhanMP requested a review from bengioe as a code owner August 16, 2023 16:57
@SobhanMP
Copy link
Contributor Author

(squash)

@bengioe bengioe merged commit 86eccea into recursionpharma:trunk Aug 17, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants