Shortcuts

Int4WeightOnlyQATEmbedding

class torchao.quantization.qat.embedding.Int4WeightOnlyQATEmbedding(num_embeddings: int, embedding_dim: int, padding_idx: Optional[int] = None, max_norm: Optional[float] = None, norm_type: float = 2.0, scale_grad_by_freq: bool = False, sparse: bool = False, group_size: int = 32, scale_precision: dtype = torch.float32, zero_point_precision: dtype = torch.int32, *args, **kwargs)[source]

This module implements a embedding layer with int4 fake quantized grouped per channel weights.

Parameters:
  • group_size – the number of elements in each quantized group for weights

  • scale_precision – precision of per group scales

  • zero_point_precision – precision of per group zero points

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources