Skip to content

Commit 30c91eb

Browse files
committed
fix(hf_ptq): announce the forced --skip_generate, and state its real reason
The flag flips silently, so a user who expected the post-quantization sample just sees it missing; every other consequence of export_dir announces itself. The comment also predated the tail-mutation fix -- finalize() converts the non-decoder modules in place on every run, not only a resumed one, which is how model_calib already words it. Signed-off-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com>
1 parent bb8364b commit 30c91eb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

examples/hf_ptq/hf_ptq.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,10 @@ def _layerwise_get(cfg, key, default=None):
12371237
"layerwise.export_dir is not supported with an AutoQuantize recipe; "
12381238
"use a PTQ recipe, or drop export_dir and export afterwards."
12391239
)
1240-
# A resumed run leaves skipped layers without amax; only the checkpoint is whole.
1240+
# finalize() converts the non-decoder modules in place without rolling them back, so
1241+
# the model is never valid for inference; a resumed run also skips layers' amax.
1242+
if not args.skip_generate:
1243+
print("Layerwise export: forcing --skip_generate, the model is left in export form.")
12411244
args.skip_generate = True
12421245

12431246
if args.batch_size == 0:

0 commit comments

Comments
 (0)