You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each of these should inherit directly from BenchmarkReporter and define a nice interface for the respective IO to be reusable or even useable out of the box for most users.
Pseudocode example:
classFileIOReporter:
defwrite_record(self, r):
...
defwrite_record_batched(self, rb):
...
defread_record(self):
...
defopen(self, fp):
...
defclose(self, fp):
...
classJSONFileReporter(FileIOReporter):
defopen(self, fp):
withopen(fp, "r") asf:
returnjson.load(f)
defclose(self, fp):
fp.close()
classYAMLFileReporter(FileIOReporter):
... # same thing as for JSON, but use YAML read/write APIs.
Objective: Implement the base BenchmarkReporter's interface for a few specific families of reporters, not every reporter by itself.
Bonus: Maybe the IO (open, close) can even become a mixin that makes specific file or database reporters trivial by just acquiring and releasing a handle to write to.
The text was updated successfully, but these errors were encountered:
Thanks for the question. This is good for fetching historical data that you've already saved, for example like this (pseudocode):
importnnbenchrunner=nnbench.BenchmarkRunner()
res=runner.run(...)
reporter=MyReporter()
historical=reporter.read_record("earlier.json") # <- this needs dynamic arguments, like a filename in the flatfile case, or a query in the database case.reporter.report(historical, res, ...)
Is this sensible to you? None of this is set in stone yet, so I'm happy to take suggestions.
Each of these should inherit directly from
BenchmarkReporter
and define a nice interface for the respective IO to be reusable or even useable out of the box for most users.Pseudocode example:
Objective: Implement the base BenchmarkReporter's interface for a few specific families of reporters, not every reporter by itself.
Bonus: Maybe the IO (open, close) can even become a mixin that makes specific file or database reporters trivial by just acquiring and releasing a handle to write to.
The text was updated successfully, but these errors were encountered: