code: def test_multiprocess_sparse_adam_zero_step_cuda_tensor(num_workers):
      if (
          F.ctx().type == "cuda"
          and th.cuda.device_count() < num_workers
      ):
          pytest.skip("Not enough GPUs to run test.")
  
      backend = "nccl"
      worker_list = []
      num_embs = 128
      emb_dim = 10
      dgl_weight = th.empty((num_embs, emb_dim))
      ctx = mp.get_context("spawn")
      for i in range(num_workers):
          device = th.device(i)
          p = ctx.Process(
              target=start_sparse_adam_worker,
              args=(
                  i,
                  device,
                  num_workers,
                  dgl_weight,
                  device,
                  True,
                  backend,
              ),
          )
          p.start()
          worker_list.append(p)
      for p in worker_list:
          p.join()
  
      worker_list = []
      torch_weight = th.empty((num_embs, emb_dim))
      for i in range(num_workers):
          p = ctx.Process(
              target=start_torch_adam_worker,
              args=(i, num_workers, torch_weight, False),
          )
          p.start()
          worker_list.append(p)
      for p in worker_list:
          p.join()
  
      assert F.allclose(dgl_weight, torch_weight)
  
imports: import os
  import unittest
  import backend
  import pytest
  import torch
  import torch.multiprocessing
  from dgl.nn import NodeEmbedding
  from dgl.optim import SparseAdagrad, SparseAdam
label_desc: Use image node_id 13 for calling a global function with example usage: test_multiprocess_sparse_adam_zero_step_cuda_tensor(num_workers) without return types