Commit 6cfb8e3
refactor(hf_ptq): drop the offloaded-weight pin, which the layerwise path does not need
_pin_externally_read_params existed because Kimi-K3's _apply_attn_res reads the residual
proj/norm weights from the decoder layer's forward rather than calling those modules, so
accelerate leaves them on meta. That is real for a plain full forward, but not for this
pipeline: every forward in the calibration loop runs inside persistent_materialization(layer),
which materializes the layer subtree including those modules, and the only forward outside a
window is the bootstrap capture, which early-stops before reaching them.
Measured on midi-K3 with offload genuinely engaged (--max_gpu_memory_gb 0.5
--max_cpu_memory_gb 0.1):
pin active exit=0 shards=9 OFFLOAD=1 PINNED=1 meta_err=0
pin disabled exit=0 shards=9 OFFLOAD=1 PINNED=0 meta_err=0
Exports equivalent: 2922/2922 keys, the single flagged tensor being a NaN from the fixture's
random init (identical NaN masks, all 31 finite entries equal). midi-K3 does carry the
modules in question -- 8 mlp_res_proj, 8 mlp_res_norm, 8 self_attention_res_proj, 1
output_attn_res_proj -- so the control exercises the pattern rather than skipping it.
An earlier run of this comparison was void: at --max_gpu_memory_gb 1 nothing was offloaded,
so both arms took the same resident path. The budget above is the range where accelerate
offloads part of the model; below roughly 0.05 it refuses outright.
Removing it also removes the hardcoded six-suffix Kimi-K3 module list from a shared example
helper, which applied to every offloaded run.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com>1 parent 363b79b commit 6cfb8e3
1 file changed
Lines changed: 0 additions & 61 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | 744 | | |
800 | 745 | | |
801 | 746 | | |
| |||
1066 | 1011 | | |
1067 | 1012 | | |
1068 | 1013 | | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | 1014 | | |
1076 | 1015 | | |
1077 | 1016 | | |
| |||
0 commit comments