Repository navigation
[OMNIML-6104] Enable DeepSeek-V4-Flash IQ2_XXS PTQ and mergeable LoRA QAD - #2896
Draft
hychiang-git wants to merge 1 commit into
Draft
hychiang-git wants to merge 1 commit into
hychiang-git wants to merge 1 commit into
Conversation
…LoRA QAD Add the Flash IQ2 PTQ/QAD recipe, native HF export and exact fake-quant/gradient support. Signed-off-by: Hung-Yueh Chiang <hungyuehc@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
This branch has not been deployed
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.
What does this PR do?
Type of change: New feature, new example, bug fix, new tests.
Enable the standard Megatron-Bridge PTQ → mergeable LoRA QAD → HF export workflow for DeepSeek-V4-Flash-0731 routed experts. Bridge imports the official MXFP4/FP8 checkpoint as floating-point training tensors; importance-weighted IQ2_XXS GPTQ calibrates the experts, and
distill.pytrains the adapters against a frozen online teacher.Stacked draft: based on #2539 (
kmorabia/mbridge-glm53-flash) to reuse its shared mHC exporter helpers. Retarget tomainafter that dependency merges. The PR adds no custom training driver.Usage
See
modelopt_recipes/models/deepseek-ai/DeepSeek-V4-Flash-0731/README.mdfor the three commands and input preparation requirements.The initial V4 export path supports a main-only HF view (MTP excluded), TP1/PP1 and SequentialMLP with expert parallelism. Omit
--compresswhen creating the Megatron training checkpoint. Train only routed-expert rank-8/alpha-16 adapters; export packed IQ2 or a separate folded BF16 HF copy.Testing
This PR branch: 131 focused CPU tests pass across Flash/GLM recipes, V4 export, GGML codecs/GPTQ and mergeable LoRA. Includes the final fused gate/up and FP32 mHC regressions ported into the normal test suite. New distillation CLI coverage and HybridStack GPU tests are included but were not executed on this CPU-only machine.
Recorded full-model v02 validation: two nodes × four GB300 GPUs; TP1/EP8/PP1/CP1, SequentialMLP. The run used the earlier ModelOpt base
f1d68fd4dd50plus #2539 at6d6b91752677and these Flash changes, with the Bridge/Core dependency fixes below.Output parity uses one calibration-derived 32-token input. These are integration checks, not held-out quality or production-training measurements. The rebased branch has not repeated the full-model GPU run, and optimized packed-IQ2 serving is not covered.
Ruff passes with the exporter's six existing
PLR0917findings excluded; the same six findings are reproduced on the unchanged #2539 base. Formatting, mypy, recipe validation, Bandit, license, RST, whitespace and file-size checks pass. Markdownlint 0.18.1 passes directly; its pre-commit installer is blocked by the local npm git-package restriction.Before your PR is "Ready for review"
Make sure you read and follow Contributor guidelines and your commits are signed (
git commit -s -S).Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded
trust_remote_code=True,torch.load(..., weights_only=False),pickle, etc.).CONTRIBUTING.md: ✅ / ❌ / N/AAdditional Information
Dependency pins for the recorded GPU run:
5a876442eba8433336c1491d49a6261a0b20749d, plus a data-iterator setup fix preserving restored RNG.6e7e6ed435e41af04fc41e7007ef862049153fdc, plus support for saving/reloading empty frozen optimizer branches.Those two fixes belong in their respective repositories and are not included here. Before marking this draft ready, resolve their upstream disposition, complete the framework/GPU checks on the final combined stack, and complete the repository review checklist. No accuracy-retention or serving-performance claim is made.