Skip to content

Commit 9ae972e

Browse files
authored
webgpu: apply the new timestampWrites format (#8048)
* webgpu: apply the new timestampWrites format * Add types/dom-webcodecs to fix bots errors * downgrade @types/dom-webcodecs version * try @types/dom-webcodecs: 0.1.4
1 parent e003c32 commit 9ae972e

File tree

5 files changed

+22
-28
lines changed

5 files changed

+22
-28
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"@types/seedrandom": "^2.4.28",
2929
"@types/semver": "^7.3.9",
3030
"@types/shelljs": "^0.8.7",
31-
"@webgpu/types": "0.1.30",
31+
"@types/dom-webcodecs": "0.1.4",
32+
"@webgpu/types": "0.1.38",
3233
"ajv": "~6.12.3",
3334
"argparse": "^1.0.10",
3435
"chalk": "~2.4.2",

tfjs-backend-webgpu/src/backend_webgpu.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ export class WebGPUBackend extends KernelBackend {
651651
console.warn(
652652
`This device doesn't support timestamp-query extension. ` +
653653
`Start Chrome browser with flag ` +
654-
`--disable-dawn-features=disallow_unsafe_apis to try it again. ` +
654+
`--enable-dawn-features=allow_unsafe_apis to try it again. ` +
655655
`Otherwise, zero will be shown for the kernel time when profiling ` +
656656
`mode is enabled.`);
657657
this.hasTimestampQueryWarned = true;
@@ -962,18 +962,11 @@ export class WebGPUBackend extends KernelBackend {
962962
count: this.querySetCount,
963963
});
964964
}
965-
computePassDescriptor.timestampWrites = [
966-
{
967-
querySet: this.querySet,
968-
queryIndex: 0,
969-
location: 'beginning',
970-
},
971-
{
972-
querySet: this.querySet,
973-
queryIndex: 1,
974-
location: 'end',
975-
}
976-
];
965+
computePassDescriptor.timestampWrites = {
966+
querySet: this.querySet,
967+
beginningOfPassWriteIndex: 0,
968+
endOfPassWriteIndex: 1,
969+
};
977970
this.computePassEncoder =
978971
this.commandEncoder.beginComputePass(computePassDescriptor);
979972
} else if (!this.computePassEncoder) {

tfjs-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@types/long": "^4.0.1",
4141
"@types/offscreencanvas": "~2019.7.0",
4242
"@types/seedrandom": "^2.4.28",
43-
"@webgpu/types": "0.1.30",
43+
"@webgpu/types": "0.1.38",
4444
"long": "4.0.0",
4545
"node-fetch": "~2.6.1",
4646
"seedrandom": "^3.0.5"

tfjs-core/yarn.lock

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,10 @@
2727
resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.30.tgz#d2efe425869b84163c2d56e779dddadb9372cbfa"
2828
integrity sha512-AnxLHewubLVzoF/A4qdxBGHCKifw8cY32iro3DQX9TPcetE95zBeVt3jnsvtvAUf1vwzMfwzp4t/L2yqPlnjkQ==
2929

30-
31-
version "0.0.30"
32-
resolved "https://registry.yarnpkg.com/@types/webgl-ext/-/webgl-ext-0.0.30.tgz#0ce498c16a41a23d15289e0b844d945b25f0fb9d"
33-
integrity sha512-LKVgNmBxN0BbljJrVUwkxwRYqzsAEPcZOe6S2T6ZaBDIrFp0qu4FNlpc5sM1tGbXUYFgdVQIoeLk1Y1UoblyEg==
34-
35-
36-
version "0.1.30"
37-
resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c"
38-
integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg==
30+
31+
version "0.1.38"
32+
resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020"
33+
integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==
3934

4035
4136
version "4.0.0"

yarn.lock

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@
310310
resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080"
311311
integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==
312312

313+
314+
version "0.1.4"
315+
resolved "https://registry.npmjs.org/@types/dom-webcodecs/-/dom-webcodecs-0.1.4.tgz#90a3dd80e5baf72baa79a74cf410e63863992516"
316+
integrity sha512-dc+xSUnCaCdi/hExZArnLhiavS3E1Rdpp2+zCI6TcmJvz4qgDPBbpvCM7DsQhwRXIIpVMHO6c3s+t+JyCSqYBA==
317+
313318
"@types/emscripten@~0.0.34":
314319
version "0.0.34"
315320
resolved "https://registry.yarnpkg.com/@types/emscripten/-/emscripten-0.0.34.tgz#12b4a344274fb102ff2f6c877b37587bc3e46008"
@@ -508,10 +513,10 @@
508513
resolved "https://registry.yarnpkg.com/@verdaccio/ui-theme/-/ui-theme-6.0.0-6-next.23.tgz#268da5091e1e9264fe87b8b94c0ac596e9e54879"
509514
integrity sha512-GXpEPdZJm6o+2VAxzUsKaiDriS+5enqr7Gjrb2Bttcd+IkOuC8lDsoFHxIv0ib4JudZJ/aKsRYL3TN2AetPFjw==
510515

511-
"@webgpu/[email protected].30":
512-
version "0.1.30"
513-
resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c"
514-
integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg==
516+
"@webgpu/[email protected].38":
517+
version "0.1.38"
518+
resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020"
519+
integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==
515520

516521
"@xmldom/xmldom@^0.7.3":
517522
version "0.7.5"

0 commit comments

Comments
 (0)