code: def sd_quantize_megatron(self, sd, quantize_bits, groups):
      keys = sd.keys()
      for key in keys:
          value_list = [sd[key]]
          if (
              "attention.dense.weight" in key
              or "mlp.dense_4h_to_h.weight" in key
              or "mlp.dense_h_to_4h.weight" in key
              or "attention.query_key_value.weight" in key
          ):
              value_list = self.Quantize(
                  value_list, quantize_bits, groups, key=key
              )
          sd[key] = value_list[0]
  
      all_scales = self.merge_scales()
      return sd, all_scales
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/deepspeed/runtime/weight_quantizer.py
imports: import torch
  from ..module_inject.replace_policy import HFBertLayerPolicy, replace_policies
label_desc: Use image node_id 9 for calling the WeightQuantization obj's underlying member method code with example usage: obj.sd_quantize_megatron(sd, quantize_bits, groups) and returns: sd,  all_scales