models: PTv3 onboarding (stage graph, seg3d export, INT8 QAT/FP8) - #23
Draft
vividf wants to merge 1 commit into
Draft
models: PTv3 onboarding (stage graph, seg3d export, INT8 QAT/FP8)#23vividf wants to merge 1 commit into
vividf wants to merge 1 commit into
Conversation
This was referenced Sep 5, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vividf
force-pushed
the
pr13-ptv3-onboarding
branch
from
September 7, 2026 05:23
4ded075 to
ad16735
Compare
This was referenced Sep 7, 2026
Draft
Draft
quant: declarative quantization (plan/placement, modelopt engine, PTQ/QAT, self-describing ckpt)
#17
Draft
Draft
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.
Stack(base
pr-stack-base=7e35d97):#11 → #12 → #13 → #14 → #15 → #16 → #17 → #18 → #19 → #20(CenterPoint 全功能點)→ #21 → #25 → #22 → #23 → #24(= 開發 branch HEAD,逐位元一致)。合併由下而上,每合一層把下一層 base retarget。這個 PR 是什麼
PTv3 onboarding:onboarding 三連的第三次,唯一含「模型重寫層」的一個(export_modules)。
實測數字
linear INT8 的教訓:直接量 linear 賠 6.4 mIoU → per-kind 宣告 + SmoothQuant recipe 解決。attention 內部(QK/AV matmul)不量:斷 TRT fused-MHA 反而 +0.3 ms。
逐檔導覽
main_modules/ptv3/export_modules.py:export 態的 attention / serialization 重寫(訓練態不動)——與 models: BEVFusion export fusion + head correctness (permanent work, not parking) #25 的 fused-MHA export 同哲學。數值等價性由兩層保證:stage 測試 + verification(pytorch vs onnx vs tensorrt 逐 tensor)。main_modules/ptv3/stages.py:encoder(含 CPE plugin,torch_fallback_backendsfor ORT)+ seg3d_head 兩張圖的切界;serialized order/grid coord 經 StageContext 傳遞。main_modules/ptv3/quantization.py:per-kind 宣告(conv INT8、linear FP8 或 SmoothQuant INT8)。main_modules/ptv3/model.py:stage-graph 版模型類。_int8/_int8_qat/_fp8(tolerance observed 記在註解)。test_ptv3_stages、test_verification_caveat(caveat 機制用 PTv3 情境測)。檔案清單(點開)
Review checklist
🤖 Generated with Claude Code