Skip to content

[doc] Add tips of reading input from a file - #21143

Merged
jinchen62 merged 1 commit into
iree-org:mainfrom
jinchen62:tool_doc
Jun 19, 2025
Merged

jinchen62 merged 1 commit into
iree-org:mainfrom
jinchen62:tool_doc

Conversation

@jinchen62

Copy link
Copy Markdown
Contributor

No description provided.

@jinchen62
jinchen62 requested a review from ScottTodd as a code owner June 19, 2025 21:14
Comment on lines +261 to +275
Reading from a numpy file:
``` text
[email protected]
```

Reading from a binary file with passing the shape and dtype because raw binary
files have no metadata:
``` text
--input=[shape][email protected]
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This has some overlap with an earlier section:

* Input buffers may also be read from raw binary files or Numpy npy files.
MLIR type | Description | Input example
-- | -- | --
`i32` | Scalar | `--input=1234`
`tensor<i32>` | 0-D tensor | `--input=i32=1234`
`tensor<1xi32>` | 1-D tensor (shape [1]) | `--input=1xi32=1234`
`tensor<2xi32>` | 1-D tensor (shape [2]) | `--input="2xi32=12 34"`
`tensor<2x3xi32>` | 2-D tensor (shape [2, 3]) | `--input="2x3xi32=[1 2 3][4 5 6]"`

Some repetition is fine, but maybe link to that part of the document for a concrete example? Or merge this and that section somehow. Could also mention that iree-benchmark-module and iree-run-module share many flags.

--8<-- "tools/test/iree-run-module-expected.mlir"
```

* Note that `iree-benchmark-module` and `iree-run-module` share many flags.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is okay (especially in docs/developers), but here are some doc writing tips:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for guidance on writing docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oops, you followed the github style:

> [!TIP]
> `iree-benchmark-module` and `iree-run-module` share many flags.

As I pointed out, the docs/website/ folder uses mkdocs style:

!!! tip

    `iree-benchmark-module` and `iree-run-module` share many flags.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah sorry, I will create another PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it. Here is the fix #21145.

@jinchen62
jinchen62 merged commit ba6b07d into iree-org:main Jun 19, 2025
@jinchen62
jinchen62 deleted the tool_doc branch June 19, 2025 21:53
jinchen62 added a commit that referenced this pull request Jun 19, 2025
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
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.

2 participants