code: def quantization_test_helper(
      pre_quant_type: torch.dtype, num_bits: int
  ):
      reset_random()
      num_group = 1024 * 32
      group_size = 64
      quantization_config = {
          "num_bits": num_bits,
          "group_size": group_size,
          "group_dim": 1,
          "symmetric": False,
      }
  
      quantizer = Quantizer(config=quantization_config)
      dequantizer = DeQuantizer(
          config=quantization_config, dtype=pre_quant_type
      )
  
      data = torch.randn(
          num_group, group_size, dtype=pre_quant_type, device=device
      )
  
      quantized_data, scale_buf, min_vals = quantizer.quantize(data)
      dequantized_data = dequantizer.dequantize(
          quantized_data, scale_buf, min_vals
      )
  
      max_diff = torch.max(torch.abs(data - dequantized_data))
      mean_diff = torch.mean(torch.abs(data - dequantized_data))
  
      # This threshold value is emperically selected.
      assert (
          mean_diff < 0.15 and max_diff < 0.5
      ), f"Numeric error exceed threshold, mean diff {mean_diff} (threshold 0.15), max diff {max_diff} (threshold 0.5)"
  
imports: import numpy
  import torch
  import torch.nn
  from unit.common import DistributedTest
  from deepspeed.accelerator import get_accelerator
  from deepspeed.inference.quantization.quantization import _init_group_wise_weight_quantization
  from deepspeed.inference.quantization.utils import Quantizer, DeQuantizer
  from deepspeed.inference.quantization.layers import QuantizedLinear
  from deepspeed.runtime.utils import required_torch_version
  from transformers.models.opt.modeling_opt import OPTDecoderLayer
  from transformers import AutoConfig, OPTConfig, AutoModel
  import pytest
  from collections import OrderedDict
  from typing import Dict
label_desc: Use image node_id 2 for calling a global function with example usage: quantization_test_helper(pre_quant_type, num_bits) without return types