-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate whether raw data or external data should be used #52
Comments
/cc @Honry |
@miaobin mentioned that the raw data is required by shape inference code. |
WebNN clamp min/max values are just scalars. Raw data (copying) vs. external data (non-copying) seems not to be much different. |
The guideline recommends using raw data when
We may need to add a helper to calculate the size of an initializer and use raw data if its size is less than 128 bytes. See more discussions at microsoft/onnxruntime#23223 (comment) |
@mingmingtasd , your
https://github.com/shiyi9801/chromium/blame/ort_backend/services/webnn/ort/graph_builder_ort.cc#L666 I understand scale and bias won't be used for shape inference. What's the runtime error if using pre-allocated data? |
Sorry, after verifying, the scale and bias of instance norm can be external data, I added wrong annotation here. I will fix ~
I will do this. |
Some initializers must be uploaded to raw data, for example:
Reshape
op needs parametershape
as raw data to do shape inference.Reduce
op needs parameteraxes
as raw data.Expand
op needs parametershape
as raw data.Slice
op needsstarts
,ends
andsteps
as raw data.While for some other ops, initializers have not to be raw data:
min/max
value ofclamp
can be either raw data or external dataAre there other ops requiring initializer as raw data?
Currently we upload all webnn constants into external data (for potential zero-copy) but what if some ops like Reshape can't take external data as initializers?
@huningxin @shiyi9801 @lisa0314 @miaobin
The text was updated successfully, but these errors were encountered: