-
Notifications
You must be signed in to change notification settings - Fork 943
Conversation
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.
Reviewed 8 of 9 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @annxingyuan, @nsthorat, and @dsmilkov)
src/kernels/webgl/shader_compiler.ts, line 325 at r2 (raw file):
} else { /* Previous NaN check '(val < 0.0 || 0.0 < val || val == 0.0) ? false : true'
use * on each line
src/kernels/webgl/shader_compiler.ts, line 335 at r2 (raw file):
bool hasNaN(vec4 values) { return any(bvec4( (values.x < 1.0 || 0.0 < values.x || values.x == 0.0) ? false : true,
can you call isNaN for each of these?
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.
Reviewable status:
complete! 1 of 1 approvals obtained (waiting on @dsmilkov)
src/kernels/webgl/shader_compiler.ts, line 325 at r2 (raw file):
Previously, nsthorat (Nikhil Thorat) wrote…
use * on each line
Done
src/kernels/webgl/shader_compiler.ts, line 335 at r2 (raw file):
Previously, nsthorat (Nikhil Thorat) wrote…
can you call isNaN for each of these?
Done
} else if (feature === 'WEBGL_LAZILY_UNPACK') { | ||
return false; | ||
return this.get('WEBGL_PACK'); |
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.
Minor issue: might be useful to note that this won't work if trying to turn on packing by calling set('WEBGL_PACK', true) from application code; it is still required to call set('WEBGL_LAZILY_UNPACK', true) since tf-layers initialization evaluates ENV.get('EPSILON') before application code, and causes evaluating and setting WEBGL_LAZILY_UNPACK to false.
I'm aware that this should be done, properly, using URL query string parameters.
Call stack:
Environment.evaluateFeature (environment.ts:299)
Environment.get (environment.ts:270)
MathBackendWebGL.compileAndRun (backend_webgl.ts:1988)
MathBackendWebGL.abs (backend_webgl.ts:1396)
(anonymous) (backend_webgl.ts:2029)
(anonymous) (engine.ts:156)
Engine.scopedRun (engine.ts:167)
Engine.tidy (engine.ts:153)
Environment.tidy (environment.ts:186)
MathBackendWebGL.floatPrecision (backend_webgl.ts:2028)
Environment.evaluateFeature (environment.ts:368)
Environment.get (environment.ts:270)
(anonymous) (common.ts:15)
extendStatics (tf-layers.js:20)
(anonymous) (tf-layers.js:21)
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.
Hey @astojilj - that's a good point - could you create a separate PR for this change?
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.
Hey @astojilj - that's a good point - could you create a separate PR for this change?
I reported this so that you are aware of it when testing. Otherwise, I'm not sure what would be the desired behavior - setting master switch WEBGL_PACK would override all previously set sub-flags?
This PR addresses tensorflow/tfjs#803
Changes
ClipPackedProgram
that implements clipping for packed texturesWEBGL_PACK_CLIP
, defaults tofalse
WEBGL_PACK
, defaults tofalse
, that turns all packing-related flags on or offPROD
flag is onget${Var}AtOutCoords
and broadcasting - broadcasting only occurs when the innermost dimensions are the same and the vector to be broadcast is rank 0 or 1.PERF
For repository owners only:
Please remember to apply all applicable tags to your pull request.
Tags: FEATURE, BREAKING, BUG, PERF, DEV, DOC, SECURITY
For more info see: https://github.com/tensorflow/tfjs/blob/master/DEVELOPMENT.md
This change is