-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Executor benchmark revamps #15127
Executor benchmark revamps #15127
Conversation
⏱️ 9h 47m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
@@ -204,7 +207,7 @@ pub fn new_test_context_inner( | |||
rng, | |||
root_key, | |||
validator_owner, | |||
Box::new(BlockExecutor::<AptosVM>::new(db_rw)), | |||
Box::new(BlockExecutor::<AptosVMBlockExecutor>::new(db_rw)), |
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.
ignore me: I like AptosVm
, AptosVmBlockExecutor
better, can't help saying it.
)), | ||
)); | ||
vm_executor | ||
.execute_and_state_checkpoint( |
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.
Maybe open and use this instead so we can know the txn succeeds and it works for the entire execution workflow?
fn execute_block( |
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.
okay I see you had the code to check the results commented out..
#[default] | ||
AptosVMWithBlockSTM, | ||
NativeLooseSpeculative, | ||
PtxExecutor, |
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.
does it even still work, btw?
transactions: ExecutableTransactions, | ||
state_view: CachedStateView, | ||
onchain_config: BlockExecutorConfigFromOnchain, | ||
append_state_checkpoint_to_block: Option<HashValue>, | ||
) -> Result<ExecutionOutput> { | ||
let _timer = BLOCK_EXECUTOR_INNER_EXECUTE_BLOCK.start_timer(); |
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.
looks like this measures almost exactly the same with BLOCK_EXECUTOR_EXECUTE_BLOCK excpet it measures only when the vm is AptosVM?
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.
for native VMs this is very different, but that is in a separate PR, so motivation here is not as clear
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.
Without seeing your follow up PR, I feel you might want to measure at an even inner place?
-- DoGetExecutionOutput::* parses the VM raw output and will be doing the speculative state (not the smt) update soon.
enum BlockExecutorTypeOpt { | ||
#[default] | ||
AptosVMWithBlockSTM, | ||
NativeLooseSpeculative, |
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.
I have to say the meaning of "speculative" isn't clear here, and I don't have a better suggestion for now -_-
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.
I'll add the comments to all variants here, but I was surprised to see that current implementation was replacing BlockSTM as well, not just AptosVM - so wanted to be more clearer in name.
confusing name is better than name that suggests wrong thing - as folks will ask around if they don't understand it :)
but open to all name suggestions. These are all the names:
AptosVMWithBlockSTM,
NativeVMWithBlockSTM,
NativeLooseSpeculative,
NativeValueCacheLooseSpeculative,
NativeNoStorageLooseSpeculative,
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.
Please please please add documentation to all variants here: it is not clear at all without context what are those. Also, as a nit:
BlockSTMWith...VM
reads better? Block executor which uses some particular VM impl?
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.
already in #15152, adding here as well
b6f1484
to
e350fa7
Compare
@@ -138,7 +138,7 @@ impl AptosTransactionOutput { | |||
self.committed_output.get().unwrap() | |||
} | |||
|
|||
fn take_output(mut self) -> TransactionOutput { | |||
pub fn take_output(mut self) -> TransactionOutput { |
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: maybe we should document these if we make these interface public because if output is not set, here we panic?
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.
I'll move this to a PR that uses it, and we can see there
aptos-move/aptos-vm/src/counters.rs
Outdated
@@ -13,6 +13,7 @@ const BLOCK_EXECUTION_TIME_BUCKETS: [f64; 16] = [ | |||
0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.0, 1.25, 1.5, 1.75, 2.0, 3.0, 4.0, 5.0, | |||
]; | |||
|
|||
// TODO - disambiguate against BLOCK_EXECUTOR_EXECUTE_BLOCK |
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.
Add more context? Issue number? Github username for person to fix this?
// metric name | ||
"aptos_executor_block_executor_inner_execute_block_seconds", | ||
// metric description | ||
"The time spent in seconds of BlockExecutor inner block execution in Aptos executor", |
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.
This sentence just doesn't make sense?😂
} | ||
|
||
impl BlockPreparationStage { | ||
pub fn new(num_shards: usize, partitioner_config: &dyn PartitionerConfig) -> Self { | ||
pub fn new( | ||
sig_verify_num_threads: usize, |
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.
super nit: num_sig_verify_threads
?
@@ -30,24 +30,24 @@ use std::{ | |||
#[derive(Debug, Derivative)] | |||
#[derivative(Default)] | |||
pub struct PipelineConfig { | |||
pub delay_execution_start: bool, | |||
pub delay_pipeline_start: bool, |
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.
I really think it would be great to have comments about these and below?
execution/executor/src/metrics.rs
Outdated
// metric description | ||
"The time spent in seconds of vm block execution in Aptos executor", | ||
"The time spent in seconds of BlockExecutor block execution in Aptos executor", |
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.
This seems duplicated with what we have in counters.rs
?. The comment surely is (and is also not clear)
pub fn get_concurrency_level() -> usize { | ||
match NATIVE_EXECUTOR_CONCURRENCY_LEVEL.get() { | ||
Some(concurrency_level) => *concurrency_level, | ||
None => 32, |
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.
We probably want to cap it to number of cores?
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.
changed default to 1. but otherwise - test can run with higher number of threads than cores, if useful
e350fa7
to
6bc2844
Compare
eded498
to
cc94b3b
Compare
6bc2844
to
5855472
Compare
cc94b3b
to
b905dd7
Compare
5855472
to
7486aa1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
122a6ca
to
cdf9d3a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
449b401
to
88332b1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
88332b1
to
75cdcc5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
Followup PR will introduce different native executors.
How Has This Been Tested?
performance benchmark
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist