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
MegEngine: fix some bugs #1022
MegEngine: fix some bugs #1022
Conversation
source/megengine.js
Outdated
[ 'quantizeds1', 'int8' ], [ 'quantizeds4', 'int8' ], [ 'quantizeds8', 'int8' ], [ 'intb1', 'int8' ], [ 'intb2', 'int8' ], [ 'intb4', 'int8' ], [ 'qint8', 'int8' ], | ||
[ 'quantizeds16', 'int16' ], | ||
[ 'quantizeds32', 'int32' ] | ||
[ 'bool', 'boolean' ], [ 'byte', 'uint8' ], [ 'quantizeds4asymm', 'uint8' ], [ 'quantizeds8asymm', 'uint8' ], [ 'uintb4', 'uint8' ], [ 'quantizeds1', 'int8' ], [ 'quantizeds4', 'int8' ], [ 'quantizeds8', 'int8' ], [ 'intb1', 'int8' ], [ 'intb2', 'int8' ], [ 'intb4', 'int8' ], [ 'qint8', 'int8' ], [ 'quantizeds16', 'int16' ], [ 'quantizeds32', 'int32' ], [ 'TypePlaceHolder', 'boolean' ] |
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.
Each pair on new line to make diff easier in the future?
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.
Good idea, done.
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.
Why is ?
mapped to boolean
via [ 'bool', 'boolean' ], [ '?', 'boolean' ]
? Also this._dataTypeName
and this._dataType
should be identical so toString()
uses the same name as type.dataType
?
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.
After testing, ['?', 'boolean']
here can be deleted.
The this._dataType
here is mainly used to dynamically read the numerical data of the megengine.Tensor
during visualization. It seems that the reading of the numerical data of the *.Tensor
is no longer customized by the .js files of various frameworks? Therefore, this._dataTypeName
is used to display the data type of mge.
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.
Is there a way to generalize this? For example, can these types be added and supported for other formats as well by the shared rendering code?
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 mapping here only involves some special data types (such as quantizeds4asymm), but there is no mapping for common data types (such as float32). For mge models in other formats (such as .tm format), the special data types they support are also included in this correspondence. So don't generalize? I wonder if I understand what you mean correctly?
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.
Instead of mapping quantizeds4asymm
to uint8
, is quantizeds4asymm
a common data type that is supported by other frameworks? What would be the right name to use for all frameworks? Should dialog.Tensor
support these data types? For example, there is `int4' in other frameworks, if it is not encoded in a standard way maybe it should report the standard name and not return data for rendering?
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.
Data type quantizeds4asymm
is defined by us for quantifying data types, so it is not a common data type supported by other frameworks. Its corresponding name in dialog.Tensor
should be quint8
, which is also the name used by other frameworks. It has been fixed in the code.
a58c010
to
a108c2e
Compare
93a7080
to
11b7d49
Compare
6a9c2a9
to
ce656e5
Compare
1f79778
to
b3c3380
Compare
91f0359
to
7d4646e
Compare
aa2d4ce
to
1f096bf
Compare
Hi @lutzroeder, can this mr be merged? |
@Ysllllll can you rebase to TIP. The |
OK. Yes,
|
6ab1a41
to
aedc23c
Compare
1a99b78
to
3ba773c
Compare
9692ebe
to
63d727e
Compare
fix some bugs of megengine C++ model (.mge) visualization:
please help review, thanks~