From 1bb878a845353c88449b49b2a27b983c96a29626 Mon Sep 17 00:00:00 2001 From: Daniel Smilkov Date: Mon, 16 Dec 2019 19:44:40 -0500 Subject: [PATCH 1/6] save --- tfjs-backend-wasm/README.md | 27 +++++++++++++---------- tfjs-backend-wasm/face-detector-bench.svg | 2 +- tfjs-backend-wasm/mobilenet-v2-bench.svg | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tfjs-backend-wasm/README.md b/tfjs-backend-wasm/README.md index 37f77d26253..134c96acb1a 100644 --- a/tfjs-backend-wasm/README.md +++ b/tfjs-backend-wasm/README.md @@ -98,28 +98,31 @@ CPU backend, and ~5.3-7.7X slower than the WebGL backend. | MobileNet inference (ms) | WASM | WebGL | CPU | -|-------------------|-------|-------|-------| -| iPhone X | 147.1 | 20.3 | 941.3 | -| iPhone XS | 140 | 18.1 | 426.4 | -| Desktop Linux | 91.5 | 17.1 | 1049 | -| Macbook Pro | | | | +|--------------------------|-------|-------|-------| +| iPhone X | 147.1 | 20.3 | 941.3 | +| iPhone XS | 140 | 18.1 | 426.4 | +| Pixel 3 | | | | +| Desktop Linux | 91.5 | 17.1 | 1049 | +| Macbook Pro | 98.4 | 19.6 | 893.5 | ### Face Detector Face detector is a lite model with 0.1M params and ~20M multiply-adds. For this model, -the WASM backend is between ~8.2-19.8X faster than the vanilla CPU backend, and -only 1X-1.7X slower than the WebGL backend. +the WASM backend is between ~8.2-19.8X faster than the vanilla CPU backend. +Compared to the WebGL backend, WASM's performance is comparable to the WebGL +backend (can be up to ~2X faster, or 2X slower, depending on the hardware). | Face Detector inference (ms) | WASM | WebGL | CPU | -|---------------|------|-------|-------| -| iPhone X | 23 | 13.5 | 318 | -| iPhone XS | 21.4 | 10.5 | 176.9 | -| Desktop Linux | 12.6 | 12.7 | 249.5 | -| Macbook Pro | | | | +|------------------------------|------|-------|-------| +| iPhone X | 22.4 | 13.5 | 318 | +| iPhone XS | 21.4 | 10.5 | 176.9 | +| Pixel 3 | | | | +| Desktop Linux | 12.6 | 12.7 | 249.5 | +| Macbook Pro | 14.1 | 26.1 | 209.1 | # FAQ diff --git a/tfjs-backend-wasm/face-detector-bench.svg b/tfjs-backend-wasm/face-detector-bench.svg index 8e9878468d7..9bb5ef4c958 100644 --- a/tfjs-backend-wasm/face-detector-bench.svg +++ b/tfjs-backend-wasm/face-detector-bench.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/tfjs-backend-wasm/mobilenet-v2-bench.svg b/tfjs-backend-wasm/mobilenet-v2-bench.svg index cf8a6905a54..8fc4e1fd18e 100644 --- a/tfjs-backend-wasm/mobilenet-v2-bench.svg +++ b/tfjs-backend-wasm/mobilenet-v2-bench.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 05753b6eb0758f10aa2ace42c4c70bb7e9bc904c Mon Sep 17 00:00:00 2001 From: Daniel Smilkov Date: Mon, 16 Dec 2019 19:55:10 -0500 Subject: [PATCH 2/6] save --- tfjs-backend-wasm/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tfjs-backend-wasm/README.md b/tfjs-backend-wasm/README.md index 134c96acb1a..bf0b9a6c9bb 100644 --- a/tfjs-backend-wasm/README.md +++ b/tfjs-backend-wasm/README.md @@ -110,9 +110,9 @@ CPU backend, and ~5.3-7.7X slower than the WebGL backend. ### Face Detector Face detector is a lite model with 0.1M params and ~20M multiply-adds. For this model, -the WASM backend is between ~8.2-19.8X faster than the vanilla CPU backend. -Compared to the WebGL backend, WASM's performance is comparable to the WebGL -backend (can be up to ~2X faster, or 2X slower, depending on the hardware). +the WASM backend is between ~8.2-19.8X faster than the vanilla CPU backend and +comparable to the WebGL backend (up to ~2X faster, or 2X slower, depending on +the hardware). From 40b318932bd57ed9ba469a5b236e3a3a2c92d301 Mon Sep 17 00:00:00 2001 From: Daniel Smilkov Date: Mon, 16 Dec 2019 19:55:29 -0500 Subject: [PATCH 3/6] save --- tfjs-backend-wasm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/README.md b/tfjs-backend-wasm/README.md index bf0b9a6c9bb..db6ce2571a1 100644 --- a/tfjs-backend-wasm/README.md +++ b/tfjs-backend-wasm/README.md @@ -112,7 +112,7 @@ CPU backend, and ~5.3-7.7X slower than the WebGL backend. Face detector is a lite model with 0.1M params and ~20M multiply-adds. For this model, the WASM backend is between ~8.2-19.8X faster than the vanilla CPU backend and comparable to the WebGL backend (up to ~2X faster, or 2X slower, depending on -the hardware). +the device). From 068fed747c6d66b3ae79738bf8f34cc9fc78033f Mon Sep 17 00:00:00 2001 From: Daniel Smilkov Date: Tue, 17 Dec 2019 10:43:47 -0500 Subject: [PATCH 4/6] save --- tfjs-backend-wasm/README.md | 8 ++++---- tfjs-backend-wasm/face-detector-bench.svg | 2 +- tfjs-backend-wasm/mobilenet-v2-bench.svg | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tfjs-backend-wasm/README.md b/tfjs-backend-wasm/README.md index db6ce2571a1..7ffe60ae636 100644 --- a/tfjs-backend-wasm/README.md +++ b/tfjs-backend-wasm/README.md @@ -101,7 +101,7 @@ CPU backend, and ~5.3-7.7X slower than the WebGL backend. |--------------------------|-------|-------|-------| | iPhone X | 147.1 | 20.3 | 941.3 | | iPhone XS | 140 | 18.1 | 426.4 | -| Pixel 3 | | | | +| Pixel 3 | 266.2 | 77.3 | 2345.2| | Desktop Linux | 91.5 | 17.1 | 1049 | | Macbook Pro | 98.4 | 19.6 | 893.5 | @@ -111,7 +111,7 @@ CPU backend, and ~5.3-7.7X slower than the WebGL backend. Face detector is a lite model with 0.1M params and ~20M multiply-adds. For this model, the WASM backend is between ~8.2-19.8X faster than the vanilla CPU backend and -comparable to the WebGL backend (up to ~2X faster, or 2X slower, depending on +comparable to the WebGL backend (up to ~1.7X faster, or 2X slower, depending on the device). @@ -120,9 +120,9 @@ the device). |------------------------------|------|-------|-------| | iPhone X | 22.4 | 13.5 | 318 | | iPhone XS | 21.4 | 10.5 | 176.9 | -| Pixel 3 | | | | +| Pixel 3 | 40.7 | 31.8 | 535.2 | | Desktop Linux | 12.6 | 12.7 | 249.5 | -| Macbook Pro | 14.1 | 26.1 | 209.1 | +| Macbook Pro 15 2019 | 13.6 | 22.7 | 209.1 | # FAQ diff --git a/tfjs-backend-wasm/face-detector-bench.svg b/tfjs-backend-wasm/face-detector-bench.svg index 9bb5ef4c958..71528f21f89 100644 --- a/tfjs-backend-wasm/face-detector-bench.svg +++ b/tfjs-backend-wasm/face-detector-bench.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/tfjs-backend-wasm/mobilenet-v2-bench.svg b/tfjs-backend-wasm/mobilenet-v2-bench.svg index 8fc4e1fd18e..ee76f97d41e 100644 --- a/tfjs-backend-wasm/mobilenet-v2-bench.svg +++ b/tfjs-backend-wasm/mobilenet-v2-bench.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 700b639962ede8c13ff67486d9c93a6b1a160b67 Mon Sep 17 00:00:00 2001 From: Daniel Smilkov Date: Tue, 17 Dec 2019 10:45:55 -0500 Subject: [PATCH 5/6] save --- tfjs-core/benchmarks/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index 8b98c0e5b4d..5211d63b771 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -338,7 +338,7 @@

TensorFlow.js Model Benchmark

await sleep(200); await measureAveragePredictTime(); await sleep(200); - if (queryTimerIsEnabled()) { + if (state.backend != 'webgl' || queryTimerIsEnabled()) { await profileKernelTime(); } else { showMsg('Skipping kernel times since query timer extension is not ' + From fd0e81361748c6b733edb764c94e5686ff5e4808 Mon Sep 17 00:00:00 2001 From: Daniel Smilkov Date: Tue, 17 Dec 2019 10:48:39 -0500 Subject: [PATCH 6/6] save --- tfjs-backend-wasm/face-detector-bench.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/face-detector-bench.svg b/tfjs-backend-wasm/face-detector-bench.svg index 71528f21f89..76b8cac229d 100644 --- a/tfjs-backend-wasm/face-detector-bench.svg +++ b/tfjs-backend-wasm/face-detector-bench.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file