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

[browserstack benchmark tool] Use stream to write to outfile #6750

Merged
merged 6 commits into from
Aug 18, 2022

Conversation

Linchenn
Copy link
Collaborator

@Linchenn Linchenn commented Aug 12, 2022

Previously, if outfile is set and run benchmarks for multiple models, the output file records the benchmark results only for the last one model, because the program keeps overwriting the output file.

This PR:

  1. Adds initialize writing and finalize writing functions for writing output files. (Adds Ctrl+C listener to make sure finalize writing function is always executed.)
  2. Use JSONStream to append benchmark results whenever receiving results from BrowserStack.

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

Copy link
Collaborator

@lina128 lina128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job identifying the hard to find bug and fix it! LGTM

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @pyu10055)

Copy link
Collaborator

@pyu10055 pyu10055 left a 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.
Reviewable status: :shipit: complete! 2 of 1 approvals obtained

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @Linchenn)


e2e/benchmarks/browserstack-benchmark/app.js line 400 at r1 (raw file):

  let file;
   if (cliArgs?.outfile === 'html') {
     await fs.writeFile('./benchmark_results.js', 'const a = ', 'utf8', err => {

why writing const a = to the file?

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 2 of 1 approvals obtained

Copy link
Collaborator Author

@Linchenn Linchenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 2 of 1 approvals obtained


e2e/benchmarks/browserstack-benchmark/app.js line 400 at r1 (raw file):

Previously, pyu10055 (Ping Yu) wrote…

why writing const a = to the file?

This has been updated to const benchmarkResults = .

@Linchenn Linchenn merged commit 59af8c2 into tensorflow:master Aug 18, 2022
@Linchenn Linchenn deleted the fixWrite branch August 18, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants