For a while the numeric result of sum_product computations has been nondeterministic in very insignificant digits. Somehow Newton's method exacerbates this for parsing long strings: When length=50 for example, sometimes it takes a fraction of a minute to compute 2.6261177280410e-25 exactly, but sometimes torch_semiring_einsum.extend.adjust_size tries to repeat a tensor from size 103^4 to size 103^5 and fails to allocate the needed 90GB of memory. Even when the computation does finish, running times vary wildly.
Ah, replacing some Sets by Dict[,None]s seems to have restored determinism. It would still be nice for einsum planning to take tensor size into account though.
For a while the numeric result of
sum_product
computations has been nondeterministic in very insignificant digits. Somehow Newton's method exacerbates this for parsing long strings: When length=50 for example, sometimes it takes a fraction of a minute to compute 2.6261177280410e-25 exactly, but sometimestorch_semiring_einsum.extend.adjust_size
tries torepeat
a tensor from size 103^4 to size 103^5 and fails to allocate the needed 90GB of memory. Even when the computation does finish, running times vary wildly.