Commit 8f08737
[model_free_ptq] Add warning/error for invalid partner tensors in build_inverse_weights_map (#2546)
## Purpose
Follow-up to #2498 addressing review comments from @kylesayrs.
## Changes
- `partner_shard is None`: log warning instead of silent skip —
indicates
unexpected model architecture where expected partner tensor doesn't
exist
- `partner_resolved is None`: raise ValueError instead of silent skip —
indicates corrupt or incomplete checkpoint and should surface as an
error
## Notes
These cases were flagged as defensive guards that either shouldn't exist
or should error loudly. The warning approach for partner_shard=None
handles
the edge case of non-standard model architectures gracefully while still
surfacing the issue.
## Test
Unit tests passed 35/35
Signed-off-by: David Zheng <dqzheng1996@gmail.com>
Signed-off-by: root <root@bolt-6jxv69gfv8-tqazfcpmhh.bolt-pods.turi-bolt.svc.kube.us-east-1d.k8s.cloud.apple.com>
Co-authored-by: root <root@bolt-6jxv69gfv8-tqazfcpmhh.bolt-pods.turi-bolt.svc.kube.us-east-1d.k8s.cloud.apple.com>
Co-authored-by: Brian Dellabetta <brian-dellabetta@users.noreply.github.com>1 parent a5c58a0 commit 8f08737
1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
129 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
130 | 142 | | |
131 | 143 | | |
132 | 144 | | |
| |||
0 commit comments