huggingface/transformers
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
https://skillcdn.ai/gh/huggingface/transformersConnect this address to your AI to use these skills. How to connect
- Unverified
- Default branch
main - Commit
6259c23 - License
Apache-2.0 - Searchwords
Explore this repository
Searches the original text of skills and documents, and the translations of skills when you search in their language.
Documents
- AQLMAdditive Quantization of Language Models (AQLM) quantizes multiple weights together and takes advantage of interdependencies between them. AQLM represents groups of 8-16 weights as a sum of multiple…docs/source/en/quantization/aqlm.md
- AutoRoundAutoRound is an advanced quantization algorithm that delivers strong accuracy, even at 2-bit precision. It leverages sign gradient descent to fine-tune both rounding values and min-max clipping thres…docs/source/en/quantization/auto_round.md
- AWQActivation-aware Weight Quantization (AWQ) preserves a small fraction of the weights that are important for LLM performance to compress a model to 4-bits with minimal performance degradation.docs/source/en/quantization/awq.md
- BitNetBitNet replaces traditional linear layers in Multi-Head Attention and feed-forward networks with specialized BitLinear layers. The BitLinear layers quantize the weights using ternary precision (with…docs/source/en/quantization/bitnet.md
- BitsandbytesThe bitsandbytes library provides quantization tools for LLMs through a lightweight Python wrapper around hardware accelerator functions. It enables working with large models using limited computatio…docs/source/en/quantization/bitsandbytes.md
- Compile a modelQuantization saves memory, but dequantizing weights inside every matmul can make generation slower than in bf16. torch.compile fuses that work into optimized kernels and recovers much of the speed.docs/source/en/quantization/compile.md
- compressed-tensorscompressed-tensors extends safetensors files to compressed tensor data types to provide a unified checkpoint format for storing and loading various quantization formats such as dense, int-quantized (…docs/source/en/quantization/compressed_tensors.md
- Quantization conceptsA quantized number can only take one of a small set of values, 256 for int8 and 16 for int4, so every quantization method introduces rounding error. Methods differ in how they keep that error from hu…docs/source/en/quantization/concept_guide.md
- ContributeTransformers supports many quantization methods such as QLoRA, GPTQ, LLM.int8, and AWQ. However, there are still many more quantization approaches that haven't been integrated yet. To make adding and…docs/source/en/quantization/contribute.md
- Dequantize a modelDequantizing converts quantized weights back to a higher-precision dtype like bf16. Dequantize a model to fully fine-tune it, to run it on hardware the method's kernels don't support, or to convert i…docs/source/en/quantization/dequantize.md
- EETQEasy and Efficient Quantization for Transformers (EETQ) quantizes weights to int8 with one scale per output channel, and runs the matmul with int8 weights and 16-bit activations. Use it for 8-bit wei…docs/source/en/quantization/eetq.md
- FBGEMMFBGEMM (Facebook GEneral Matrix Multiplication) FP8 quantization stores weights in FP8 with one scale per output channel, and quantizes activations to FP8 with one scale per token at runtime (W8A8).…docs/source/en/quantization/fbgemm_fp8.md
- Fine-grained FP8Fine-grained FP8 stores weights in FP8 (E4M3) with one scale per 2D block of weights, 128x128 by default, and quantizes activations to FP8 at runtime with one scale per token for each 128-value group…docs/source/en/quantization/finegrained_fp8.md
- Fine-tune a modelQuantized weights can't be updated by gradients directly, so you fine-tune a quantized model by training a small adapter on top of the frozen quantized weights. Training a LoRA adapter on a 4-bit mod…docs/source/en/quantization/finetune.md
- Four Over SixFour Over Six is a variant of NVFP4 quantization that scales the largest value in each block of 16 FP4 values to either 4 or 6, picking whichever gives the lower quantization error. A scale of 6 uses…docs/source/en/quantization/fouroversix.md
- FP-QuantFP-Quant quantizes weights and activations to the MXFP4 or NVFP4 formats, applying a rotation (a Hadamard transform by default) before quantizing, and runs the matmuls with QuTLASS kernels on NVIDIA…docs/source/en/quantization/fp_quant.md
- GGUFGGUF is a single-file format used to store models for inference with GGML, containing the model metadata and tensors. It supports many quantized data types (refer to the quantization type table), whi…docs/source/en/quantization/gguf.md
- GPTQGPTQ quantizes a model one layer at a time and uses a small calibration dataset to update the remaining weights so they compensate for each layer's rounding error. Transformers runs GPTQ through Opti…docs/source/en/quantization/gptq.md
- HIGGSHIGGS applies a Hadamard transform to each weight matrix and then rounds groups of weights to a grid that minimizes the mean squared error, without calibration data. Use it for 2- to 4-bit weights on…docs/source/en/quantization/higgs.md
- HQQHalf-Quadratic Quantization (HQQ) optimizes its quantization parameters from the weights alone, so it doesn't need calibration data. Use it to quantize a model to as few as 1 or 2 bits while it loads.docs/source/en/quantization/hqq.md
- MetalMetal quantization packs weights into uint32 tensors with an affine scale and bias for each group, and runs a fused dequantize and matmul kernel on the Apple silicon GPU. The kernels come from MLX an…docs/source/en/quantization/metal.md
- MXFP4MXFP4 is the 4-bit floating-point format from the Open Compute Project Microscaling (MX) specification. It stores E2M1 values in blocks that share one power-of-two (E8M0) scale. In Transformers, MXFP…docs/source/en/quantization/mxfp4.md
- NVFP4NVFP4 is NVIDIA's 4-bit floating-point format. Each block of 16 weights shares an FP8 scale, and each tensor has an FP32 scale on top. Transformers quantizes the weights while the model loads and qua…docs/source/en/quantization/nvfp4.md
- OptimumOptimum is an optimization library that supports quantization for Intel, Furiosa, ONNX Runtime, GPTQ, and lower-level PyTorch quantization functions. It is designed to enhance performance for specifi…docs/source/en/quantization/optimum.md
- OverviewQuantization stores a model's weights, and sometimes its activations, in fewer bits so the model needs less memory. Models are usually loaded in bf16, which takes 2 bytes per parameter. An 8B model n…docs/source/en/quantization/overview.md
- QuantoQuanto is a PyTorch quantization library from Optimum. It replaces linear layers with quantized versions built on PyTorch, so it works on any device PyTorch supports and with any model that has torch…docs/source/en/quantization/quanto.md
- QuarkQuark is a deep learning quantization toolkit designed to be agnostic to specific data types, algorithms, and hardware. Different pre-processing strategies, algorithms and data-types can be combined…docs/source/en/quantization/quark.md
- Save and share a modelSaving a model after quantizing it while loading lets you, and anyone you share it with, skip the quantization step next time. Calibration methods like GPTQ benefit the most because calibration can t…docs/source/en/quantization/save.md
- Choose a methodIf your checkpoint is already quantized, the checkpoint decides the method. Load it as shown in Load a pre-quantized checkpoint. Otherwise, pick a method based on your hardware and what you need to d…docs/source/en/quantization/selecting.md
- SINQSinkhorn-Normalized Quantization (SINQ) balances the scale of each weight matrix's rows and columns before quantizing it, which reduces the error from outliers without calibration data. Use it as a c…docs/source/en/quantization/sinq.md
- Keep modules in full precisionSome modules lose more accuracy than others when quantized. Keeping them in their original precision costs a little memory and can recover much of the accuracy. This applies when you quantize a model…docs/source/en/quantization/skip_modules.md
- SpQRThe SpQR quantization algorithm involves a 16x16 tiled bi-level group 3-bit quantization structure with sparse outliers.docs/source/en/quantization/spqr.md
- torchaotorchao is a PyTorch architecture optimization library with support for custom high performance data types, quantization, and sparsity. It is composable with native PyTorch features such as torch.com…docs/source/en/quantization/torchao.md
- VPTQVector Post-Training Quantization (VPTQ) is a Post-Training Quantization (PTQ) method that leverages vector quantization to quantize LLMs at an extremely low bit-width (<2-bit). VPTQ can compress a 7…docs/source/en/quantization/vptq.md
Skipped (50)
These manifests were not served. Fix them and push: the next commit is indexed again.
README.mdlink_missinga link names no file of the repository (./contributing)docs/source/en/accelerate.mdlink_missing3 links name no file of the repository (./fsdp, ./deepspeed, ./ddp)docs/source/en/add_audio_processing_components.mdlink_missing3 links name no file of the repository (./modular_transformers, ./auto_docstring, ./feature_extractors)docs/source/en/add_new_model.mdlink_missing7 links name no file of the repository (./modular_transformers, ./philosophy, ./installation#editable-install, ...)docs/source/en/add_vision_processing_components.mdlink_missing4 links name no file of the repository (./modular_transformers, ./auto_docstring, ./image_processors, ...)docs/source/en/amd_gpu.mdlink_missing12 links name no file of the repository (./attention_interface, ./kernel_doc/loading_kernels, ./quantization/awq, ...)docs/source/en/apple_silicon.mdlink_missing10 links name no file of the repository (./attention_interface, ./model_doc/gpt_oss, ./quantization/gguf#attention, ...)docs/source/en/assisted_decoding.mdlink_missing2 links name no file of the repository (./perf_torch_compile, ./kv_cache#fixed-size-cache)docs/source/en/attention_interface.mdlink_missinga link names no file of the repository (./kernel_doc/loading_kernels#flashattention-fallback)docs/source/en/auto_docstring.mdlink_missinga link names no file of the repository (./modular_transformers)docs/source/en/aws_trainium.mdlink_missing4 links name no file of the repository (./kv_cache#keep-generation-tensors-on-cpu, ./tensor_parallelism, ./expert_parallelism, ...)docs/source/en/backbones.mdlink_missing4 links name no file of the repository (./main_classes/backbones, ./model_doc/auto, ./model_doc/resnet, ...)docs/source/en/chat_content_patterns.mdlink_missinga link names no file of the repository (./chat_extras)docs/source/en/chat_extras.mdlink_missing3 links name no file of the repository (./model_doc/cohere, ./model_doc/mixtral, ./chat_response_parsing)docs/source/en/chat_response_parsing.mdlink_missing2 links name no file of the repository (./chat_extras, ./chat_templating)docs/source/en/chat_templating.mdlink_missing3 links name no file of the repository (./conversations, ./model_doc/llama, ./tasks/language_modeling)docs/source/en/chat_templating_multimodal.mdlink_missing6 links name no file of the repository (./fast_tokenizers, ./processors, ./llm_tutorial#prompt-format, ...)docs/source/en/chat_templating_writing.mdlink_missing2 links name no file of the repository (./chat_extras, ./model_doc/cohere)docs/source/en/community.mdlink_missinga link names no file of the repository (glossary)docs/source/en/community_integrations/axolotl.mdlink_missing3 links name no file of the repository (./trl, ../main_classes/quantization, ../attention_interface)docs/source/en/community_integrations/candle.mdlink_missinga link names no file of the repository (../installation#cache-directory)docs/source/en/community_integrations/executorch.mdlink_missinga link names no file of the repository (../serialization#executorch)docs/source/en/community_integrations/nemo_automodel_finetuning.mdlink_missinga link names no file of the repository (./nemo_automodel_pretraining)docs/source/en/community_integrations/nemo_automodel_pretraining.mdlink_missinga link names no file of the repository (./nemo_automodel_finetuning)docs/source/en/community_integrations/sglang.mdlink_missinga link names no file of the repository (./transformers_as_backend#model-implementation)docs/source/en/community_integrations/torchtitan.mdlink_missinga link names no file of the repository (../perf_torch_compile)docs/source/en/community_integrations/transformers_as_backend.mdlink_missing3 links name no file of the repository (../add_new_model, ../custom_models, ../add_vision_processing_components)docs/source/en/continuous_batching.mdlink_missing8 links name no file of the repository (./serve-cli/serving_optims#continuous-batching, ./continuous_batching_architecture#memory-management, ./continuous_batching_architecture#chunked-prefill, ...)docs/source/en/continuous_batching_architecture.mdlink_missinga link names no file of the repository (./continuous_batching)docs/source/en/conversations.mdlink_missing12 links name no file of the repository (./installation, ./serve-cli/serving, ./model_doc/auto, ...)docs/source/en/cpu.mdlink_missinga link names no file of the repository (./ddp)docs/source/en/custom_models.mdlink_missing3 links name no file of the repository (./models#model-classes, ./model_doc/auto, ./models#custom-models)docs/source/en/custom_tokenizers.mdlink_missinga link names no file of the repository (./fast_tokenizers#backends)docs/source/en/data_collators.mdlink_missinga link names no file of the repository (./main_classes/data_collator)docs/source/en/ddp.mdlink_missing3 links name no file of the repository (./accelerate, ./fsdp, ./deepspeed)docs/source/en/deepspeed.mdlink_missing2 links name no file of the repository (./debugging#deepspeed-cuda, ./accelerate#accelerate-config-file)docs/source/en/deepspeed_alst.mdlink_missing3 links name no file of the repository (./accelerate#accelerate-config-file, ./fsdp#evaluate-with-context-parallelism, ./perf_train_gpu_many)docs/source/en/expert_parallelism.mdlink_missing2 links name no file of the repository (./perf_infer_gpu_multi, ./fsdp)docs/source/en/experts_interface.mdlink_missinga link names no file of the repository (./quantization/finegrained_fp8)docs/source/en/exporters.mdlink_missing2 links name no file of the repository (./exporters_quantization, ./exporters_extend)docs/source/en/exporters_quantization.mdlink_missing2 links name no file of the repository (./exporters, ./exporters#how-exportforgeneration-works)docs/source/en/fast_tokenizers.mdlink_missinga link names no file of the repository (./custom_tokenizers)docs/source/en/feature_extractors.mdlink_missing2 links name no file of the repository (./model_doc/auto, ./model_doc/whisper)docs/source/en/fsdp.mdlink_missing8 links name no file of the repository (./ddp, ./tensor_parallelism, ./expert_parallelism, ...)docs/source/en/fusion_mapping.mdlink_missing2 links name no file of the repository (./monkey_patching, ./weightconverter)docs/source/en/glossary.mdlink_missing9 links name no file of the repository (./model_doc/dpt, ./perf_train_gpu_many#dataparallel, ./training, ...)docs/source/en/google_tpu.mdlink_missing2 links name no file of the repository (./kv_cache#keep-generation-tensors-on-cpu, ./kernel_doc/loading_kernels)docs/source/en/grad_accumulation.mdlink_missing4 links name no file of the repository (./trainer_recipes#custom-loss-function, ./model_memory_anatomy, ./grad_checkpointing, ...)docs/source/en/grad_checkpointing.mdlink_missing4 links name no file of the repository (./grad_accumulation, ./model_memory_anatomy, ./mixed_precision_training, ...)docs/source/en/hardware.mdlink_missing8 links name no file of the repository (./cpu, ./nvidia_gpu, ./amd_gpu, ...)