-
Notifications
You must be signed in to change notification settings - Fork 2k
[wasm] Add maxPool kernel. #2396
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
Conversation
Maratyszcza
left a comment
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: 0 of 1 approvals obtained (waiting on @annxingyuan, @dsmilkov, and @Maratyszcza)
tfjs-backend-wasm/src/cc/kernels/MaxPool.cc, line 83 at r1 (raw file):
flags, &max_pool_op); if (status != xnn_status_success) {
If xnn_create_max_pooling2d_nhwc_f32 fails, the function should exit early, because max_pool_op is nullptr, and it is not safe to call xnn_setup_max_pooling2d_nhwc_f32 and xnn_run_operator with a nullptr
dsmilkov
left a comment
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.
Awesome!
Reviewed 6 of 9 files at r1, 3 of 3 files at r2.
Reviewable status:complete! 1 of 1 approvals obtained (waiting on @annxingyuan and @dsmilkov)
tfjs-backend-wasm/src/setup_test.ts, line 42 at r2 (raw file):
include: 'maxPool', excludes: [ 'f=[1,1]', // XNN does not support filter height and width of 1.
since you short-circuit 1x1 case, reenable this test?
annxingyuan
left a comment
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 and @Maratyszcza)
tfjs-backend-wasm/src/setup_test.ts, line 42 at r2 (raw file):
Previously, dsmilkov (Daniel Smilkov) wrote…
since you short-circuit 1x1 case, reenable this test?
There is still a f=[1,1] test that does not pass the short circuiting condition.
tfjs-backend-wasm/src/cc/kernels/MaxPool.cc, line 83 at r1 (raw file):
Previously, Maratyszcza (Marat Dukhan) wrote…
If
xnn_create_max_pooling2d_nhwc_f32fails, the function should exit early, becausemax_pool_opisnullptr, and it is not safe to callxnn_setup_max_pooling2d_nhwc_f32andxnn_run_operatorwith anullptr
Done
Changes
This change is