@@ -759,7 +759,7 @@ def _consolidate_reservations(self) -> None:
759759 found = False
760760 for n in new_nodes [::- 1 ]:
761761 if isinstance (n , Reservation ) and n .resource == node .resource :
762- n .purposes .extend (node .purposes )
762+ n .purposes .extend (n2 for n2 in node . purposes if n2 not in n .purposes )
763763 found = True
764764 break
765765 if isinstance (n , Loop ):
@@ -797,10 +797,10 @@ def _elevate_tensor_holders_above_splits(self) -> None:
797797 new_nodes .append (node )
798798 self .nodes = EvalableList (new_nodes )
799799
800- def _propagate_reservations_between_splits (self ) -> None :
800+ def _propagate_backing_reservations_between_splits (self ) -> None :
801801 for node in self .nodes :
802802 if isinstance (node , MappingNodeWithChildren ):
803- node ._propagate_reservations_between_splits ()
803+ node ._propagate_backing_reservations_between_splits ()
804804
805805 if not isinstance (self , Split ):
806806 return
@@ -811,6 +811,9 @@ def _propagate_reservations_between_splits(self) -> None:
811811 reservations1 = node1 .get_nodes_of_type (Reservation )
812812 reservations2 = node2 .get_nodes_of_type (Reservation )
813813
814+ reservations1 = [r for r in reservations1 if r ._backing ]
815+ reservations2 = [r for r in reservations2 if r ._backing ]
816+
814817 shared_reservations = []
815818 for reservation1 in reservations1 :
816819 for reservation2 in reservations2 :
@@ -1700,11 +1703,11 @@ def einsum_names(pmapping: Nested) -> str:
17001703 mapping : Mapping = cls (nodes = pmappings [0 ].nodes )
17011704 mapping ._elevate_persistent_nodes_above_splits ()
17021705 mapping ._elevate_tensor_holders_above_splits ()
1703- mapping ._propagate_reservations_between_splits ()
1706+ mapping ._propagate_backing_reservations_between_splits ()
17041707 mapping ._consolidate_tensor_holders ()
17051708 mapping ._consolidate_reservations ()
17061709 mapping ._move_tensor_holders_above_reservations ()
1707- mapping ._remove_reservations_for_tolls ()
1710+ # mapping._remove_reservations_for_tolls()
17081711 return mapping
17091712
17101713 # import mermaid as md
0 commit comments