docstr: move params to cuda
  
  Args:
      params (List[torch.nn.Parameter]): target params
  
  Raises:
      NotImplementedError: raise error when param has cpu grad
docstr_tok: ["move","params","to","cuda","Args",":","params","(","List","[","torch.nn.Parameter","]",")",":","target","params","Raises",":","NotImplementedError",":","raise","error","when","param","has","cpu","grad"]
code: def _allocate_params_on_cuda(self, params: List[torch.nn.Parameter]):
      """
      move params to cuda
  
      Args:
          params (List[torch.nn.Parameter]): target params
  
      Raises:
          NotImplementedError: raise error when param has cpu grad
      """
      for p in params:
          cur_dev = p.data.device.type
          if cur_dev == "cpu":
              if p.grad is not None and p.grad.device.type == "cpu":
                  raise NotImplementedError(
                      "Only run in forward propagation"
                  )
              p.data = torch.empty(
                  p.data.shape,
                  device="cuda",
                  dtype=p.data.dtype,
                  requires_grad=p.data.requires_grad,
              )
          elif cur_dev == "cuda":
              alloc_storage(p.data)
  
imports: from contextlib import contextmanager
  from enum import Enum
  from functools import partial
  from typing import List
  import torch
  from colossalai.legacy.zero.gemini.tensor_utils import alloc_storage, free_storage
  from colossalai.tensor.param_op_hook import ColoParamOpHook
  from colossalai.zero.gemini.memory_tracer import MemStats, SyncCudaMemoryMonitor
label_desc: Use image node_id 3 for calling the ParamMemTracerHook obj's underlying member method code with example usage: obj._allocate_params_on_cuda(params) without return types