Git Product home page Git Product logo

Comments (4)

mkphuthi avatar mkphuthi commented on July 23, 2024 1

Yes. I think we can close this issue

from nequip.

Linux-cpp-lisp avatar Linux-cpp-lisp commented on July 23, 2024

Hi @mkphuthi ,

In ASE this is unexpected... I don't get a segfault when trained with default_dtype: float64 added to minimal.yaml and then running:

In [1]: from nequip.ase import NequIPCalculator

In [3]: calc = NequIPCalculator.from_deployed_model("test.pth", "cuda")
/home/a/Documents/NequIP/code/nequip/nequip/utils/_global_options.py:45: UserWarning: Setting the GLOBAL value for allow_tf32 to False which is different than the previous value of True
  warnings.warn(
/home/a/Documents/NequIP/code/nequip/nequip/utils/_global_options.py:58: UserWarning: Setting the GLOBAL value for jit fusion strategy to `[('DYNAMIC', 3)]` which is different than the previous value of `[('STATIC', 2), ('DYNAMIC', 10)]`
  warnings.warn(
/home/a/Documents/NequIP/code/nequip/nequip/ase/nequip_calculator.py:73: UserWarning: Trying to use chemical symbols as NequIP type names; this may not be correct for your model! To avoid this warning, please provide `species_to_type_name` explicitly.
  warnings.warn(

In [4]: import ase.build

In [6]: atoms = ase.build.molecule("CH3CHO")

In [7]: atoms.calc = calc

In [8]: atoms.get_potential_energy()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
...
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
...
RuntimeError: expected scalar type Float but found Double


In [9]: import torch

In [10]: torch.set_default_dtype(torch.float64)

In [12]: atoms.get_potential_energy()
Out[12]: -135216.08807821615

This could be called a bug (maybe it should detect automatically and convert to float64, or at least try to set the global set_default_dtype like the other global settings), but it certainly isn't a segfault... is this only one particular installation / environment where this occurs, or you've reproduced it in multiple places / ways?

In LAMMPS this is currently expected since we at present only support float32 inputs into the model...

from nequip.

mkphuthi avatar mkphuthi commented on July 23, 2024

Setting the default dtype to float64 fixed it! The segfault has been there with every NequIP install I have tried so far. Strange.

from nequip.

Linux-cpp-lisp avatar Linux-cpp-lisp commented on July 23, 2024

Weird... this should error out normally but at that point I'd attribute the problem to PyTorch. Is this all on the same machine, or across machines too that you see this?

Either way, glad that it is resolved. Can I close the issue then for the segfault?

from nequip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.