[webgl] enabling WEBGL_USE_SHAPES_UNIFORMS results in model execution returning null values
See original GitHub issueuser reported issue with my library and after a while it was traced down to WEBGL_USE_SHAPES_UNIFORMS
which i have enabled by default for over half a year now due to massive performance advantages
issue itself is that model execution shows no issues and it returns tensors in expected shape,
but tensor data is an array with all null
values instead of expected float32
values
what is strange that on majority of systems there are no issues (plus i cannot reproduce locally)
and there is only single (quite small) affected model out of 10+ used
affected model
very simple code reproduction (again, i cannot reproduce myself)
(it runs a model using predefined image input and checks output validity)
- https://vladmandic.github.io/human/test/issue-faceres.html?default: returns arrays with correct float values
- https://vladmandic.github.io/human/test/issue-faceres.html?uniforms: returns array with all null values
test has tfjs debug enabled and you can see all ops in the browser console
environment:
- tfjs: 3.20.0 (older versions are also affected)
- browser: chrome 104 and 105
- os: windows 10 pro
it’s reported on two different systems using different graphics adapters (AMD Radeon and nVidia RTX)
both affected systems report no issues looking at chrome://gpu and webgl v2 is working fine
only other thing worth noting is that user is using non-latin os locale
link to original issue: https://github.com/vladmandic/human/issues/291
Issue Analytics
- State:
- Created a year ago
- Comments:34 (12 by maintainers)
Top GitHub Comments
@vladmandic @shurshilov I have verified #6828 can fix this issue in my device. You can verify it in the next release or build from the source. If you still meet any problem, please feel free to reopen it or file a new bug. Thanks.
More information: The current issue is not that enabling WEBGL_USE_SHAPES_UNIFORMS results in model execution returning null values anymore. But the faceres model couldn’t get correct result no matter
WEBGL_USE_SHAPES_UNIFORMS
is true or false.In fact, the fix is more like a workaround. I don’t know why
isnan_custom
doesn’t work for packed binary. But it works for unpacked binary. I did a bunch of experiments forCHECK_NAN_SNIPPET_PACKED
. But none of them work. Paste some findings so far in case someone may have more ideas. Tested GPU: Radeon ™ RX 480 GraphicsisNaN
coming from the input scalarb
nota
. If only checkisnan_custom(a)
, we can get correct result.b
’s value instead ofminimum
’s result. The result seems no problem. I mean it’s expectedb
’s value.vec4(isnan_custom(b))
's value. I also can’t see any abnormal. It’s all zero. But the incorrect result ofminimum
shows it should have a un-zero value to let the code go toresult.xxx = isNaN.xxx ? NAN : result.xxx;
0.5
) is none of them ina(1.84)
,b(6.0)
andNAN
.