Closed migalkin closed 2 years ago
On the current master and with
torch 1.11.0+cu113
the code runs through - though even there, the signature seems to be mat, mat1, mat2
:sweat_smile:
i've never set this up before but can we get the unit tests to run on multiple versions of pytorch?
I am not sure whether I want to support multiple version though, in particular as the sparse API is currently (1.11) declared beta :sweat_smile:
okay up to you
@migalkin , for the first problem: If you do not provide a starting value yourself, it will initialize to https://github.com/mberr/torch-ppr/blob/921898f1a4b7770e6cdd1931e935262e456eb3c9/src/torch_ppr/utils.py#L260 which should sum up to 1. So I guess this is a numerical problem here.
I played around with it, and the the error seemed to occur when there is large number of non-zero entries in one column. This is intuitive, since the more values we sum, the more error can accumulate.
In natural graphs with hub nodes, this can occur.
Suddenly, everything stopped working š± presumably because of the changes to torch.sparse. Particularly, I am on PyTorch 1.10, master branch of PyKEEN and torch-ppr 0.0.5.
Problem 1: the
allclose()
check does not pass now: https://github.com/mberr/torch-ppr/blob/921898f1a4b7770e6cdd1931e935262e456eb3c9/src/torch_ppr/utils.py#L221-L222MWE:
Looking into the debugger:
adj_sum
does sum up to the number of nodesrtol=1e-4
oratol=1e-4
- the check passesProblem 2: the signature of
torch.sparse.addmm
has changed from the one used inpower_iteration
so the API call fails with the unknown kwarg error.https://github.com/mberr/torch-ppr/blob/921898f1a4b7770e6cdd1931e935262e456eb3c9/src/torch_ppr/utils.py#L310
In fact, I can't find where those kwargs
input, sparse, dense
come from because the current signature has less readablemat, mat1, mat2
. I traced to the very Torch 1.3.0 and still can't find where those originated from. Where does this signature come from? šMy test env