Skip to content

Commit b9b7269

Browse files
committed
wb | profiles playground with "calibrate-blockmem-x1.5" and "calibrate-blockmem-x2"
1 parent d81f509 commit b9b7269

File tree

9 files changed

+142
-13
lines changed

9 files changed

+142
-13
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ include wb_profiles.mk
8282
$(eval $(call define_profile_targets, $(LOCAL_PROFILES)))
8383
$(eval $(call define_profile_targets_nomadcloud,$(CLOUD_PROFILES)))
8484

85+
# Dynamic local/supervisor profile targets.
86+
playground-%:
87+
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName $*-${ERA} --argstr backendName supervisor
88+
8589
###
8690
### Misc
8791
###

bench/cardano-profile/cardano-profile.cabal

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ build-type: Simple
1616
data-files: data/all-profiles-coay.json
1717
data/genesis/epoch-timeline.json
1818
data/genesis/overlays/*.json
19+
data/genesis/overlays/budget/block/memory/*.json
20+
data/genesis/overlays/budget/block/steps/*.json
1921
data/presets/*.json
2022
data/test/ci-test-bage.json
2123
data/test/default-coay/*.json
@@ -61,6 +63,7 @@ library
6163
, Cardano.Benchmarking.Profile.Extra.Scaling
6264
, Cardano.Benchmarking.Profile.Extra.Voting
6365
, Cardano.Benchmarking.Profile.NodeSpecs
66+
, Cardano.Benchmarking.Profile.Playground
6467
, Cardano.Benchmarking.Profile.Primitives
6568
, Cardano.Benchmarking.Profile.Vocabulary
6669
, Cardano.Benchmarking.Profile.Types

bench/cardano-profile/data/all-profiles-coay.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -45215,7 +45215,7 @@
4521545215
"pparamsEpoch": 300,
4521645216
"pparamsOverlays": [
4521745217
"v8-preview",
45218-
"doublebudget"
45218+
"budget/block/steps/double"
4521945219
],
4522045220
"shelley": {
4522145221
"activeSlotsCoeff": 0.05,
@@ -45664,7 +45664,7 @@
4566445664
"pparamsEpoch": 300,
4566545665
"pparamsOverlays": [
4566645666
"v8-preview",
45667-
"stepshalf"
45667+
"budget/block/steps/half"
4566845668
],
4566945669
"shelley": {
4567045670
"activeSlotsCoeff": 0.05,
@@ -60436,7 +60436,7 @@
6043660436
"pparamsEpoch": 300,
6043760437
"pparamsOverlays": [
6043860438
"v8-preview",
60439-
"doublebudget"
60439+
"budget/block/steps/double"
6044060440
],
6044160441
"shelley": {
6044260442
"activeSlotsCoeff": 0.05,
@@ -60871,7 +60871,7 @@
6087160871
"pparamsEpoch": 300,
6087260872
"pparamsOverlays": [
6087360873
"v8-preview",
60874-
"stepshalf"
60874+
"budget/block/steps/half"
6087560875
],
6087660876
"shelley": {
6087760877
"activeSlotsCoeff": 0.05,
@@ -61937,7 +61937,7 @@
6193761937
"pparamsEpoch": 300,
6193861938
"pparamsOverlays": [
6193961939
"v8-preview",
61940-
"doublebudget"
61940+
"budget/block/steps/double"
6194161941
],
6194261942
"shelley": {
6194361943
"activeSlotsCoeff": 0.05,
@@ -62386,7 +62386,7 @@
6238662386
"pparamsEpoch": 300,
6238762387
"pparamsOverlays": [
6238862388
"v8-preview",
62389-
"stepshalf"
62389+
"budget/block/steps/half"
6239062390
],
6239162391
"shelley": {
6239262392
"activeSlotsCoeff": 0.05,
@@ -63466,7 +63466,7 @@
6346663466
"pparamsEpoch": 300,
6346763467
"pparamsOverlays": [
6346863468
"v8-preview",
63469-
"doublebudget"
63469+
"budget/block/steps/double"
6347063470
],
6347163471
"shelley": {
6347263472
"activeSlotsCoeff": 0.05,
@@ -63915,7 +63915,7 @@
6391563915
"pparamsEpoch": 300,
6391663916
"pparamsOverlays": [
6391763917
"v8-preview",
63918-
"stepshalf"
63918+
"budget/block/steps/half"
6391963919
],
6392063920
"shelley": {
6392163921
"activeSlotsCoeff": 0.05,
@@ -68230,7 +68230,7 @@
6823068230
"pool_coin": 1000000000000000,
6823168231
"pparamsEpoch": 507,
6823268232
"pparamsOverlays": [
68233-
"doublebudget"
68233+
"budget/block/steps/double"
6823468234
],
6823568235
"shelley": {
6823668236
"activeSlotsCoeff": 0.05,
@@ -69131,7 +69131,7 @@
6913169131
"pool_coin": 1000000000000000,
6913269132
"pparamsEpoch": 507,
6913369133
"pparamsOverlays": [
69134-
"stepshalf"
69134+
"budget/block/steps/half"
6913569135
],
6913669136
"shelley": {
6913769137
"activeSlotsCoeff": 0.05,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"alonzo": {
3+
"maxBlockExUnits": {
4+
"exUnitsMem": 124000000
5+
}
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"alonzo": {
3+
"maxBlockExUnits": {
4+
"exUnitsMem": 93000000
5+
}
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{-# LANGUAGE Trustworthy #-}
2+
{-# LANGUAGE OverloadedStrings #-}
3+
4+
--------------------------------------------------------------------------------
5+
6+
module Cardano.Benchmarking.Profile.Playground (
7+
profilesNoEraPlayground
8+
) where
9+
10+
--------------------------------------------------------------------------------
11+
12+
import Prelude
13+
import Data.Function ((&))
14+
-- Package: aeson.
15+
import qualified Data.Aeson as Aeson
16+
import qualified Data.Aeson.KeyMap as KeyMap
17+
-- Package: self.
18+
import qualified Cardano.Benchmarking.Profile.Builtin.Miniature as M
19+
import qualified Cardano.Benchmarking.Profile.Primitives as P
20+
import qualified Cardano.Benchmarking.Profile.Types as Types
21+
import qualified Cardano.Benchmarking.Profile.Vocabulary as V
22+
23+
--------------------------------------------------------------------------------
24+
25+
-- Corrections to fill the block memory budget with 4 txs per block.
26+
calibrate15x :: Aeson.Object
27+
calibrate15x =
28+
KeyMap.fromList [
29+
("genesis", Aeson.Object $ KeyMap.fromList [
30+
("alonzo", Aeson.Object $ KeyMap.fromList [
31+
("maxTxExUnits", Aeson.Object $ KeyMap.fromList [
32+
("exUnitsMem", Aeson.Number 23250000)
33+
])
34+
])
35+
])
36+
, ("generator", Aeson.Object $ KeyMap.fromList [
37+
-- "ns":"Mempool.RejectedTx","data":{"err":{"fee":1000000,"kind":"FeeTooSmallUTxO","minimum":1892175}
38+
("tx_fee", Aeson.Number 1892175)
39+
])
40+
]
41+
42+
-- Corrections to fill the block memory budget with 4 txs per block.
43+
calibrate2x :: Aeson.Object
44+
calibrate2x =
45+
KeyMap.fromList [
46+
("genesis", Aeson.Object $ KeyMap.fromList [
47+
("alonzo", Aeson.Object $ KeyMap.fromList [
48+
("maxTxExUnits", Aeson.Object $ KeyMap.fromList [
49+
("exUnitsMem", Aeson.Number 31000000)
50+
])
51+
])
52+
])
53+
, ("generator", Aeson.Object $ KeyMap.fromList [
54+
-- "ns":"Mempool.RejectedTx","data":{"err":{"fee":2463202,"kind":"FeeTooSmallUTxO","minimum":2463246}
55+
("tx_fee", Aeson.Number 2463246)
56+
])
57+
]
58+
59+
profilesNoEraPlayground :: [Types.Profile]
60+
profilesNoEraPlayground =
61+
------------------------------------------------------------------------------
62+
-- ci-bench like: 2 nodes, FixedLoaded and "--shutdown-on-block-synced 15"
63+
------------------------------------------------------------------------------
64+
let ciBenchLike =
65+
P.empty & M.base . P.dreps 0
66+
. P.uniCircle . P.loopback . V.hosts 2
67+
. M.benchDuration
68+
. P.traceForwardingOn . P.newTracing
69+
. P.p2pOn
70+
. V.clusterDefault -- TODO: "cluster" should be "null" here.
71+
. V.genesisVariantVoltaire
72+
-- Cloud Plutus workload
73+
. V.plutusTypeLoop . V.plutusBase . P.tps 0.85
74+
. P.analysisSizeSmall
75+
mem15x = P.budgetBlockMemoryOneAndAHalf
76+
mem2x = P.budgetBlockMemoryDouble
77+
in [
78+
-- Voltaire (like cloud profiles)
79+
-- Baseline.
80+
ciBenchLike & P.name "calibrate-volt"
81+
, ciBenchLike & P.name "calibrate-blockmem-x1.5-volt" . mem15x
82+
, ciBenchLike & P.name "calibrate-blockmem-x1.5-volt-fill" . mem15x . P.overlay calibrate15x
83+
, ciBenchLike & P.name "calibrate-blockmem-x2-volt" . mem2x
84+
, ciBenchLike & P.name "calibrate-blockmem-x2-volt-fill" . mem2x . P.overlay calibrate2x
85+
]

bench/cardano-profile/src/Cardano/Benchmarking/Profile/Primitives.hs

+26-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ module Cardano.Benchmarking.Profile.Primitives (
4242
, pparamsEpoch
4343
-- Overlays to use.
4444
, v8Preview, v9Preview, v10Preview
45-
, stepHalf, doubleBudget, blocksize64k
45+
-- Budget overlays:
46+
-- -- Block:
47+
-- -- -- Steps:
48+
, stepHalf, doubleBudget
49+
-- -- -- Memory:
50+
, budgetBlockMemoryOneAndAHalf, budgetBlockMemoryDouble
51+
-- -- TX:
52+
53+
-- Others
54+
, blocksize64k
4655
, voting
4756
-- Customize the "shelley", "alonzo" or "conway" properties.
4857
, shelley, alonzo, conway
@@ -430,11 +439,25 @@ v9Preview = helper_addOverlayOrDie "v9-preview"
430439
v10Preview :: HasCallStack => Types.Profile -> Types.Profile
431440
v10Preview = helper_addOverlayOrDie "v10-preview"
432441

442+
-- Budget:
443+
444+
-- Steps:
445+
446+
-- budgetBlockStepsHalf
433447
stepHalf :: HasCallStack => Types.Profile -> Types.Profile
434-
stepHalf = helper_addOverlayOrDie "stepshalf"
448+
stepHalf = helper_addOverlayOrDie "budget/block/steps/half"
435449

450+
-- budgetBlockStepsDouble
436451
doubleBudget :: HasCallStack => Types.Profile -> Types.Profile
437-
doubleBudget = helper_addOverlayOrDie "doublebudget"
452+
doubleBudget = helper_addOverlayOrDie "budget/block/steps/double"
453+
454+
-- Memory
455+
456+
budgetBlockMemoryOneAndAHalf :: HasCallStack => Types.Profile -> Types.Profile
457+
budgetBlockMemoryOneAndAHalf = helper_addOverlayOrDie "budget/block/memory/oneandahalf"
458+
459+
budgetBlockMemoryDouble :: HasCallStack => Types.Profile -> Types.Profile
460+
budgetBlockMemoryDouble = helper_addOverlayOrDie "budget/block/memory/double"
438461

439462
-- used to manually reduce block size for e.g. Conway; has to be applied *AFTER* any v?-preview overlay.
440463
blocksize64k :: HasCallStack => Types.Profile -> Types.Profile

0 commit comments

Comments
 (0)