AI4Finance-Foundation / RLSolver

Solvers for NP-hard and NP-complete problems with an emphasis on high-performance GPU computing.

Home Page:https://ai4finance.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

One question

spicywei opened this issue · comments

Implementing updates to the Start-End matrix is ineffective, and forcing changes can't even be changed, which is the current problem with Ring.
image
088e42a3f91e10f540e0a467e2fe6be

Good choice! The updates to start and end are likely to cause this problem.

In our setting, the merged tensor is represented by a list of consecutive tensors. The index of the leftmost tensor is recorded in start. The index of the rightmost tensor is recorded in 'end'.

  • Consider the following case, tensor 0 and tensor 1 are contracted. After the contraction, tensor 0 and tensor 1 are merged into a new tensor $0 \rightarrow 1$. To record which tensors are merged, we record the leftmost tensor, tensor 0, in the start, and record the rightmost tensor, tensor 1, in the end.

  • Next, we consider the contraction between tensor 3 and tensor 0 in the tensor ring. The merged tensor is $3\rightarrow 0$, not $0\rightarrow 1\rightarrow 2\rightarrow 3$. Hence, tensor 3 is the leftmost tensor, and tensor 0 is the rightmost tensor.

Thanks for your advice @shixun404 ! Your consideration is indeed a very important point. After many tests, we found that our Start-End update can avoid this situation.
At the same time, thanks to Jie’s help @zhangjie119 , we finally found the cause of the problem through multiple printings and breakpoints. We originally wanted to define the variable s1 = self.start[k, selected_edge_id], but found that the file will treat s1 as a pointer in actual use. Cause a series of update errors, solved by s1 = 0+self.start[k, selected_edge_id]. Haha, this problem is really hard to find.

Congrats! I really appreciate your contribution! @spicywei