Giter Club home page Giter Club logo

Comments (5)

nw13slx avatar nw13slx commented on June 14, 2024

In the #46 pull, there are some warning messages linked to opt_einsum_fx (with pytorch1.9, e3nn 0.3.2, geometric 1.7.1)

opt_einsum_fx/opt_einsum_fx/_opt_ein.py:119: RuntimeWarning: einsum einsum lacked shape information; not optimizing. Did you forget to run ShapeProp on this graph?
  warnings.warn(

from nequip.

nw13slx avatar nw13slx commented on June 14, 2024

without pull #46 , with the unit test in the development branch will fail at tests/data/test_AtomicData.py::test_non_periodic_edge with error message:

tests/data/test_AtomicData.py::test_non_periodic_edge[float32]

====================================================== FAILURES ======================================================
__________________________________________ test_non_periodic_edge[float32] ___________________________________________

CH3CHO = (Atoms(symbols='OCHCH3', pbc=False), AtomicData(edge_index=[2, 18], pos=[7, 3], num_nodes=7, atomic_numbers=[7], cell=[3, 3], edge_cell_shift=[18, 3], pbc=[3]))

    def test_non_periodic_edge(CH3CHO):
        atoms, data = CH3CHO
        # check edges
        for edge in range(data.num_edges):
            real_displacement = (
                atoms.positions[data.edge_index[1, edge]]
                - atoms.positions[data.edge_index[0, edge]]
            )
>           assert torch.allclose(
                data.get_edge_vectors()[edge],
                torch.as_tensor(real_displacement, dtype=torch.get_default_dtype()),
            )

tests/data/test_AtomicData.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

data = AtomicData(edge_index=[2, 18], pos=[7, 3], num_nodes=7, atomic_numbers=[7], cell=[3, 3], edge_cell_shift=[18, 3], pbc=[3])

    def get_edge_vectors(data: Data) -> torch.Tensor:
>       data = AtomicDataDict.with_edge_vectors(AtomicData.to_AtomicDataDict(data))
E       RuntimeError: with_edge_vectors() Expected a value of type 'Dict[str, Tensor]' for argument 'data' but instead found type 'dict'.
E       Position: 0
E       Value: {'cell': tensor([[0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.]]), 'pbc': tensor([False, False, False]), 'atomic_numbers': tensor([8, 6, 1, 6, 1, 1, 1]), 'num_nodes': 7, 'pos': tensor([[ 1.2181,  0.3612,  0.0000],
E               [ 0.0000,  0.4641,  0.0000],
E               [-0.4772,  1.4653,  0.0000],
E               [-0.9481, -0.7001,  0.0000],
E               [-0.3859, -1.6342,  0.0000],
E               [-1.5963, -0.6525,  0.8809],
E               [-1.5963, -0.6525, -0.8809]]), 'edge_cell_shift': tensor([[0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.],
E               [0., 0., 0.]]), 'edge_index': tensor([[0, 1, 1, 1, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],
E               [1, 3, 0, 2, 1, 5, 6, 4, 1, 3, 5, 6, 6, 4, 3, 5, 3, 4]])}
E       Declaration: with_edge_vectors(Dict(str, Tensor) data, bool with_lengths=True) -> (Dict(str, Tensor))
E       Cast error details: Unable to cast Python instance to C++ type (compile in debug mode for details)

nequip/data/AtomicData.py:253: RuntimeError

from nequip.

nw13slx avatar nw13slx commented on June 14, 2024

following the previous set up, another error will show up at tests/data/test_AtomicData.py::test_without_nodes

====================================================== FAILURES ======================================================
____________________________________________ test_without_nodes[float32] _____________________________________________

CH3CHO = (Atoms(symbols='OCHCH3', pbc=False), AtomicData(edge_index=[2, 18], pos=[7, 3], num_nodes=7, atomic_numbers=[7], cell=[3, 3], edge_cell_shift=[18, 3], pbc=[3]))

    def test_without_nodes(CH3CHO):
        # Non-periodic
        atoms, data = CH3CHO
        which_nodes = [0, 5, 6]
>       new_data = data.without_nodes(which_nodes=which_nodes)

tests/data/test_AtomicData.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = AtomicData(edge_index=[2, 18], pos=[7, 3], num_nodes=7, atomic_numbers=[7], cell=[3, 3], edge_cell_shift=[18, 3], pbc=[3])
which_nodes = tensor([0, 5, 6])

    def without_nodes(self, which_nodes):
        """Return a copy of ``self`` with ``which_nodes`` removed.
        The returned object may share references to some underlying data tensors with ``self``.
        Args:
            which_nodes (index tensor or boolean mask)
        Returns:
            A new data object.
        """
        which_nodes = torch.as_tensor(which_nodes)
        if which_nodes.dtype == torch.bool:
            mask = ~which_nodes
        else:
            mask = torch.ones(self.num_nodes, dtype=torch.bool)
            mask[which_nodes] = False
        assert mask.shape == (self.num_nodes,)
        n_keeping = mask.sum()
    
        # Only keep edges where both from and to are kept
        edge_mask = mask[self.edge_index[0]] & mask[self.edge_index[1]]
        # Create an index mapping:
        new_index = torch.full((self.num_nodes,), -1, dtype=torch.long)
        new_index[mask] = torch.arange(n_keeping, dtype=torch.long)
    
        new_dict = {}
        for k in self.keys:
            if k == AtomicDataDict.EDGE_INDEX_KEY:
                new_dict[AtomicDataDict.EDGE_INDEX_KEY] = new_index[
                    self.edge_index[:, edge_mask]
                ]
            elif k == AtomicDataDict.EDGE_CELL_SHIFT_KEY:
                new_dict[AtomicDataDict.EDGE_CELL_SHIFT_KEY] = self.edge_cell_shift[
                    edge_mask
                ]
            elif k == AtomicDataDict.CELL_KEY:
                new_dict[k] = self[k]
            else:
>               if len(self[k]) == self.num_nodes:
E               TypeError: object of type 'int' has no len()

nequip/data/AtomicData.py:325: TypeError

from nequip.

Linux-cpp-lisp avatar Linux-cpp-lisp commented on June 14, 2024

op_einsum_fx issues are resolved

from nequip.

Linux-cpp-lisp avatar Linux-cpp-lisp commented on June 14, 2024

Other fixes merged

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.