Add NVIDIA Model Optimizer FP8 quantization recipe (single-GPU EC2) - #1156
Draft
mvinci12 wants to merge 1 commit into
Draft
Add NVIDIA Model Optimizer FP8 quantization recipe (single-GPU EC2)#1156mvinci12 wants to merge 1 commit into
mvinci12 wants to merge 1 commit into
Conversation
New test case at 3.test_cases/pytorch/model-optimizer/ demonstrating FP8 post-training quantization with NVIDIA Model Optimizer (ModelOpt) on a single GPU EC2 instance, served with vLLM. - terraform/: single g6e.xlarge (L40S) via SSM Session Manager (no SSH), DLAMI resolved from SSM Parameter Store, egress-only SG, IMDSv2, gp3 root volume - src/: pinned setup (nvidia-modelopt==0.44.0), FP8 PTQ via examples/llm_ptq hf_ptq.py (weights-only, cnn_dailymail calibration), vLLM smoke test - README: EC2-vs-EKS rationale, format-vs-GPU-arch matrix, walkthrough, reference results (15GB BF16 -> 8.2GB FP8), and known issues (FP8 KV-cache on Ada, repo/wheel version skew, gated default dataset) Tested: Terraform apply/SSM/nvidia-smi/destroy verified on g6e.xlarge in us-west-2; quantization + vLLM serving validated end-to-end (L40S).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Adds a new test case demonstrating NVIDIA Model Optimizer (ModelOpt) FP8 post-training quantization on a single GPU EC2 instance, served with vLLM. Unlike the distributed-training test cases, ModelOpt PTQ is a single-process, single-GPU workload, so the recipe provisions one instance with Terraform and connects via SSM Session Manager (no SSH).
Changes
3.test_cases/pytorch/model-optimizer/terraform/— singleg6e.xlarge(L40S) instance: SSM IAM role + instance profile, egress-only security group, GPU DLAMI resolved from SSM Parameter Store, gp3 root volume, IMDSv2 enforced. Connects via SSM Session Manager (no inbound SSH, no key pair).src/— pinnedsetup.sh(nvidia-modelopt==0.44.0),quantize_fp8.sh(FP8 PTQ viaexamples/llm_ptq/hf_ptq.py, weights-only,cnn_dailymailcalibration),smoke_test_vllm.py, pinnedrequirements.txt.README.md— EC2-vs-EKS rationale, format↔GPU-architecture matrix, full walkthrough, reference results, and known issues.Test Plan
Environment:
g6e.xlarge(1× NVIDIA L40S, 48 GB, Ada)Test commands:
Test Results
terraform init/validate/plan/apply/destroyall succeeded against a real account; AMI resolved toami-03ee6edb81d0951b9; SSM came online ~30 s after launch;nvidia-smireportedNVIDIA L40S, 46068 MiB, 595.71.05.terraform destroyremoved all 5 resources with zero left billable.0.44.0installed in ~90 s; FP8 PTQ ofQwen/Qwen2.5-7B-Instruct(weights-only,cnn_dailymail) calibrated + exported in ~45 s; peak GPU memory ~16.5 GB.0.23.0loaded the checkpoint (CutlassFP8ScaledMMLinearKernel) and produced coherent output:What is the capital of France?→The capital of France is Paris.Documented known issue surfaced during testing: FP8 KV-cache produces garbled output on Ada (L40S) → recipe defaults to weights-only (
--kv_cache_qformat none).Directory Structure
Checklist
mainbranch.latest).Draft: opening for early review. The EC2 path is live-tested; the EKS/HyperPod graduation path is documented but intentionally out of scope for this PR.