Skip to content

Adding support for [email protected] in command line tools. - #9461

Merged
benvanik merged 2 commits into
mainfrom
benvanik-npy
Jun 13, 2022
Merged

benvanik merged 2 commits into
mainfrom
benvanik-npy

Conversation

@benvanik

@benvanik benvanik commented Jun 12, 2022 •

Copy link
Copy Markdown
Collaborator

Adds a utility with APIs roughly match the numpy.load/numpy.save API.
Supports concatenated files as created by the numpy APIs.
Uses stdio for now but in the future we can extend this with IREE IO APIs
that allow for memory mapping and pipelined upload - if we care.

The command line tools have been extended to support loading 1+
ndarrays as function inputs when specified. These interleave with
other flags so you can specify some with inline definitions and
others from the npy files.

with open('inputs.npy', 'wb') as f:
  np.save(f, np.array([0,1,2,3], dtype=np.float32))
  np.save(f, np.array([4,5,6,7], dtype=np.float32))
iree-run-module --function_input=1xi32=1 [email protected]

Progress on #9453.
vm_util needs to be rewritten and then we can also support writing npy files with function outputs.

@benvanik benvanik added the runtime/tools IREE's runtime tooling (iree-run-module, iree-benchmark-module, etc) label Jun 12, 2022
@benvanik
benvanik requested a review from stellaraccident June 12, 2022 22:24
@benvanik
benvanik force-pushed the benvanik-npy branch 4 times, most recently from 18b8d0f to 83c94b3 Compare June 13, 2022 01:43
@benvanik
benvanik force-pushed the benvanik-npy branch 3 times, most recently from 857e155 to d827ed2 Compare June 13, 2022 04:02
@benvanik
benvanik marked this pull request as ready for review June 13, 2022 14:41
@benvanik
benvanik requested a review from GMNGeoffrey as a code owner June 13, 2022 14:41
@benvanik
benvanik requested review from ScottTodd and removed request for GMNGeoffrey June 13, 2022 14:55
IREE_RETURN_IF_ERROR(iree_numpy_npy_build_dtype(buffer_view, builder));
IREE_RETURN_IF_ERROR(iree_string_builder_append_cstring(builder, "', "));

// 'fortran_order': False

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.

👀 fortran

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.

image

benvanik added 2 commits June 13, 2022 08:42
APIs roughly match the numpy.load/numpy.save API and support concatenated
files. Uses stdio for now but in the future we can extend this with IREE
IO APIs that allow for memory mapping and pipelined upload - if we care.

Progress on #9453.
This will load 1+ ndarrays into buffer views.

Progress on #9453.
@benvanik

Copy link
Copy Markdown
Collaborator Author

failure looks like a flake in iree/task/executor_test - that's scary, but unrelated.

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

Labels

runtime/tools IREE's runtime tooling (iree-run-module, iree-benchmark-module, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants