class_docstr: Gradient Communication Quantization (GCQ) in multi-machine distributed training.
  
  It quantizes gradients to int8 locally before gradients communicate between machines.
  When the gradient communication is done, it dequantizes the int8 gradients to original dtype (default: fp16) locally.
  
  Note: When training on multiple machines, it can accelerate significantly, as multi-machine communication is the bottleneck.
  However, it is even slower when training on single machine.
  Please choose if GCQ should be on according to your training environment.
class_docstr_tok: ["Gradient","Communication","Quantization","(","GCQ",")","in","multi-machine","distributed","training",".","It","quantizes","gradients","to","int8","locally","before","gradients","communicate","between","machines",".","When","the","gradient","communication","is","done",",","it","dequantizes","the","int8","gradients","to","original","dtype","(","default",":","fp16",")","locally",".","Note",":","When","training","on","multiple","machines",",","it","can","accelerate","significantly",",","as","multi-machine","communication","is","the","bottleneck",".","However",",","it","is","even","slower","when","training","on","single","machine",".","Please","choose","if","GCQ","should","be","on","according","to","your","training","environment","."]
docstr: Dequantize the all_reduced int8 gradients to original dtype (default: fp16) locally.
docstr_tok: ["Dequantize","the","all_reduced","int8","gradients","to","original","dtype","(","default",":","fp16",")","locally","."]
code: def decode_bucket(self):
      """
      Dequantize the all_reduced int8 gradients to original dtype (default: fp16) locally.
      """
      decompressed_gradient = self.bucket.buffer()
      # Use original bucket to reduce memory consumption.
      decompressed_gradient.copy_(
          (self.encoded_gradient.to(torch.float16) * self.scale).view(
              -1
          )[: self.bucket_size]
      )
      return decompressed_gradient
  
file_path: lightseq/lightseq/training/gcq/gcq.py
imports: import math
  import torch
  import torch.distributed
label_desc: Use image node_id 4 for calling the GCQ obj's underlying member method code with example usage: obj.decode_bucket() and returns: decompressed_gradient