-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[js/webgpu] Float16Array polyfill for uniform #19307
Changes from 22 commits
5a95268
706edd4
5453a7a
a8d4d77
ce46073
d6c86a3
3b49dee
da77265
4396346
1b853ba
cb3ba6c
1480c48
d63d39a
82485df
f44bd9c
6d05812
0d9e517
453cfe9
d281faf
2fc4f58
6db94a6
4ae19d2
e9a6cfa
453b52e
7e75c14
861c472
0082c71
b6f4cd5
cecada7
c9e90b1
10e9d65
7ab6a86
3619729
c8c74d2
4cb32ba
3020722
894c408
aa474a8
6795713
432f311
44ee23f
a239ce2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ | ||
{ | ||
"name": "constant 2D float16", | ||
"operator": "Pad", | ||
"opset": { "domain": "", "version": 10 }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add a test for version > 10, in which the value is as an input not attribute and have the type Do you need to update the code here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
"attributes": [ | ||
{ "name": "mode", "data": "constant", "type": "string" }, | ||
{ "name": "value", "data": 1.2, "type": "float" }, | ||
{ "name": "pads", "data": [3, 2, 2, 3], "type": "ints" } | ||
], | ||
"cases": [ | ||
{ | ||
"name": "[2,2]->[7,7]", | ||
"inputs": [ | ||
{ | ||
"data": [1.0, 2.0, 3.0, 4.0], | ||
"dims": [2, 2], | ||
"type": "float16" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [ | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.0, 2.0, 1.2, 1.2, 1.2, 1.2, 1.2, 3.0, 4.0, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2 | ||
], | ||
"dims": [7, 7], | ||
"type": "float16" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "constant 2D float16", | ||
"operator": "Pad", | ||
"opset": { "domain": "", "version": 19 }, | ||
"attributes": [{ "name": "mode", "data": "constant", "type": "string" }], | ||
"cases": [ | ||
{ | ||
"name": "[2,2]->[7,7]", | ||
"inputs": [ | ||
{ | ||
"data": [1.0, 2.0, 3.0, 4.0], | ||
"dims": [2, 2], | ||
"type": "float16" | ||
}, | ||
{ | ||
"data": [3, 2, 2, 3], | ||
"dims": [4], | ||
"type": "int64" | ||
}, | ||
{ | ||
"data": [1.2], | ||
"dims": [1], | ||
"type": "float16" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [ | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.0, 2.0, 1.2, 1.2, 1.2, 1.2, 1.2, 3.0, 4.0, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2 | ||
], | ||
"dims": [7, 7], | ||
"type": "float16" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
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.
we can keep onnxjs code unchanged as they are going to deprecated. we don't plan to support new features to webgl.
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 may complains: $ npm run build
lib/onnxjs/backends/webgl/ops/resize-packed.ts:244:20 - error TS2345: Argument of type 'unknown[]' is not assignable to parameter of type 'number[]'.
Type 'unknown' is not assignable to type 'number'.
244 scalesValidation(scales, mode, isResize);
~~~~~~
lib/onnxjs/backends/webgl/ops/resize-packed.ts:245:3 - error TS2322: Type 'unknown[]' is not assignable to type 'number[]'.
245 return scales;
~~~~~~
Found 2 errors in the same file, starting at: lib/onnxjs/backends/webgl/ops/resize-packed.ts:244
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.
let me try to make some modifications to unit test so that it no longer depends on onnxjs/tensor. Then you don't need to modify any file under onnxjs folder .
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.
#19358 should work with it