feat(perf): Separate two configurable warmups 91/42591/5
authorVratko Polak <[email protected]>
Wed, 2 Apr 2025 16:12:11 +0000 (18:12 +0200)
committerVratko Polak <[email protected]>
Wed, 2 Apr 2025 16:12:11 +0000 (18:12 +0200)
+ First starts disabled, low-rate, to avoid flooding in some labs.
+ Second starts enabled, max-rate, to avoid unsent packets by TRex.
 + The one in MLRsearch Python library is no longer used.
+ Both warmups are called directly, as they apply also to non-VPP DUTs.
 - Hoststack traffic is not covered yet.
- Not deleting infra-warmup action yet, downstream may be using it.

Change-Id: I72036d0dec5e8e94f5e7cec4692e4ebb07b1ec69
Signed-off-by: Vratko Polak <[email protected]>
resources/libraries/python/Constants.py
resources/libraries/python/TrafficGenerator.py
resources/libraries/robot/performance/performance_actions.robot
resources/libraries/robot/performance/performance_utils.robot
resources/libraries/robot/performance/performance_vars.robot

index 443bdfc..f2191a9 100644 (file)
@@ -269,6 +269,18 @@ class Constants:
     # Whether to use latency streams in main search trials.
     PERF_USE_LATENCY = get_pessimistic_bool_from_env("PERF_USE_LATENCY")
 
+    # Whether to apply low-load trial to avoid flooding other machines.
+    INFRA_WARMUP_DURATION = get_float_from_env("INFRA_WARMUP_DURATION", 0)
+
+    # Load just high enough to show all MAC addresses.
+    INFRA_WARMUP_RATE = get_float_from_env("INFRA_WARMUP_RATE", 300.0)
+
+    # Whether to warm-up the traffic generator with high load.
+    TG_WARMUP_DURATION = get_float_from_env("TG_WARMUP_DURATION", 1.0)
+
+    ## TG warmup load tweaking should not be needed, default max rate is best.
+    #TG_WARMUP_RATE = get_float_from_env("TG_WARMUP_RATE")
+
     # Duration of one latency-specific trial in NDRPDR test.
     PERF_TRIAL_LATENCY_DURATION = get_float_from_env(
         "PERF_TRIAL_LATENCY_DURATION", 5.0
index ae01f8d..fe9db3c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -1590,7 +1590,7 @@ class OptimizedSearch:
         config.min_load = min_load
         config.max_load = max_load
         config.search_duration_max = search_duration_max
-        config.warmup_duration = 1.0
+        config.warmup_duration = 0.0
         algorithm = MultipleLossRatioSearch(config)
         results = algorithm.search(measurer=tg_instance, debug=logger.debug)
         return [results[goal] for goal in goals]
index c7d7776..9ef3f56 100644 (file)
@@ -63,6 +63,7 @@
 | | ... | rate=${telemetry_rate} | export=${False}
 | | Stop traffic on tg
 
+| # TODO: Delete this keyword (unused in fd.io) when downstream stops using it.
 | Additional Statistics Action For infra-warmup
 | | [Documentation]
 | | ... | Additional Statistics Action for infra warmup.
index 4211486..899bbb5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2025 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -31,6 +31,9 @@
 | Documentation
 | ... | Performance suite keywords - utilities to find and verify NDR and PDR.
 | ... | See performance_vars.robot for values accessed via there.
+| ... | All top-level keywords call infra warmup,  all except MRR (and iperf)
+| ... | also call TG warmup. MRR has early runtime trial at max rate,
+| ... | so it does not need separate TG warmup.
 
 *** Variables ***
 | # Variable holding multiplicator of main heap size. By default it is set to 1
 | ${heap_size_mult}= | ${1}
 
 *** Keywords ***
+| Perform Infra Warmup
+| | [Documentation]
+| | ... | Optional trial at low load, needed to prevent flooding in some labs.
+| | ... | This is skipped if duration is zero, default for isolated labs.
+| |
+| | ... | See documentation of the called keyword for required test variables.
+| |
+| | ${duration} = | Get Infra Warm Up Duration
+| | Return From Keyword If | not ${duration}
+| | ${rate} = | Get Infra Warm Up Rate
+| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${traffic_directions} = | Get Traffic Directions
+| | ${transaction_duration} = | Get Transaction Duration
+| | ${transaction_scale} = | Get Transaction Scale
+| | ${transaction_type} = | Get Transaction Type
+| | Send traffic on tg
+| | ... | duration=${duration}
+| | ... | rate=${rate}
+| | ... | frame_size=${frame_size}
+| | ... | traffic_profile=${traffic_profile}
+| | ... | async_call=${False}
+| | ... | ppta=${ppta}
+| | ... | use_latency=${False}
+| | ... | traffic_directions=${traffic_directions}
+| | ... | transaction_duration=${transaction_duration}
+| | ... | transaction_scale=${transaction_scale}
+| | ... | transaction_type=${transaction_type}
+| | ... | duration_limit=${0.0}
+| | ... | ramp_up_duration=${0}
+| | ... | ramp_up_rate=${0}
+
+| Perform Tg Warmup
+| | [Documentation]
+| | ... | Warmup trial at high load, needed by tests where telemetry is late.
+| |
+| | ... | Some traffic generators need additional warmup at high load,
+| | ... | otherwise they suffer from too much unsent packets,
+| | ... | destabilizing the tests (soak) sensitive to first search trial result.
+| | ... | This is skipped if duration is zero, useful for traffic generators
+| | ... | that are known to never need such a warmup.
+| |
+| | ... | See documentation of the called keyword for required test variables.
+| |
+| | # TODO: Check if low-rate is enough to avoid unsent packets.
+| | # TODO: If it is, figure out how to skip tg warmup if infra warmup happened.
+| |
+| | ${duration} = | Get Tg Warm Up Duration
+| | Return From Keyword If | not ${duration}
+| | ${rate} = | Get Tg Warm Up Rate
+| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${traffic_directions} = | Get Traffic Directions
+| | ${transaction_duration} = | Get Transaction Duration
+| | ${transaction_scale} = | Get Transaction Scale
+| | ${transaction_type} = | Get Transaction Type
+| | Send traffic on tg
+| | ... | duration=${duration}
+| | ... | rate=${rate}
+| | ... | frame_size=${frame_size}
+| | ... | traffic_profile=${traffic_profile}
+| | ... | async_call=${False}
+| | ... | ppta=${ppta}
+| | ... | use_latency=${False}
+| | ... | traffic_directions=${traffic_directions}
+| | ... | transaction_duration=${transaction_duration}
+| | ... | transaction_scale=${transaction_scale}
+| | ... | transaction_type=${transaction_type}
+| | ... | duration_limit=${0.0}
+| | ... | ramp_up_duration=${0}
+| | ... | ramp_up_rate=${0}
+
 | Find critical load using PLRsearch
 | | [Documentation]
 | | ... | Find boundaries for troughput (of hardcoded target loss ratio)
 | | ${transaction_scale} = | Get Transaction Scale
 | | ${transaction_type} = | Get Transaction Type
 | | ${use_latency} = | Get Use Latency
-| | # TRex needs a warmup to avoid unsent packets at half-max rate.
-| | Send traffic on tg
-| | ... | duration=1.0
-| | ... | rate=${max_rate}
-| | ... | frame_size=${frame_size}
-| | ... | traffic_profile=${traffic_profile}
-| | ... | async_call=${False}
-| | ... | duration_limit=${1.0}
-| | ... | ppta=${ppta}
-| | ... | traffic_directions=${traffic_directions}
-| | ... | transaction_duration=${transaction_duration}
-| | ... | transaction_scale=${transaction_scale}
-| | ... | transaction_type=${transaction_type}
-| | ... | use_latency=False
-| | ... | ramp_up_duration=${0.0}
-| | ... | ramp_up_rate=${0.0}
+| | Perform Infra Warmup
+| | Perform Tg Warmup
 | | # Ready for main search.
 | | ${average} | ${stdev} = | Perform soak search
 | | ... | frame_size=${frame_size}
 | | ${transaction_scale} = | Get Transaction Scale
 | | ${transaction_type} = | Get Transaction Type
 | | ${use_latency} = | Get Use Latency
+| | Perform Infra Warmup
+| | Perform Tg Warmup
 | | ${result} = | Perform MLR Search
 | | ... | frame_size=${frame_size}
 | | ... | traffic_profile=${traffic_profile}
 | | ${transaction_scale} = | Get Transaction Scale
 | | ${transaction_type} = | Get Transaction Type
 | | ${use_latency} = | Get Use Latency
+| | Perform Infra Warmup
+| | Perform Tg Warmup
 | | ${result} = | Perform MLR Search
 | | ... | frame_size=${frame_size}
 | | ... | traffic_profile=${traffic_profile}
 
 | Send traffic at specified rate
 | | [Documentation]
-| | ... | Perform a warmup, show runtime counters during it.
+| | ... | Perform telemetry trials, read results during traffic.
 | | ... | Then send traffic at specified rate, possibly multiple trials.
 | | ... | Show various DUT stats, optionally also packet trace.
 | | ... | Return list of measured receive rates.
 | |
 | | Set Test Variable | ${telemetry_rate} | mrr
 | | Set Test Variable | ${telemetry_export} | ${True}
+| | Perform Infra Warmup
 | | ${results}= | Send iPerf3 traffic at specified rate
 | | ... | ${trial_duration} | ${None} | ${None}
 | | ... | ${trial_multiplicity} | ${traffic_directions}
 
 | Send iPerf3 traffic at specified rate
 | | [Documentation]
-| | ... | Perform a warmup, show runtime counters during it.
+| | ... | Perform telemetry trials, read results during traffic.
 | | ... | Then send traffic at specified rate, possibly multiple trials.
 | | ... | Show various DUT stats, optionally also packet trace.
 | | ... | Return list of measured receive rates.
 | | ${use_latency} = | Get Use Latency
 | | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}"""
 | | ... | cps | pps
+| | Perform Infra Warmup
 | | ${results} = | Send traffic at specified rate
 | | ... | rate=${max_rate}
 | | ... | trial_duration=${trial_duration}
index 1bab107..5eacb43 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
 | | ${disable_latency} = | Get Variable Value | \${disable_latency} | ${False}
 | | Return From Keyword | ${disable_latency}
 
+| Get Infra Warmup Duration
+| | [Documentation]
+| | ... | Return value of \${infra_warmup_duration} variable,
+| | ... | if not defined, return ${0.0}, which implies no infra warmup trial.
+| | ... | Note that scale traffic profiles may need higher values than base.
+| |
+| | ... | The return value controls the duration of optional infra warmup trial,
+| | ... | zero means the trial is skipped.
+| | ... | Return type: float.
+| |
+| | ... | *Example:*
+| |
+| | ... | \| \${infra_warmup_duration} = \| Get Infra Warmup Duration \|
+| |
+| | ${duration} = | Get Variable Value | \${infra_warmup_duration} | ${0.0}
+| | Return From Keyword | ${duration}
+
+| Get Infra Warmup Rate
+| | [Documentation]
+| | ... | Return value of \${infra_warmup_rate} variable,
+| | ... | if not defined, return ${300.0}.
+| | ... | Note that scale traffic profiles may need higher values than base.
+| |
+| | ... | The return value controls the rate (TPS unidir) of infra warmup trial,
+| | ... | Return type: float.
+| |
+| | ... | *Example:*
+| |
+| | ... | \| \${infra_warmup_rate} = \| Get Infra Warmup Rate \|
+| |
+| | ${rate} = | Get Variable Value | \${infra_warmup_rate} | ${0.0}
+| | Return From Keyword If | ${rate} | ${rate}
+| | Return From Keyword | ${300.0}
+
 | Get Max Rate
 | | [Documentation]
 | | ... | Return value of \${max_rate} variable,
 | Get Runtime Duration
 | | [Documentation]
 | | ... | Return value of \${runtime_duration} variable,
-| | ... | if not defined return ${1.0}.
+| | ... | if not defined, return ${1.0}.
 | |
 | | ... | The return value controls the duration of runtime trial,
 | | ... | which also acts as a warmup. Usually one second is enough,
 | Get Runtime Rate
 | | [Documentation]
 | | ... | Return value of \${runtime_rate} variable,
-| | ... | if not defined return the max rate.
+| | ... | if not defined, return the max rate.
 | |
 | | ... | The return value controls the rate (TPS unidir) of runtime trial,
 | | ... | which also acts as a warmup. No plans to ever use a different rate,
 | | Return From Keyword If | ${runtime_rate} | ${runtime_rate}
 | | Run Keyword And Return | Get Max Rate
 
+| Get Tg Warmup Duration
+| | [Documentation]
+| | ... | Return value of \${tg_warmup_duration} variable,
+| | ... | if not defined, return ${1.0}, which implies short tg warmup trial.
+| | ... | Note that even scale traffic profiles do not need longer trial.
+| |
+| | ... | The return value controls the duration of tg warmup trial,
+| | ... | zero means the trial is skipped.
+| | ... | Return type: float.
+| |
+| | ... | *Example:*
+| |
+| | ... | \| \${tg_warmup_duration} = \| Get Tg Warmup Duration \|
+| |
+| | ${duration} = | Get Variable Value | \${tg_warmup_duration} | ${1.0}
+| | Return From Keyword | ${duration}
+
+| Get Tg Warmup Rate
+| | [Documentation]
+| | ... | Return value of \${tg_warmup_rate} variable,
+| | ... | if not defined, return the max rate.
+| |
+| | ... | The return value controls the rate (TPS unidir) of tg warmup trial,
+| | ... | Return type: float.
+| |
+| | ... | *Example:*
+| |
+| | ... | \| \${tg_warmup_rate} = \| Get Tg Warmup Rate \|
+| |
+| | ${rate} = | Get Variable Value | \${tg_warmup_rate} | ${0.0}
+| | Return From Keyword If | ${rate} | ${rate}
+| | Run Keyword And Return | Get Max Rate
+
 | Get Traffic Directions
 | | [Documentation]
 | | ... | Return value of \${traffic_directions},
 | Get Use Latency
 | | [Documentation]
 | | ... | Return value of \${use_latency} variable,
-| | ... | if not defined return the value from Constants.
+| | ... | if not defined, return the value from Constants.
 | |
 | | ... | The return value controls whether latency streams are active
 | | ... | during the main search.