Skip to content

Commit

Permalink
wb | profiles playground with "calibrate-blockmem-x1.5" and "calibrat…
Browse files Browse the repository at this point in the history
…e-blockmem-x2"
  • Loading branch information
fmaste committed Feb 25, 2025
1 parent d81f509 commit b9b7269
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ include wb_profiles.mk
$(eval $(call define_profile_targets, $(LOCAL_PROFILES)))
$(eval $(call define_profile_targets_nomadcloud,$(CLOUD_PROFILES)))

# Dynamic local/supervisor profile targets.
playground-%:
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName $*-${ERA} --argstr backendName supervisor

###
### Misc
###
Expand Down
3 changes: 3 additions & 0 deletions bench/cardano-profile/cardano-profile.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ build-type: Simple
data-files: data/all-profiles-coay.json
data/genesis/epoch-timeline.json
data/genesis/overlays/*.json
data/genesis/overlays/budget/block/memory/*.json
data/genesis/overlays/budget/block/steps/*.json
data/presets/*.json
data/test/ci-test-bage.json
data/test/default-coay/*.json
Expand Down Expand Up @@ -61,6 +63,7 @@ library
, Cardano.Benchmarking.Profile.Extra.Scaling
, Cardano.Benchmarking.Profile.Extra.Voting
, Cardano.Benchmarking.Profile.NodeSpecs
, Cardano.Benchmarking.Profile.Playground
, Cardano.Benchmarking.Profile.Primitives
, Cardano.Benchmarking.Profile.Vocabulary
, Cardano.Benchmarking.Profile.Types
Expand Down
20 changes: 10 additions & 10 deletions bench/cardano-profile/data/all-profiles-coay.json
Original file line number Diff line number Diff line change
Expand Up @@ -45215,7 +45215,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"doublebudget"
"budget/block/steps/double"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -45664,7 +45664,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"stepshalf"
"budget/block/steps/half"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -60436,7 +60436,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"doublebudget"
"budget/block/steps/double"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -60871,7 +60871,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"stepshalf"
"budget/block/steps/half"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -61937,7 +61937,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"doublebudget"
"budget/block/steps/double"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -62386,7 +62386,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"stepshalf"
"budget/block/steps/half"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -63466,7 +63466,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"doublebudget"
"budget/block/steps/double"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -63915,7 +63915,7 @@
"pparamsEpoch": 300,
"pparamsOverlays": [
"v8-preview",
"stepshalf"
"budget/block/steps/half"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -68230,7 +68230,7 @@
"pool_coin": 1000000000000000,
"pparamsEpoch": 507,
"pparamsOverlays": [
"doublebudget"
"budget/block/steps/double"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down Expand Up @@ -69131,7 +69131,7 @@
"pool_coin": 1000000000000000,
"pparamsEpoch": 507,
"pparamsOverlays": [
"stepshalf"
"budget/block/steps/half"
],
"shelley": {
"activeSlotsCoeff": 0.05,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"alonzo": {
"maxBlockExUnits": {
"exUnitsMem": 124000000
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"alonzo": {
"maxBlockExUnits": {
"exUnitsMem": 93000000
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE OverloadedStrings #-}

--------------------------------------------------------------------------------

module Cardano.Benchmarking.Profile.Playground (
profilesNoEraPlayground
) where

--------------------------------------------------------------------------------

import Prelude
import Data.Function ((&))
-- Package: aeson.
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.KeyMap as KeyMap
-- Package: self.
import qualified Cardano.Benchmarking.Profile.Builtin.Miniature as M
import qualified Cardano.Benchmarking.Profile.Primitives as P
import qualified Cardano.Benchmarking.Profile.Types as Types
import qualified Cardano.Benchmarking.Profile.Vocabulary as V

--------------------------------------------------------------------------------

-- Corrections to fill the block memory budget with 4 txs per block.
calibrate15x :: Aeson.Object
calibrate15x =
KeyMap.fromList [
("genesis", Aeson.Object $ KeyMap.fromList [
("alonzo", Aeson.Object $ KeyMap.fromList [
("maxTxExUnits", Aeson.Object $ KeyMap.fromList [
("exUnitsMem", Aeson.Number 23250000)
])
])
])
, ("generator", Aeson.Object $ KeyMap.fromList [
-- "ns":"Mempool.RejectedTx","data":{"err":{"fee":1000000,"kind":"FeeTooSmallUTxO","minimum":1892175}
("tx_fee", Aeson.Number 1892175)
])
]

-- Corrections to fill the block memory budget with 4 txs per block.
calibrate2x :: Aeson.Object
calibrate2x =
KeyMap.fromList [
("genesis", Aeson.Object $ KeyMap.fromList [
("alonzo", Aeson.Object $ KeyMap.fromList [
("maxTxExUnits", Aeson.Object $ KeyMap.fromList [
("exUnitsMem", Aeson.Number 31000000)
])
])
])
, ("generator", Aeson.Object $ KeyMap.fromList [
-- "ns":"Mempool.RejectedTx","data":{"err":{"fee":2463202,"kind":"FeeTooSmallUTxO","minimum":2463246}
("tx_fee", Aeson.Number 2463246)
])
]

profilesNoEraPlayground :: [Types.Profile]
profilesNoEraPlayground =
------------------------------------------------------------------------------
-- ci-bench like: 2 nodes, FixedLoaded and "--shutdown-on-block-synced 15"
------------------------------------------------------------------------------
let ciBenchLike =
P.empty & M.base . P.dreps 0
. P.uniCircle . P.loopback . V.hosts 2
. M.benchDuration
. P.traceForwardingOn . P.newTracing
. P.p2pOn
. V.clusterDefault -- TODO: "cluster" should be "null" here.
. V.genesisVariantVoltaire
-- Cloud Plutus workload
. V.plutusTypeLoop . V.plutusBase . P.tps 0.85
. P.analysisSizeSmall
mem15x = P.budgetBlockMemoryOneAndAHalf
mem2x = P.budgetBlockMemoryDouble
in [
-- Voltaire (like cloud profiles)
-- Baseline.
ciBenchLike & P.name "calibrate-volt"
, ciBenchLike & P.name "calibrate-blockmem-x1.5-volt" . mem15x
, ciBenchLike & P.name "calibrate-blockmem-x1.5-volt-fill" . mem15x . P.overlay calibrate15x
, ciBenchLike & P.name "calibrate-blockmem-x2-volt" . mem2x
, ciBenchLike & P.name "calibrate-blockmem-x2-volt-fill" . mem2x . P.overlay calibrate2x
]
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ module Cardano.Benchmarking.Profile.Primitives (
, pparamsEpoch
-- Overlays to use.
, v8Preview, v9Preview, v10Preview
, stepHalf, doubleBudget, blocksize64k
-- Budget overlays:
-- -- Block:
-- -- -- Steps:
, stepHalf, doubleBudget
-- -- -- Memory:
, budgetBlockMemoryOneAndAHalf, budgetBlockMemoryDouble
-- -- TX:

-- Others
, blocksize64k
, voting
-- Customize the "shelley", "alonzo" or "conway" properties.
, shelley, alonzo, conway
Expand Down Expand Up @@ -430,11 +439,25 @@ v9Preview = helper_addOverlayOrDie "v9-preview"
v10Preview :: HasCallStack => Types.Profile -> Types.Profile
v10Preview = helper_addOverlayOrDie "v10-preview"

-- Budget:

-- Steps:

-- budgetBlockStepsHalf
stepHalf :: HasCallStack => Types.Profile -> Types.Profile
stepHalf = helper_addOverlayOrDie "stepshalf"
stepHalf = helper_addOverlayOrDie "budget/block/steps/half"

-- budgetBlockStepsDouble
doubleBudget :: HasCallStack => Types.Profile -> Types.Profile
doubleBudget = helper_addOverlayOrDie "doublebudget"
doubleBudget = helper_addOverlayOrDie "budget/block/steps/double"

-- Memory

budgetBlockMemoryOneAndAHalf :: HasCallStack => Types.Profile -> Types.Profile
budgetBlockMemoryOneAndAHalf = helper_addOverlayOrDie "budget/block/memory/oneandahalf"

budgetBlockMemoryDouble :: HasCallStack => Types.Profile -> Types.Profile
budgetBlockMemoryDouble = helper_addOverlayOrDie "budget/block/memory/double"

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

0 comments on commit b9b7269

Please sign in to comment.