class_docstr: Quantization configs for the AllToAll and ReduceScatter communication modules used in sharding.
class_docstr_tok: ["Quantization","configs","for","the","AllToAll","and","ReduceScatter","communication","modules","used","in","sharding","."]
code: def __post_init__(self) -> None:
      if (
          self.forward_precision != CommType.FP8
          and self.backward_precision != CommType.FP8
          and (
              self.fp8_quantize_dim is not None
              or self.fp8_quantize_dim_bwd is not None
          )
      ):
          raise ValueError(
              f"fp8_quantize_dim is set to {self.fp8_quantize_dim} and fp8_quantize_dim_bwd is set to {self.fp8_quantize_dim_bwd} but no FP8 precision is found in forward or backward precisions"
          )
      if (
          self.backward_precision == CommType.FP8
          and self.fp8_quantize_dim_bwd is None
      ):
          self.fp8_quantize_dim_bwd = self.fp8_quantize_dim
          logger.warning(
              f"No override of FP8 bwd row dim, using general FP8 row dim for backward: {self.fp8_quantize_dim_bwd} "
          )
  
file_path: torchrec/torchrec/distributed/fbgemm_qcomm_codec.py
imports: import copy
  import logging
  from dataclasses import dataclass
  from enum import Enum, unique
  from typing import cast, Dict, List, Optional
  import torch
  from fbgemm_gpu.quantize_comm import QuantizationContext, QuantizedCommCodec
  from fbgemm_gpu.split_embedding_configs import SparseType
  from torchrec.distributed.types import CommOp, QuantizedCommCodec, QuantizedCommCodecs
label_desc: Use image node_id 1 for calling the QCommsConfig obj's underlying member method code with example usage: obj.__post_init__() without return types