-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add benchmark machine
#11198
Add benchmark machine
#11198
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
This reverts commit d4ee982.
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
| pub fn run(&self) -> Result<()> { | ||
| info!("Running machine benchmarks..."); | ||
| let tmp_dir = tempdir()?; | ||
| let info = gather_hwbench(Some(tmp_dir.path())); |
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.
It'd probably be better to modify sc-sysinfo to expose the benchmark_* functions separately and call them one by one here instead of relying the gather_hwbench.
The gather_hwbench is deliberately simple (only takes a path as an argument) and ignores error (if the disk benches fail it'll set their results to None and only print out a warning in the logs) since it's meant to be run at startup to gather the data for telemetry.
Here however it'd be good to 1) have direct access to the errors (which the benchmark_* functions do return), and 2) be able to configure the benchmarks to be able to override the limit of how long they can run and for how many iterations since this subcommand doesn't have the same timing constraints as the telemetry (so we can just add an extra argument to the benchmark_* functions which would allow you to override that).
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.
Yea getting some more configurations in there would be good.
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
|
In the spirit of pits of success, maybe add an extra line in the output if they're running in debug mode warning them that they should only trust the results if they are running in release mode? |
| .map(|s| s as u64) | ||
| } | ||
|
|
||
| pub fn benchmark_sr25519_verify(limit: ExecutionLimit) -> f64 { |
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.
nit: missing doc on public function. Does it need to be public?
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.
Will add 😄
Currently it needs to be public since I call these functions directly. IMHO it would be better to have a gather function which calls all of them and returns a struct,
but thats probably next.
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.
IMHO it would be better to have a
gatherfunction which calls all of them and returns a struct,
Hmm... although the downside of that is that you won't be able to configure them separately (set a different ExecutionLimit for each benchmark), unless you add another struct which will have multiple ExecutionLimits in it, but then if you're going to do that you might as well have them as a separate functions I guess?
(And it might make sense to set different limits on each benchmark because e.g. the disk benchmarks are going to require more time than the memory benchmark to make sure their result isn't noisy, if you absolutely want to minimize their error.)
kianenigma
left a comment
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.
LGTM!
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
|
bot merge |
* Move new_rng to shared code Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add bechmark machine command Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add --no-hardware-benchmarks Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Lockfile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Do not create components if not needed Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Add --no-hardware-benchmarks" This reverts commit d4ee982. * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update Cargo deps Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Switch benchmarks to return f64 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Review fixes Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Hide command until completed Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use concrete rand implementation Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Put clobber into a function Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add comment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update cargo to match polkadot Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove doc that does not format in the console Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Limit benchmark by time Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add ExecutionLimit and make function infallible Signed-off-by: Oliver Tale-Yazdi <[email protected]> * CI Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add doc Signed-off-by: Oliver Tale-Yazdi <[email protected]>
* Move new_rng to shared code Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add bechmark machine command Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add --no-hardware-benchmarks Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Lockfile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Do not create components if not needed Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Add --no-hardware-benchmarks" This reverts commit d4ee982. * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update Cargo deps Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Switch benchmarks to return f64 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Review fixes Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Hide command until completed Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use concrete rand implementation Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Put clobber into a function Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add comment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update cargo to match polkadot Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove doc that does not format in the console Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Limit benchmark by time Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add ExecutionLimit and make function infallible Signed-off-by: Oliver Tale-Yazdi <[email protected]> * CI Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add doc Signed-off-by: Oliver Tale-Yazdi <[email protected]>
👉 Please put feedback about this command either in here or ping me on matrix
@oliver.tale-yazdi:matrix.parity.io.First version of a
benchmark machinecommand using thesc-sysinfocrate (:pray: @koute).@shawntabrizi wanted to have a MVP version handy.
Changes:
benchmark machinecommandnew_rngtoshared--no-hardware-benchmarkswhere applicableOutput:
Next steps:
productionsc-sysinfo(eg. total time, reps, input len)Polkadot companion: paritytech/polkadot#5326
Cumulus companion: paritytech/cumulus#1172