Memory assignment in loadbalance partition

In loadbalance partition algorithm,

  • For checking if function fits into the single device it checks if all constants fit into device memory (comparing module_->getConstantsSize() to device memory)
  • For checking if node fits into any device it compares available memory device with sums of the memory size of all the inputs of that node (using getNodeMemUsage())
  • While updating memory of device if node fits, it consider memory of both placeholder and constants(in updateGraphMemInfoByAddingNode())

What’s the idea or intuition behind all three points?