Limit colocation group devices after a node is assigned
This change makes Placer's code less brittle. A quick recap of Placer: Placer first groups nodes into colocation groups. Each group is a set of nodes and a set of possible devices that can be used for the nodes in the group. The set of possible devices for a group is encoded in the root Member of the tree representing this group. All the nodes in a group must be assigned to the same device. Before this change, the "all nodes in a group must be assigned to the same device" property was ensured by a relying on specifics of GetDevicesForNode and Placer's heuristics. This change explicitly limits the possible set of devices to the single device that a node in the group was assigned to. All future calls to GetDevicesForNode will return just this device making it harder for a heuristic to choose another device. I did not find an easy way to test this change because there is no behavior change. My future changes include a test for this that utilizes multi-device function calls. PiperOrigin-RevId: 231628964
Loading
Please sign in to comment