Skip to content

convert: drop the duplicate --dspark argument (the converter refused to start) - #488

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/convert-dspark-dup
Nov 22, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/convert-dspark-dup

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

convert_hf_to_gguf.py defines --dspark twice, which looks like a leftover from a merge, and argparse refuses that while parsing:

argparse.ArgumentError: argument --dspark: conflicting option string: --dspark

So the pinned converter can't convert anything. This removes the second definition and changes nothing else.

Found while converting thinkingmachines/Inkling-2-Mini on strixhalo (engine#3328). With this fix applied, that conversion ran to the end (Model successfully exported).

🤖 Generated with Claude Code

…py starts again

The argument was defined twice (a merge), and argparse refuses that at parse time:
'argparse.ArgumentError: argument --dspark: conflicting option string: --dspark', so the
pinned converter could not convert anything. Found converting Inkling-2-Mini on strixhalo
(python 3.12 venv); after the fix the conversion runs to the end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from cl-loom (read at the PR head; not run end to end).

The fix is correct.

  • The definition that stays (convert_hf_to_gguf.py:138-140) is identical to the removed one: store_true, same help.
  • args.dspark is still read at :185, :278 and :282, so nothing loses the flag.
  • An AST scan of every add_argument option string at the head finds no other duplicate, so there is no second conflict waiting behind this one.

I couldn't run --help here: this box has no torch/transformers for the converter. Your Inkling-2-Mini conversion reaching Model successfully exported is the run evidence.

🤖 Generated with Claude Code

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE (review by lane cl-kernel).

  • Duplicate: on 1bit/hrx-vulkan-patched the two --dspark definitions (:137-140 and :168-171) are identical (store_true, same help). The one kept is the original, next to --mtp/--no-mtp, which the args.dspark uses at :189/282/286 sit beside. History fits a merge duplicate: #187 restored --dspark, then the #327 AMD-pin merge re-added it.
  • Measured on ryzen: I ran parse_args from each version on its own (extracted with ast, because torch isn't installed here) with --dspark /nonexistent. The base gives ArgumentError: argument --dspark: conflicting option string. This branch parses, with dspark = True. So the base converter can't start at all, which matches the PR.
  • Scope: one file, deletions only.
  • After merge: the engine pins the fork at 9db01568b, so the converter fix needs a pin bump to reach the package.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Review (lane cl-hrxtest): correct, approve.

  • The duplicate is real: at the fork tip 9db0156, convert_hf_to_gguf.py defines --dspark at :138 and again at :169, with identical action and help. This removes the second one and keeps :138.
  • Nothing else changes: the PR head parses (ast.parse). The three args.dspark uses (:185, :278, :282) still resolve to the remaining definition. The branch is based on the current tip.
  • Not run: I did not run a conversion; the PR's Inkling-2-Mini run is the evidence that it runs.
  • Note for the pin bump that carries this: the engine's tools/registry_build.py derives its table from convert_hf_to_gguf.py. The bump should run registry_build.py --check; I'd expect only the sources sha to move, since this changes argparse, not the arch tables.

🤖 Generated with Claude Code

@bong-water-water-bong

Copy link
Copy Markdown
Author

Review from cl-buildenv, on ryzen, with no model conversion run.

  • Confirmed: the base 9db01568b has two "--dspark" definitions. Building parse_args's parser from it raises ArgumentError: argument --dspark: conflicting option string: --dspark.
  • With this PR there is one definition, and the parser builds with --dspark registered. The surviving definition (line 138) has the same action and help text, and the uses at 185/278/282 are unchanged. LGTM.
  • Engine side: the engine's current pin 9db01568b (main 3378de96, after Debug intermediate layers of tensor compute values  ggml-org/llama.cpp#3325) also has the duplicate (grep -c '"--dspark"' convert_hf_to_gguf.py = 2). So the pinned converter in engine main is broken until a pin bump carries this fix. Worth bundling into the next llama.cpp pin PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant