-
Notifications
You must be signed in to change notification settings - Fork 942
Migrate conv2D and related ops to logical sampling #52
Conversation
|
Review status: 0 of 39 files reviewed at latest revision, 2 unresolved discussions. src/math/webgl/conv_gpu.ts, line 54 at r2 (raw file):
decided to not use zeropadding since the shader is 15% slower than an if statement, as measured on the benchmark, and if statements are easier to read. src/math/webgl/conv_gpu_test.ts, line 284 at r1 (raw file):
this test is a duplicate of an earlier test, 3 tests before this. Comments from Reviewable |
|
Reviewed 10 of 20 files at r1, 28 of 29 files at r2. demos/benchmarks/conv_gpu_benchmark.ts, line 40 at r2 (raw file):
pull true out to a const demos/benchmarks/conv_transpose_gpu_benchmark.ts, line 41 at r2 (raw file):
pull 'false' out to a const demos/benchmarks/max_pool_gpu_benchmark.ts, line 28 at r2 (raw file):
can you make false / true below a "const positions = ..." src/math/math_gpu.ts, line 534 at r2 (raw file):
can you pull 'true' out to a variable src/math/webgl/conv_backprop_gpu.ts, line 32 at r2 (raw file):
if possible, use >= instead of subtracting 0.5 src/math/webgl/conv_gpu.ts, line 33 at r2 (raw file):
qq why -0.5? can we just use a >= like in pool? src/math/webgl/max_pool_backprop_gpu_test.ts, line 37 at r2 (raw file):
pull true out to a variable src/math/webgl/max_pool_positions_gpu_test.ts, line 34 at r2 (raw file):
pull true out to a variable src/math/webgl/shader_compiler.ts, line 19 at r2 (raw file):
didn't we want to keep this as a comma so it doesn't force us to put these on the same line? if not, let's just be consistent with the type below Comments from Reviewable |
|
Review status: 29 of 39 files reviewed at latest revision, 9 unresolved discussions, some commit checks pending. demos/benchmarks/conv_gpu_benchmark.ts, line 40 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/conv_transpose_gpu_benchmark.ts, line 41 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/max_pool_gpu_benchmark.ts, line 28 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/math/math_gpu.ts, line 534 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/math/webgl/conv_backprop_gpu.ts, line 32 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/math/webgl/conv_gpu.ts, line 33 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/math/webgl/max_pool_backprop_gpu_test.ts, line 37 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/math/webgl/max_pool_positions_gpu_test.ts, line 34 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/math/webgl/shader_compiler.ts, line 19 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Ah, good catch. I started using formatOnSave in my vscode user settings. We can enable it in workspace settings if you feel like using it too). It saved me lots of time in this PR. Comments from Reviewable |
* migrate addScaledMat and conv2d to logical sampling and improve shader compiler * fix conv2d zero paddig and make the project build * migrate rest of conv shaders to logical * replace zero pad with if * migrate pool ops * address review comments
This change is