-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add mindir
format support.
#1227
Conversation
@Ethan-Chen-plus can you provide some context:
|
9a4785e
to
1a817ad
Compare
1f388bc
to
0cfad16
Compare
994aca4
to
0de981a
Compare
PS I:\netron> npm run validate
eslint
pylint
test
gguf/phi-2.Q2_K.gguf
onnx/candy.onnx
keras/1151.4.keras
coreml/Exermote.mlmodel
pytorch/alexnet.ptl
pytorch/DCGAN2.pt
tf/conv-layers.pb.zip
tflite/mobilenet_v1_0.75_160_quantized.tflite
tflite/squeezenet.tflite I have updated my code, please review. |
@Ethan-Chen-plus can you provide some context:
|
66d40fe
to
19e4123
Compare
8abf19b
to
dc7a947
Compare
d9a23ec
to
5028ef6
Compare
Workflow requires approval, thank you again🤗 |
1a3b633
to
dc51e07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compared to other similar IR formats such as ...
This format looks very similar to ONNX. Instead of defining a new format, can this be accomplished by using metadata
extensions in ONNX to augment with additional information.
There is also an existing MindSpore Lite format and a dozen other formats that look similar in principle. Consider a path that leverages existing formats or standards instead of creating another duplicate format that needs to be maintained.
@@ -734,7 +734,8 @@ base.Metadata = class { | |||
'ptl', 't7', | |||
'dlc', 'uff', 'armnn', | |||
'mnn', 'ms', 'ncnn', 'om', 'tm', 'mge', 'tmfile', 'tnnproto', 'xmodel', 'kmodel', 'rknn', | |||
'tar', 'zip' | |||
'tar', 'zip', | |||
'mindir', 'mind_ir' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove for now for testing.
@@ -0,0 +1,713 @@ | |||
export const protobuf = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to mindir-proto.js
. Sync to latest and regenerate this file using ./tools/mindir sync schema
.
@@ -0,0 +1,252 @@ | |||
syntax = "proto2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be added to the repro and instead downloaded to a location in ./third_party/source/mindspore/mindspore/core/proto/mind_ir.proto
.
sync() { | ||
echo "mind_ir sync" | ||
mkdir -p "./third_party/source/mindspore/mindspore/mindir/schema/" | ||
curl --silent --location --output "./third_party/source/mindspore/mindspore/mindir/schema/mind_ir-metadata.json" "https://raw.githubusercontent.com/Ethan-Chen-plus/mindir/main/mind_ir-metadata.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metadata file should not be downloaded from an external location and instead be updated in place as part of ./tools/mindir metadata
.
@@ -5455,6 +5455,34 @@ view.ModelFactoryService = class { | |||
this.register('./modular', ['.maxviz']); | |||
this.register('./cambricon', ['.cambricon']); | |||
this.register('./weka', ['.model']); | |||
this.register('./mslite', ['.ms']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve incorrect merge.
* The Model class represents a mind_ir model and contains information about the model's format, name, and graphs. | ||
* The Graph class represents a graph within a mind_ir model and contains information about the graph's inputs, outputs, and nodes. | ||
*/ | ||
export const protobuf = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove, this should not be needed.
const identifier = context.identifier; | ||
const extension = identifier.split('.').pop().toLowerCase(); | ||
if (extension === "mindir") { | ||
return 'mind_ir'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has changed in more recent versions. Sync to latest.
} | ||
}; | ||
|
||
mind_ir.Parameter = class { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed in latest. Parameter
to Argument
and Argument
to Value
.
|
||
constructor(message) { | ||
super(message); | ||
this.name = 'SnapML Model Load Error.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix error message.
|
||
constructor(context, attribute) { | ||
|
||
this._name = attribute.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attribute
has been removed in latest and replaced with using Argument
to represent attribtues.
62dda3c
to
26b7164
Compare
947fe42
to
09bd794
Compare
e02cf71
to
a805f35
Compare
Please comment with additional information if the pull request should be reopened. |
🤗👋Hi! We have added our
.mindir
format. Please review our commit.