diff --git a/examples/deepseek/README.md b/examples/deepseek/README.md index 33848ed06aa..ccab5a09ef0 100644 --- a/examples/deepseek/README.md +++ b/examples/deepseek/README.md @@ -26,7 +26,7 @@ export HF_FP4_PATH={path_to_save_the_final_FP4_checkpoint} ### DeepSeek V3 R1 V3.1 ```bash -# download the FP8 checkpoint from Hugginface. This is an example of DeepSeek-R1 +# download the FP8 checkpoint from Hugging Face. This is an example of DeepSeek-R1 huggingface-cli download deepseek-ai/DeepSeek-R1 --local-dir $HF_FP8_CKPT # clone DeepSeek-V3 (base model of R1) Github repository for FP8 inference, @@ -36,7 +36,7 @@ git clone https://github.com/deepseek-ai/DeepSeek-V3.git && cd DeepSeek-V3 && gi ### [Experimental] DeepSeek V3.2 ```bash -# download the FP8 checkpoint from Hugginface. +# download the FP8 checkpoint from Hugging Face. huggingface-cli download deepseek-ai/DeepSeek-V3.2-Exp --local-dir $HF_FP8_CKPT # clone DeepSeek-V3.2 Github repository for FP8 inference, diff --git a/examples/diffusers/README.md b/examples/diffusers/README.md index 364aa0754ef..30402163092 100644 --- a/examples/diffusers/README.md +++ b/examples/diffusers/README.md @@ -16,7 +16,7 @@ Cache Diffusion is a technique that reuses cached outputs from previous diffusio | :------------: | :------------: | :------------: | :------------: | | Pre-Requisites | Required & optional packages to use this technique | \[[Link](#pre-requisites)\] | | | Getting Started | Learn how to optimize your models using quantization/cache diffusion to reduce precision and improve inference efficiency | \[[Link](#getting-started)\] | \[[docs](https://nvidia.github.io/Model-Optimizer/guides/1_quantization.html)\] | -| Support Matrix | View the support matrix to see quantization/cahce diffusion compatibility and feature availability across different models | \[[Link](#support-matrix)\] | \[[docs](https://nvidia.github.io/Model-Optimizer/guides/1_quantization.html)\] | +| Support Matrix | View the support matrix to see quantization/cache diffusion compatibility and feature availability across different models | \[[Link](#support-matrix)\] | \[[docs](https://nvidia.github.io/Model-Optimizer/guides/1_quantization.html)\] | | Sparse Attention (Skip-Softmax) | Skip-softmax sparse attention for diffusion models | \[[Link](#sparse-attention-skip-softmax)\] | | | Cache Diffusion | Caching technique to accelerate inference without compromising quality | \[[Link](#cache-diffusion)\] | | | Post Training Quantization (PTQ) | Example scripts on how to run PTQ on diffusion models | \[[Link](#post-training-quantization-ptq)\] | \[[docs](https://nvidia.github.io/Model-Optimizer/guides/1_quantization.html)\] | @@ -97,7 +97,7 @@ We support calibration for INT8, FP8 and FP4 precision and for both weights and We also provide instructions on deploying and running E2E diffusion pipelines with Model Optimizer quantized INT8 and FP8 Backbone to generate images and measure latency on target GPUs. Note, Jetson devices are not supported at this time due to the incompatibility of the software. > [!NOTE] -> Model calibration requires relatively more GPU computing power then deployment. It does not need to be on the same GPUs as the deployment target GPUs. Deprecated ONNX export and TensorRT engine instructions remain available in [`quantization/ONNX-TRT-Deployment.md`](./quantization/ONNX-TRT-Deployment.md). +> Model calibration requires relatively more GPU computing power than deployment. It does not need to be on the same GPUs as the deployment target GPUs. Deprecated ONNX export and TensorRT engine instructions remain available in [`quantization/ONNX-TRT-Deployment.md`](./quantization/ONNX-TRT-Deployment.md). ### Quantize scripts diff --git a/examples/llm_distill/README.md b/examples/llm_distill/README.md index 834ec15ada9..08f800a62bb 100644 --- a/examples/llm_distill/README.md +++ b/examples/llm_distill/README.md @@ -11,7 +11,7 @@ This section focuses on demonstrating how to apply Model Optimizer to perform kn | **Section** | **Description** | **Link** | **Docs** | | :------------: | :------------: | :------------: | :------------: | | Pre-Requisites | Required & optional packages to use this technique | \[[Link](#pre-requisites)\] | | -| Getting Started | Learn how to optimize your models using distillation to produce more intellegant smaller models | \[[Link](#getting-started)\] | \[[docs](https://nvidia.github.io/Model-Optimizer/guides/4_distillation.html)\] | +| Getting Started | Learn how to optimize your models using distillation to produce more intelligent smaller models | \[[Link](#getting-started)\] | \[[docs](https://nvidia.github.io/Model-Optimizer/guides/4_distillation.html)\] | | Support Matrix | View the support matrix to see compatibility and feature availability across different models | \[[Link](#support-matrix)\] | | | Distillation with Megatron-Bridge | Learn how to distill your models with Megatron-Bridge Framework | \[[Link](#knowledge-distillation-kd-in-nvidia-megatron-bridge-framework)\] | \[[docs](https://nvidia.github.io/Model-Optimizer/guides/4_distillation.html)\] | | Distillation with Megatron-LM | Learn how to distill your models with Megatron-LM Framework | \[[Link](#knowledge-distillation-kd-in-nvidia-megatron-lm-framework)\] | | diff --git a/examples/llm_qat/notebooks/QAT_QAD_Walkthrough.ipynb b/examples/llm_qat/notebooks/QAT_QAD_Walkthrough.ipynb index 6e65d2dcc9b..a9e486b39f6 100644 --- a/examples/llm_qat/notebooks/QAT_QAD_Walkthrough.ipynb +++ b/examples/llm_qat/notebooks/QAT_QAD_Walkthrough.ipynb @@ -23,7 +23,7 @@ "id": "c3f7f931-ac38-494e-aea8-ca2cd6d05794", "metadata": {}, "source": [ - "## Installing Prerequisites and Dependancies" + "## Installing Prerequisites and Dependencies" ] }, { @@ -31,14 +31,14 @@ "id": "d7d4f25f-e569-42cf-8022-bb7cc6f9ea6e", "metadata": {}, "source": [ - "If you haven't already, install the required dependencies for this notebook. Key dependancies include:\n", + "If you haven't already, install the required dependencies for this notebook. Key dependencies include:\n", "\n", "- nvidia-modelopt\n", "- torch\n", "- transformers\n", "- jupyterlab\n", "\n", - "This repo contains a `examples/llm_qat/notebooks/requirements.txt` file that can be used to install all required dependancies." + "This repo contains a `examples/llm_qat/notebooks/requirements.txt` file that can be used to install all required dependencies." ] }, { @@ -398,7 +398,7 @@ "id": "e471ef6c-1346-4e5e-8782-5e9f2bc38f8a", "metadata": {}, "source": [ - "Once you have quantized the model you can now start the post-training process for QAT. The training process will calculate validation loss at 50 step intervals and save the model. These can be controled by adjusting the `eval_steps` and `output_dir` above along with other `training_args`." + "Once you have quantized the model you can now start the post-training process for QAT. The training process will calculate validation loss at 50 step intervals and save the model. These can be controlled by adjusting the `eval_steps` and `output_dir` above along with other `training_args`." ] }, { @@ -779,7 +779,7 @@ "id": "eca645fb-d8d2-4c98-9cb2-afbae7d30d6c", "metadata": {}, "source": [ - "## Stop the TensorRT-LLM Docker contrainer" + "## Stop the TensorRT-LLM Docker container" ] }, { diff --git a/examples/model_hub/README.md b/examples/model_hub/README.md index 2653503c56f..0f70f0dc629 100644 --- a/examples/model_hub/README.md +++ b/examples/model_hub/README.md @@ -1,6 +1,6 @@ # Deploy quantized models from Nvidia's Hugging Face model hub with TensorRT-LLM, vLLM, and SGLang -The provided bash scripts show an example to deploy and run the [quantized LLama 3.1 8B Instruct FP8 model](https://huggingface.co/nvidia/Llama-3.1-8B-Instruct-FP8) from Nvidia's Hugging Face model hub on TensorRT-LLM, vLLM and SGLang respectively. +The provided bash scripts show an example to deploy and run the [quantized Llama 3.1 8B Instruct FP8 model](https://huggingface.co/nvidia/Llama-3.1-8B-Instruct-FP8) from Nvidia's Hugging Face model hub on TensorRT-LLM, vLLM and SGLang respectively. Before running the bash scripts, please make sure you have setup the environment properly: diff --git a/examples/pruning/cifar_resnet.ipynb b/examples/pruning/cifar_resnet.ipynb index 84a7bde256f..a3fd850cac8 100644 --- a/examples/pruning/cifar_resnet.ipynb +++ b/examples/pruning/cifar_resnet.ipynb @@ -450,7 +450,7 @@ "source": [ "We have now established a baseline model and accuracy that we will be comparing with using Model Optimizer.\n", "\n", - "So far, we have seen a regular PyTorch model trained without anything new. Now, lets optimize the model for our target constraints using Model Optimizer!\n", + "So far, we have seen a regular PyTorch model trained without anything new. Now, let's optimize the model for our target constraints using Model Optimizer!\n", "\n", "## FastNAS Pruning with Model Optimizer\n", "\n", diff --git a/examples/specdec_bench/README.md b/examples/specdec_bench/README.md index 9a2d2c464df..f8e69d47416 100644 --- a/examples/specdec_bench/README.md +++ b/examples/specdec_bench/README.md @@ -2,7 +2,7 @@ ## Installation -This benchmark is meant to be a lightweight layer ontop of an existing vLLM/SGLang/TRTLLM installation. For example, no install +This benchmark is meant to be a lightweight layer on top of an existing vLLM/SGLang/TRTLLM installation. For example, no install is required if one is running in the following dockers: `vllm/vllm-openai:v0.11.0` (vLLM), `lmsysorg/sglang:v0.5.4.post2` (SGLang), or `nvcr.io/nvidia/tensorrt-llm/release:1.2.0` (TRT-LLM). diff --git a/examples/speculative_decoding/README.md b/examples/speculative_decoding/README.md index 786944ca9ef..01ebad28865 100644 --- a/examples/speculative_decoding/README.md +++ b/examples/speculative_decoding/README.md @@ -93,9 +93,9 @@ The saved modelopt checkpoint is similar in architecture to HF models. It can be For large models, you can export intermediate hidden states to disk and train only the draft model. This significantly reduces GPU memory requirements, but requires several to tens of terabytes of disk storage depending on dataset size. -### Dumpping Hidden States to Disk +### Dumping Hidden States to Disk -We support two backends for generating base model hidden states. For better effciency, it is recommended to use TRT-LLM: +We support two backends for generating base model hidden states. For better efficiency, it is recommended to use TRT-LLM: ```bash python collect_hidden_states/compute_hidden_states_trtllm.py \ @@ -256,7 +256,7 @@ Please refer to [TRT-LLM Doc: Speculative Decoding](https://nvidia.github.io/Ten Please refer to [VLLM Doc: Speculative Decoding](https://docs.vllm.ai/en/latest/features/spec_decode/) for detailed usage. -Optionally, you can convert the exported checkpoint to contain target model information, which is accepted by vLLM to simplify depployment: +Optionally, you can convert the exported checkpoint to contain target model information, which is accepted by vLLM to simplify deployment: ```bash python scripts/convert_to_vllm_ckpt.py --input --verifier --output diff --git a/examples/windows/onnx_ptq/genai_llm/README.md b/examples/windows/onnx_ptq/genai_llm/README.md index a03d4f94fb9..be64ad1f64b 100644 --- a/examples/windows/onnx_ptq/genai_llm/README.md +++ b/examples/windows/onnx_ptq/genai_llm/README.md @@ -128,7 +128,7 @@ The quantization strategy selects which layers to quantize to INT8 vs INT4: 1. **INT8 Layers** (Higher Precision): Important layers that significantly impact model quality. Quantized per-channel -2. **INT4 Layers** (Maximum Compression): All other layers. Qunatized blockwise. +2. **INT4 Layers** (Maximum Compression): All other layers. Quantized blockwise. This strategy preserves accuracy for the most sensitive layers while maintaining aggressive compression elsewhere. @@ -244,4 +244,4 @@ Refer to the following example scripts and tutorials for deployment: 1. **Error - Invalid Position-IDs input to the ONNX model** - The ONNX models produced using ONNX GenerativeAI (GenAI) have different IO bindings for models produced using different execution-providers (EPs). For instance, model built with DML EP has position-ids input in the ONNX model but models builts using CUDA EP or NvTensorRtRtx EP don't have position-ids inputs. So, if base model requires, use `--add_position_ids` command-line argument for enabling position_ids calibration input or set "add_position_ids" variable to `True` value (hard-code) in the quantize script if required. + The ONNX models produced using ONNX GenerativeAI (GenAI) have different IO bindings for models produced using different execution-providers (EPs). For instance, model built with DML EP has position-ids input in the ONNX model but models built using CUDA EP or NvTensorRtRtx EP don't have position-ids inputs. So, if base model requires, use `--add_position_ids` command-line argument for enabling position_ids calibration input or set "add_position_ids" variable to `True` value (hard-code) in the quantize script if required. diff --git a/examples/windows/onnx_ptq/sam2/README.md b/examples/windows/onnx_ptq/sam2/README.md index 8d9e5fed3eb..77ea8032072 100644 --- a/examples/windows/onnx_ptq/sam2/README.md +++ b/examples/windows/onnx_ptq/sam2/README.md @@ -1,6 +1,6 @@ # Scripts for ONNX SAM2 model -This repository contains an example to demontrate 8-bit quantization of SAM2 ONNX model. +This repository contains an example to demonstrate 8-bit quantization of SAM2 ONNX model. ## Table of Contents diff --git a/examples/windows/onnx_ptq/whisper/README.md b/examples/windows/onnx_ptq/whisper/README.md index 82ae7822001..4d257735adb 100644 --- a/examples/windows/onnx_ptq/whisper/README.md +++ b/examples/windows/onnx_ptq/whisper/README.md @@ -1,6 +1,6 @@ # Scripts for ONNX Whisper model -This repository contains an example to demontrate 8-bit quantization of Whisper ONNX model. +This repository contains an example to demonstrate 8-bit quantization of Whisper ONNX model. ## Table of Contents diff --git a/modelopt/torch/export/trtllm/layer_utils.py b/modelopt/torch/export/trtllm/layer_utils.py index 8f02ad7298f..006355f8e70 100755 --- a/modelopt/torch/export/trtllm/layer_utils.py +++ b/modelopt/torch/export/trtllm/layer_utils.py @@ -26,7 +26,7 @@ import torch.nn as nn try: from transformers.activations import ACT2FN except Exception: - warn("Cannot find transformers package. Hugginface modules cannot be exported.") + warn("Cannot find transformers package. Hugging Face modules cannot be exported.") from modelopt.torch.models import is_moe from modelopt.torch.utils import distributed as dist