support lm-head/embed requant - #3050
Conversation
Signed-off-by: ZX-ModelCloud <zx@modelcloud.ai>
|
PR Review Findings:
|
|
Reviewed head Result: changes recommended — three correctness findings. This review confirms two issues from the earlier discussion and adds the calibrated
Validation: inspected the 19-file diff and surrounding quantization, packing, and serialization code. Executed the actual writer helper functions extracted from this commit with in-memory tensor/I/O doubles: OUTPUT raised the missing-prefix error, INPUT wrote only the input replacement, and BOTH wrote both replacements. Executed the actual NumPy allocation/packing loop: vocabulary 16 passed; 17 and 50,257 raised the out-of-bounds error. These are focused logic reproductions, not full checkpoint integration tests. Full PyTorch/CUDA tests were unavailable because PyTorch is not installed in this environment. Clarification on the earlier CLI finding: tying weights does not by itself make the input and output modules the same object. Distinct embedding/linear modules can share a weight parameter while retaining different runtime paths. The earlier path-deduplication claim needs an actual module-aliasing model to establish its applicability; I am not counting it as a general tied-weight defect here. |
Review: PR #3050 — support lm-head/embed requantReviewed head Verdict: request changes — the core GPTQ-on- High
Medium
Low / nits
|
b366ea8 to
319aee2
Compare
|
Follow-up remediation — all three findings from the validation review are addressed in 022994c3. Tied embedding replacement save lifecycle. Fixed single-endpoint requantization for tied source checkpoints. Input-only saves now serialize the cloned untied output head and preserve the untied config; output-only saves locate and rewrite the tied input shard correctly. Added regression coverage for both, input-only, and output-only endpoint selection. Unaligned embedding vocabulary packing. Fixed 2/4/8-bit embedding packing when the vocabulary size is not divisible by the packing width (for example, vocab size 17 or GPT-2 vocab size 50257). Packing now pads the tail safely, while dequantization trims the packed tail back to the original vocabulary size. Added forward and safetensors save/reload coverage. Embedding quantization stage selection. Preserved decoder subset plans when Regression suite: |
|
Merge conflict |
Conflict resolved. |
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
No description provided.