-
Notifications
You must be signed in to change notification settings - Fork 622
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
fix(tool): fix runtime-params-estimator #3601 #3616
Conversation
@evgenykuzyakov @nearmax I realized that some tests like storage_remove_10b_key_10b_value_1k and delete_account, warm up txns is questionable because warm up txns could delete too many of them, and cause storage_remove_10b_key_10b_value_1k become many no-ops that underestimate delete cost. Should these metrics always skip warm up iter? |
We need warmup iter to compile a contract to cache. Otherwise we don't need warmup. It should be fine to call |
I see. But I mean a different warmup: the one inside measure_transactions function by calling same
My concern is that deleting too many key-value pairs in storage_remove_10b_key_10b_value_1k will cause not many accounts have keys to remove, cause this cost underestimate. Also, key-value removed in warm up is random, two runs of param-estimator can have two different case (assume iter_per_block=10, warmup_iters_per_block=10, block_size=100):
|
We don't use warmup for the |
Got it, so warmup_iter is 0, and it's not a problem |
Fixed some issues and rerun yesterday evening, but still not finished after more than 12 hours, maybe set this size of key value to all active accounts are too expensive 🤔 still not finish now, and runtime-params-estimate ci is failed due to time out, real runtime-param-estimator on instance is running and not stucked, just take much longer time. Given this is too slow, a work around maybe record what accounts have write_x_key_y_value_1k and measure delete_key on these accounts instead of random. |
I just examine code again, it's not all active accounts (20K) used in deploy code, but only 300, and randomly selected 2 account, not 100, from 300 to write key, value, so the bug mentioned in this PR still exist and fix in this PR is still valid: adding write all key values to 300 accounts, so randomly selected two account can guarantee to have account. But, write all key values to these 300 accounts should not take long, which means runtime param estimator might already very slow before this PR because of some reason, I'm confirming this by run master on runtime-param-estimator Note:
only when
This cause we only randomly choose two account to do all host function measures, which I assume it's the designed behavior. |
master still runs in around 6 hours, so the slowdown is indeed because of 300 write_x_key_y_value_1k, so i make a change to only write_x_key_y_value_1k to account that going to be measure read or remove, instead of do so on 300 accounts, hopefully this will bring execution time back to 6 hours. |
Can you also take a look why |
OK. The numbers above is depreciated as i changed to only set key value to the account that is going to read and delete key,value lazily, will look if new number is still this case. |
@evgenykuzyakov addressed all comments, ptal |
@willemneal @olonho please review |
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
Note that test fails with
|
This happen quite often after we switch to use plain cargo test workspace in ci. I asked SRE team to take a look. (For sure unrelated to this PR because all change is in runtime-param-estimator :) |
Fix #3601. get new numbers which is very different from existing genesis.json, but reasonable compare to run runtime-param-estimator from master branch
Test Plan
runtime-param-estimator works, no #3598 and #3601. And every delete storage actually delete, not noop.