-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[browserstack benchmark tool] Enable code snippet benchmark #6704
Conversation
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 @Linchenn and @pyu10055)
e2e/benchmarks/browserstack-benchmark/benchmark_models.js
line 96 at r1 (raw file):
const filter = tf.randomUniform([3, 3, 3, 3], 0, 1000); const predict = () => { /* Please put your code snippet to benchmark here. */
This will require code change to test custom written code snippet, right? In the future, we can consider dynamic load JS file to test custom written code. Just a thought.
Code quote:
* Please put your code snippet to benchmark here.
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 @lina128 and @pyu10055)
e2e/benchmarks/browserstack-benchmark/benchmark_models.js
line 96 at r1 (raw file):
Previously, lina128 (Na Li) wrote…
This will require code change to test custom written code snippet, right? In the future, we can consider dynamic load JS file to test custom written code. Just a thought.
Yes, this requires code changes.
Great catch, loading JS file would support users to input code snippet on the UI (users input code snippet (as string) on UI -> the app.js
could generate a JS file with the code snippet -> the benchmark_model.js
could call functions from the newly generated JS file).
Another way to support inputting code snippet on the UI is that we could generate benchmark_model.js
file directly with customized code snippet.
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.
Reviewed 2 of 2 files at r1, 1 of 1 files at r2, 2 of 2 files at r3, 2 of 2 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @lina128 and @Linchenn)
e2e/benchmarks/browserstack-benchmark/benchmark_models.js
line 96 at r1 (raw file):
Previously, Linchenn wrote…
Yes, this requires code changes.
Great catch, loading JS file would support users to input code snippet on the UI (users input code snippet (as string) on UI -> the
app.js
could generate a JS file with the code snippet -> thebenchmark_model.js
could call functions from the newly generated JS file).Another way to support inputting code snippet on the UI is that we could generate
benchmark_model.js
file directly with customized code snippet.
can we do similar things as our API website, where users can edit and run code snippet?
e2e/benchmarks/browserstack-benchmark/benchmark_models.js
line 106 at r3 (raw file):
}; // Wramp up.
warm up
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 @lina128 and @pyu10055)
e2e/benchmarks/browserstack-benchmark/benchmark_models.js
line 96 at r1 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
can we do similar things as our API website, where users can edit and run code snippet?
yes, in the next step, users could edit code snippets for both benchmarking and environment configuring.
I also tried the following codes:
const a = [];
eval('a.push(1)'); // It works and `a` becomes `[1]`;
This means, the codeSnippet-string within in eval
function is run under the context of eval
. As a result, the 'code snippet' feature could also be introduced to our online local benchmark tool by calling eval
.
e2e/benchmarks/browserstack-benchmark/benchmark_models.js
line 106 at r3 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
warm up
Done.
This PR enable code snippet benchmark.
If you have a code snippet and want to benchmark on multiple devices, you could follow the steps:
Step1: Add your code snippet
Open
e2e/benchmarks/browserstack-benchmark/benchmark_models.js
and updatebenchmarkCodeSnippet
with your code snippet.Step2: Run the server and benchmark
codeSnippet
inmodel name
:Example usage
This already populates code snippet to benchmark
conv2d
and got the following results:To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.
This change is