### DeepSpeed Client Entry Example Source: https://www.deepspeed.ai/getting-started/ Example of a client entry point script and arguments used with DeepSpeed. ```python --deepspeed --deepspeed_config ds_config.json ``` -------------------------------- ### Install Diffusers Library Source: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion Clones the diffusers repository and installs it locally. This is the first step to start using the diffusers library. ```shell git clone https://github.com/huggingface/diffusers cd diffusers pip install . ``` -------------------------------- ### Install Dependencies Source: https://github.com/huggingface/accelerate/tree/main/examples Installs the required libraries for running the NLP example script: datasets, evaluate, and transformers. ```shell pip install datasets evaluate transformers ``` -------------------------------- ### DeepSpeed Configuration JSON Example Source: https://www.deepspeed.ai/getting-started/ A sample JSON configuration file for DeepSpeed, specifying training batch size, gradient accumulation, optimizer settings, FP16 enablement, and Zero Optimization. ```json { "train_batch_size": 8, "gradient_accumulation_steps": 1, "optimizer": { "type": "Adam", "params": { "lr": 0.00015 } }, "fp16": { "enabled": true }, "zero_optimization": true } ``` -------------------------------- ### Install Dependencies for Vision Example Source: https://github.com/huggingface/accelerate/tree/main/examples Installs the 'timm' and 'torchvision' libraries required for the computer vision example using Accelerate. ```shell pip install timm torchvision ``` -------------------------------- ### Dreambooth Example Setup Source: https://github.com/huggingface/diffusers/tree/main/examples/dreambooth Configuration details for the Dreambooth example, including tab size preferences for code display. ```APIDOC :root { --tab-size-preference: 4; } pre, code { tab-size: var(--tab-size-preference); } ``` -------------------------------- ### DeepSpeed Tutorials Overview Source: https://www.deepspeed.ai/getting-started/ A list of DeepSpeed tutorials covering various aspects of LLM training and optimization, including getting started, accelerator abstraction, automatic tensor parallelism, autotuning, fine-tuning, pre-training, data efficiency, inference, and specific optimization techniques like ZeRO. ```APIDOC Tutorials: getting_started: General getting started guide azure_getting_started: Getting started on Azure accelerator_abstraction_interface: Accelerator abstraction interface accelerator_setup_guide: Accelerator setup guides automatic_tensor_parallelism: Automatic tensor parallelism autotuning: Autotuning techniques bert_finetuning: BERT SQuAD fine-tuning bert_pretraining: BERT pre-training cifar_10: CIFAR-10 example curriculum_learning: Curriculum learning data_efficiency: Data efficiency techniques deepnvme: DeepNVMe usage domino: Domino integration ds4sci_evoformerattention: DS4Sci EvoformerAttention flops_profiler: FLOPs profiler usage pytorch_profiler: PyTorch profiler integration gan: GAN training inference_tutorial: Inference tutorial lrrt: Learning Rate Range Test megatron_gpt2: Megatron-LM GPT2 mixture_of_experts: Mixture-of-Experts (MoE) mixture_of_experts_nlg: MoE for NLG mixture_of_experts_inference: MoE inference model_compression: Model compression techniques MoQ_tutorial: Mixture-of-Quantization (MoQ) tutorial monitor: Monitoring module usage comms_logging: Communication logging one_cycle: One-Cycle schedule onebit_adam: One-Bit Adam optimizer zero_one_adam: Zero-One Adam optimizer onebit_lamb: One-Bit LAMB optimizer pipeline: Pipeline parallelism progressive_layer_dropping: Progressive layer dropping sparse_attention: Sparse attention techniques transformer_kernel: Transformer kernel optimizations ulysses_alst_sequence_parallelism: ALST for HF Transformers integration zero_offload: ZeRO-Offload zero: ZeRO optimizations zeropp: ZeRO++ optimizations ``` -------------------------------- ### Accelerate Launch Example Source: https://context7_llms Example of how to use the 'accelerate launch' command to start a distributed training script. ```bash accelerate launch my_training_script.py --num_processes 4 --mixed_precision fp16 ``` -------------------------------- ### Install Diffusers and Dependencies Source: https://github.com/huggingface/diffusers/tree/main/examples/dreambooth Clones the diffusers repository, installs it in editable mode, and then installs the requirements for the dreambooth example. ```shell git clone https://github.com/huggingface/diffusers cd diffusers pip install -e . cd examples/dreambooth pip install -r requirements.txt ``` -------------------------------- ### Install Accelerate Dependencies Source: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion Installs the necessary dependencies for running Hugging Face Accelerate example scripts. It's recommended to install from source for the latest updates and to ensure compatibility with example scripts. ```shell git clone https://github.com/huggingface/accelerate cd accelerate pip install -e . ``` -------------------------------- ### Install Dependencies for NLP Examples Source: https://github.com/huggingface/notebooks/blob/main/examples/accelerate_examples/simple_nlp_example.ipynb Installs necessary Python packages for NLP tasks, including datasets, transformers, evaluate, and cloud-tpu-client. This is a prerequisite for running many of the provided examples. ```shell ! pip install datasets transformers evaluate ! pip install cloud-tpu-client ``` -------------------------------- ### Install Requirements and Configure Accelerate Source: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion Installs project dependencies using requirements.txt and configures the 🤗 Accelerate environment for distributed training. ```shell pip install -r requirements.txt accelerate config ``` -------------------------------- ### Install Dependencies for DreamBooth Training Source: https://github.com/huggingface/diffusers/tree/main/examples/dreambooth This section details how to install the necessary dependencies to run the DreamBooth training scripts locally using PyTorch. Ensure you have a compatible Python environment and PyTorch installed. ```bash pip install -r requirements.txt ``` -------------------------------- ### Example FSDP Configuration Source: https://context7_llms An example of a configuration file generated by `accelerate config` for a local machine setup with FSDP enabled. ```yaml compute_environment: LOCAL_MACHINE debug: false distributed_type: FSDP downcast_bf16: 'no' fsdp_config: fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP fsdp_backward_prefetch_policy: BACKWARD_PRE fsdp_forward_prefetch: false fsdp_cpu_ram_efficient_loading: true fsdp_offload_params: false fsdp_sharding_strategy: FULL_SHARD fsdp_state_dict_type: SHARDED_STATE_DICT fsdp_sync_module_states: true fsdp_transformer_layer_cls_to_wrap: BertLayer fsdp_use_orig_params: true machine_rank: 0 main_training_function: main mixed_precision: bf16 num_machines: 1 num_processes: 2 rdzv_backend: static same_network: true tpu_env: [] tpu_use_cluster: false tpu_use_sudo: false use_cpu: false ``` -------------------------------- ### Install Flax Training Dependencies Source: https://github.com/huggingface/diffusers/tree/main/examples/dreambooth Installs the required dependencies for Flax-based LLM training from a requirements file. Ensure you have the necessary environment set up before running this command. ```shell pip install -U -r requirements_flax.txt ``` -------------------------------- ### Install Flax Training Dependencies Source: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion Installs the necessary dependencies for training LLMs using Flax/JAX. This is a prerequisite for running the Flax training script. ```shell pip install -U -r requirements_flax.txt ``` -------------------------------- ### AI-Assisted Annotation (AIAA) Getting Started Source: https://docs.nvidia.com/clara/clara-train-sdk/pt/model.html A guide to getting started with AI-Assisted Annotation (AIAA), including installation, running AIAA with NATIVE (PyTorch) or TRITON, start options, and troubleshooting common issues like workspace and logs. ```APIDOC AI-Assisted Annotation (AIAA) Getting Started: - Quickstart guide: https://docs.nvidia.com/clara/clara-train-sdk/aiaa/quickstart.html - Installation: https://docs.nvidia.com/clara/clara-train-sdk/aiaa/quickstart.html#installation - Running AIAA: - NATIVE (PyTorch): https://docs.nvidia.com/clara/clara-train-sdk/aiaa/quickstart.html#native-pytorch - TRITON: https://docs.nvidia.com/clara/clara-train-sdk/aiaa/quickstart.html#triton - AIAA Start Options: https://docs.nvidia.com/clara/clara-train-sdk/aiaa/quickstart.html#aiaa-start-options - Troubleshooting: - Workspace: https://docs.nvidia.com/clara/clara-train-sdk/aiaa/quickstart.html#workspace - Logs: https://docs.nvidia.com/clara/clara-train-sdk/aiaa/quickstart.html#logs ``` -------------------------------- ### Intel® Extension for PyTorch* CPU Documentation Source: https://github.com/intel/intel-extension-for-pytorch Provides access to CPU-specific documentation, quick start guides, installation instructions, and LLM examples for Intel® Extension for PyTorch*. ```html
=0.6.5. Please refer to the [DeepSpeed Installation details](https://github.com/microsoft/DeepSpeed#installation) for more information. ``` -------------------------------- ### Launching Multi-Node Training from Jupyter with Accelerate Source: https://github.com/huggingface/notebooks/blob/main/examples/accelerate_examples/simple_cv_example.ipynb This notebook demonstrates how to launch distributed training for a computer vision example script (`cv_example.py`) from within a Jupyter Notebook environment using Accelerate's `notebook_launcher`. It covers environment configuration, data preparation, and the steps required to initiate distributed training. ```jupyter # Launching Multi-Node Training from a Jupyter Environment > Using the `notebook_launcher` to use Accelerate from inside a Jupyter Notebook ## General Overview This notebook covers how to run the `cv_example.py` script as a Jupyter Notebook and train it on a distributed system. It will also cover the few specific requirements needed for ensuring your environment is configured properly, your data has been prepared properly, and finally how to launch training. ``` -------------------------------- ### Installation Guide Source: https://github.com/huggingface/trl Instructions for installing the TRL library via pip. ```python pip install trl ```