ut-parla / parla-experimental

5 stars 0 forks source link

fix: fix bugs on changes of owner during eviction #109

Closed yinengy closed 1 year ago

yinengy commented 1 year ago

Solve two bugs reported by @nicelhc13

At GPU 0: state: SHARED
At GPU 1: state: INVALID
At GPU 2: state: INVALID
At GPU 3: state: INVALID
At CPU: state: SHARED

This was a state and I tried to call evict(0). But GPU 0 is considered as an owner, and no one was deallocated.

And

Let's assume that I have a PArray like below:

{0: array([[2, 3, 5, 6, 7],                                                          
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7]]), 1: None, 2: None, 3: None, -1: array([[2, 3, 5, 6, 7],     
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7]])} 

And I called

parray.evict(0);

My expectation:

{0: None, 1: None, 2: None, 3: None, -1: array([[2, 3, 5, 6, 7],     
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7]])}                                                            

But:

{0: array([[2, 3, 5, 6, 7],                                                          
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7]]), 1: None, 2: None, 3: None, -1: array([[2, 3, 5, 6, 7],     
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7],                                                              
       [2, 3, 5, 6, 7]])}                                                            

So the 0'th reference was not decreased.