-
Notifications
You must be signed in to change notification settings - Fork 87
POC: enable to train at the double precision #207
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
Conversation
@@ -37,7 +37,7 @@ def get_args(): | |||
parser.add_argument('--ema-alpha-neg-dy', type=float, default=1.0, help='The amount of influence of new losses on the exponential moving average of dy') | |||
parser.add_argument('--ngpus', type=int, default=-1, help='Number of GPUs, -1 use all available. Use CUDA_VISIBLE_DEVICES=1, to decide gpus') | |||
parser.add_argument('--num-nodes', type=int, default=1, help='Number of nodes') | |||
parser.add_argument('--precision', type=int, default=32, choices=[16, 32], help='Floating point precision') | |||
parser.add_argument('--precision', type=int, default=32, choices=[16, 32, 64], help='Floating point precision') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow I totally missed this argument when I implemented #182
loss_y = loss_fn(y, batch.y) | ||
# y | ||
y_dtype = {16: torch.float16, 32: torch.float32, 64: torch.float64}[self.hparams.precision] | ||
loss_y = loss_fn(y, batch.y.to(y_dtype)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come you need this here but not a few lines above for neg_dy?
# Keep molecules with specific elements | ||
if self.atomic_numbers: | ||
if not set(z.numpy()).issubset(self.atomic_numbers): | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got mixed from #206, right?
y = pt.tensor(self.y_mm[idx], dtype=pt.float32).view( | ||
1, 1 | ||
) # It would be better to use float64, but the trainer complaints | ||
y = pt.tensor(self.y_mm[idx], dtype=pt.float64).view(1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would pass dtype as an argument to Ace here and store everything in the correct type. I do not see why store pos in float32 and y in float64.
Obsolete |
No description provided.