code: def test_multiprocess_sparse_adam_state_dict(num_workers, backend):
      if (
          F.ctx().type == "cuda"
          and th.cuda.device_count() < num_workers
      ):
          pytest.skip("Not enough GPUs to run test.")
  
      num_embs = 128
      emb_dim = 10
      init_weight = th.rand((num_embs, emb_dim))
      mp.spawn(
          start_sparse_adam_state_dict_worker,
          (
              num_workers,
              init_weight,
              backend,
              num_embs,
              emb_dim,
          ),
          nprocs=num_workers,
      )
  
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 15 for calling a global function with example usage: test_multiprocess_sparse_adam_state_dict(num_workers, backend) without return types