Skip to content
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

[WebGL] Flag to disable pack optimization for Conv2dTranspose #7934

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tfjs-backend-webgl/src/flags_webgl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ ENV.registerFlag('WEBGL_LAZILY_UNPACK', () => ENV.getBool('WEBGL_PACK'));
/** Whether we will use the im2col algorithm to speed up convolutions. */
ENV.registerFlag('WEBGL_CONV_IM2COL', () => ENV.getBool('WEBGL_PACK'));

/** Whether we will pack conv2dTranspose op. */
ENV.registerFlag('WEBGL_PACK_CONV2DTRANSPOSE', () => ENV.getBool('WEBGL_PACK'));

/** The maximum texture dimension. */
ENV.registerFlag(
'WEBGL_MAX_TEXTURE_SIZE',
Expand Down
3 changes: 2 additions & 1 deletion tfjs-backend-webgl/src/kernels/Conv2DBackpropInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export function conv2DBackpropInput(args: {
inputShape, filter.shape as [number, number, number, number], strides,
1 /* dilations */, pad, dimRoundingMode, false, $dataFormat);

if (env().getBool('WEBGL_PACK') && $dataFormat === 'channelsLast') {
if (env().getBool('WEBGL_PACK_CONV2DTRANSPOSE') &&
$dataFormat === 'channelsLast') {
const customValues = [
[convInfo.strideHeight, convInfo.strideWidth],
];
Expand Down