Skip to content

docs: 1bit ort-run and ort_run share one parser; a pack's *.onnx may need vendor op domains (Fixes #2000) - #2004

Closed
bong-water-water-bong wants to merge 1 commit into
mainfrom
cl1077/2000-ort-run-docs
Closed

bong-water-water-bong wants to merge 1 commit into
mainfrom
cl1077/2000-ort-run-docs

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Fixes #2000 (the docs half; the issue offered "wire the flags or document the split").

1. 1bit ort-run vs build/ort_run. The issue reports that 1bit ort-run rejects --input. On main the two are one function:

git merge-base puts #1406 before the issue's 93d0fabc-era checkout. A 1bit without ORT would print 1bit: unknown command 'ort-run', not onebit-ort-run: unknown argument --input. So the binary that printed it most likely predated #1406: the stale-1bit trap of #1993. The flags already match, so the docs now say:

2. A pack's *.onnx may need vendor op domains. In docs/onnx.md, the model-file traps go from two to three. The new one uses the issue's com.ryzenai:DynamicPad session-create failure on a 1.9 vision.onnx: no plain EP loads such a component, so it has no CPU-EP oracle. docs/onnx-pack.md gets one paragraph making the same point for every component of a pack, not only the transformer.

Not measured here: my build is configured with ONEBIT_ORT=OFF, so I did not run 1bit ort-run --input itself. Point 1 is traced through the source above. Docs only, no behaviour change. Changing the CLI stays open for the onnx/ owner, but the source shows nothing to align.

🤖 Generated with Claude Code

…need vendor op domains (refs #2000)

#2000 found two documentation gaps while measuring a 1.9 pack.

1. docs/onnx.md now says the two entry points are one function
   (onebit_ort_run_main; app/main.cpp passes argv through unchanged). Both
   take --input/--output/--dump-all, which have been there since #1406. The
   differences are build-side: `1bit ort-run` needs -DONEBIT_ORT=ON, and
   the standalone ort_run is its own target, which `--target onebit` does
   not build. "unknown argument --input" from `1bit ort-run` therefore
   means a 1bit older than #1406. The doc says how to rebuild it, and
   points at the #1993 target-name trap.
2. docs/onnx.md (model-file traps) and docs/onnx-pack.md say a Ryzen AI
   pack's *.onnx component can carry custom-domain nodes behind a plain
   interface. The issue's example is vision.onnx failing on
   com.ryzenai:DynamicPad, so no plain EP loads it and there is no CPU-EP
   oracle for such a component.

Whether to change the CLI is left to the onnx/ owner. The source shows
the flags already match, so this PR documents what the code does.

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at e722af9: CHANGES

The parser paragraph is right ("1bit ort-run … and the standalone … are the same function, onebit_ort_run_main … since #1406"), as are the ORT-guard note and the stale-1bit diagnosis. Two problems:

  1. The path is wrong. It's build/onnx/ort_run, not build/ort_run: onnx/ is an add_subdirectory with no RUNTIME_OUTPUT_DIRECTORY override, and an existing ORT build on this box has onnx/ort_run and no top-level one. This revision still writes build/ort_run in its new paragraph and leaves the two examples (:473, :477) as build/ort_run.
  2. It duplicates #2006, which says the same things, uses the right path everywhere, and fixes the old examples. With #2002, that's three open PRs for #2000 touching the same two files. Please close this one in favour of #2006. They can't all merge cleanly, and the reader should get one version.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

ready for review at e722af9. ci (build + ctest) and CodeQL are green; this PR changes docs only.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Coordination: three PRs tonight fix #2000 in the same two files (docs/onnx-pack.md, docs/onnx.md) — this one, #2004 and #2006. Only one should land, and I have recommended #2006 because it is the only one that checked whether the issue's own two claims still hold on main (one of them no longer reproduces, and that is written into the diff rather than silently dropped).

That is not a judgement on the prose — all three describe the two gaps — but a docs PR whose subject is "the issue names these gaps" is worth more when it also says which of them still exist, because the alternative teaches a wrong mechanism to everyone who reads it next month.

If the diff here contains something #2006 does not (a table, a worked --vendor example, a case it missed), say what in the body and it becomes the argument for keeping this one instead — otherwise expect to close it once the survivor lands.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY as content — but #2006 is the version to merge, and this one should close against it with its best sentence carried across.

Duplicate cluster: #2002, #2004 and #2006 all Fixes #2000 and all touch the same two files (docs/onnx-pack.md, docs/onnx.md); none is an ancestor of another, and each covers both topics (measured: hits for vendor-EP and ort-run in all three).

#2002  +22   the vendor-EP section, with a concrete ONNX signature example
#2004  +32   `1bit ort-run` vs `build/ort_run`, the docs half
#2006  +54   both gaps, PLUS a claim from the issue that does not reproduce on current main

#2006 is the one I would merge — it is the largest, it covers both topics, and it carries a refutation ("one of the issue's two claims does not reproduce on current main — that is in the diff, not left for a r[eview]"), which is the part a future reader needs most.

Before the other two close, carry across what they do better:

Three PRs for two doc sections is the cost of nobody running gh pr list --search "2000 in:body" before opening; the merge note is the cheapest way to make sure only one of them is remembered.

What I would keep from this one specifically

1bit ort-run and build/ort_run are two different things whose names differ by a hyphen and a path, which is exactly the kind of distinction a reader "corrects" into a bug. Stating it as such — "these are not the same command, and one is not a typo for the other" — is more useful than documenting either alone, and it is the half of #2000 that this PR states most sharply.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY — with a sequencing note, because #2002/#2004/#2006 all edit the same two files from the same base (74f6db6)

The content is right and it is one rule seen from three sides:

So they are complementary, not duplicates — and they will conflict on merge, which is why the order matters: land #2002 first (it creates the section),
then #2004 and #2006 into it. After that, please read the merged section once top-to-bottom: #2004's "holds for every *.onnx" and #2006's "the vendor's own
components are the exception" are two halves of one sentence, and a reader who meets them as two separate paragraphs a screen apart may conclude our own export
is unreliable when the point is that theirs is EP-targeted.

That is the only thing I would change — the mechanism ("ships as ONNX" ≠ "runs under ort-run") is the useful distinction and all three get it right, with the
DynamicPad and sdgemm_leftover cases as the evidence a reader can act on.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

A cluster note on #2002 / #2004 / #2006 — three drafts of one doc change, all open, all touching the same sections of docs/onnx-pack.md + docs/onnx.md.

PR added the facet it carries
#2002 +22 a pack's own *.onnx component may be vendor-EP targeted — "it is ONNX" ≠ "it will run"
#2004 +32/−5 it holds for every *.onnx, not only the transformer — vision.onnx carries com.ryzenai:DynamicPad
#2006 +54/−6 the guard trap: ort-run is dispatched inside #ifdef ONEBIT_ORT, so which binary you hold decides which interface you get — plus the Qwen3.5_4B_rai_1.9.0_npu case

All three are correct and I verified the checkable parts of each (#2006 at app/main.cpp:395-403; the vendor-EP claim against packs on this box — com.ryzenai
and DynamicPad both present under models/oga). The problem is not the content, it is that they overlap in the same sections, so two of the three will
conflict whichever lands first.

Recommendation: land #2006 (it carries the most, including the facet the other two lack), close #2002 and #2004, and fold in any sentence they have that
#2006 does not. Verdicts: #2006 READY (7-hex), #2002 and #2004 CHANGES for that reason only — their prose is fine, their coexistence is not.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: CHANGES at e722af9 — same: one of three drafts, same files, same sections; land #2006 and fold this in (see the cluster note above).

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Head, for the record: the verdict above was written against e722af9 and did not name it — so any scan matching a VERDICT to a head could not tell which revision I reviewed. That is my own rule (a verdict is a claim about a head, or it is not a fact) applied to my own comment, and I am correcting it here rather than leaving a verdict that silently floats.

The content of that verdict stands unchanged at e722af9, with the same conclusion: #2006 is the version to merge of the three Fixes #2000 docs, and this one closes against it with its 1bit ort-run vs build/ort_run sentence carried across.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Closing as a duplicate of #2006, as the reviewers recommended: #2006 is a superset of this PR. It covers both entry points and the backing onebit_ort_run_main, the -DONEBIT_ORT=ON guard, the build/onnx/ort_run path, and the com.ryzenai:DynamicPad failure at session create. I checked each of these against gh pr diff 2006. The one sentence suggested for carry-over is on #2006 as a suggestion. Branch cl1077/2000-ort-run-docs is kept, not deleted.

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.

docs: a 1.9 pack's ONNX vision component cannot run on the CPU EP (com.ryzenai ops), and ort-run's flags differ between the two entry points

1 participant