code: def compute_max_nodes(emb_size, allocate_rate):
      """compute the max unique nodes"""
      total_gpu_memory_bytes = (
          paddle.device.cuda.get_device_properties().total_memory
      )
      allocate_memory_bytes = total_gpu_memory_bytes * allocate_rate
      max_unique_nodes = int(allocate_memory_bytes / (emb_size * 4 * 2))
      log.info(
          "max_gpu_memory: %s allocate_rate: %s max_uniq_nodes: %s"
          % (
              total_gpu_memory_bytes // (1024**3),
              allocate_rate,
              max_unique_nodes,
          )
      )
  
      return max_unique_nodes
  
imports: import os
  import time
  import threading
  import traceback
  import numpy
  import paddle
  from paddle.distributed import fleet
  import paddle.fluid
  from pgl.utils.logger import log
  import util
  import helper
  from place import get_cuda_places
  import models.model_util
label_desc: Use image node_id 1 for calling a global function with example usage: compute_max_nodes(emb_size, allocate_rate) and returns: max_unique_nodes