I used the new version (1.2) of fcd to calculate the FCD of > 1M molecules.
Issue
In this scenario, my corresponding python script crashed due to a large memory footprint (> 50 GB) on both macOS and Linux. This might be a local issue and depend on the specific pytorch version, among other things.
Suggested resolution
I amended the code in two ways:
(1) Used a different context manager for inference; this does not solve the issue, but was done in addition to ...
(2) Casting the inference result to numpy float32 reduced the memory footprint. I am not sure why this works since the data type without the corresponding line is already float32 and should be without any additional data, such as gradients.
I calculated the FCD for smaller molecule sets of size 100,000 to check whether the FCD value remains the same, which it did in my experiments.
In summary, I consider this to be a minor change which helps to alleviate memory problems, at least in certain configurations.
Context
I used the new version (1.2) of
fcd
to calculate the FCD of > 1M molecules.Issue
In this scenario, my corresponding python script crashed due to a large memory footprint (> 50 GB) on both
macOS
andLinux
. This might be a local issue and depend on the specificpytorch
version, among other things.Suggested resolution
I amended the code in two ways:
(1) Used a different context manager for inference; this does not solve the issue, but was done in addition to ... (2) Casting the inference result to
numpy float32
reduced the memory footprint. I am not sure why this works since the data type without the corresponding line is alreadyfloat32
and should be without any additional data, such as gradients.I calculated the FCD for smaller molecule sets of size 100,000 to check whether the FCD value remains the same, which it did in my experiments.
In summary, I consider this to be a minor change which helps to alleviate memory problems, at least in certain configurations.