taps.apps.synthetic¶
SyntheticApp
¶
SyntheticApp(
structure: WorkflowStructure,
task_count: int,
task_data_bytes: int,
task_sleep: float,
bag_max_running: int | None,
*,
warmup_tasks: int = 0,
task_std: float = 0
)
Synthetic workflow application.
Parameters:
-
structure(WorkflowStructure) –Workflow structure.
-
task_count(int) –Number of tasks.
-
task_data_bytes(int) –Size of random input and output data of tasks.
-
task_sleep(float) –Seconds to sleep for in each task.
-
bag_max_running(int | None) –Maximum concurrently executing tasks in the "bag" workflow.
-
warmup_tasks(int, default:0) –Number of warmup tasks to submit before running the workflow.
-
task_std(float, default:0) –Deviation in task length to generate load imbalances
Source code in taps/apps/synthetic.py
close
¶
run
¶
Run the application.
Parameters:
Source code in taps/apps/synthetic.py
generate_data
¶
Get random data of specified size.
Note
This class returns a Data object rather than a bytestring directly.
This indirection is because some serializers skip bytes
which will cause problems if ProxyStore is used in this application
because the Proxy[bytes] will be an instance of bytes and
won't get properly serialized. This is the case with Ray, for example.
Parameters:
-
size(int) –size of byte string to return.
Returns:
-
Data–random data.
Source code in taps/apps/synthetic.py
generate_length
¶
Get random task length with specified mean and standard deviation.
Simple wrapper around random.gauss which generates a constant when std_dev is 0 or none, and guarantees the returned value is positive.
Parameters:
-
mean(float) –mean length of sleep
-
std_dev(float, default:None) –standard deviation of task distribution
Returns:
-
float–random length.
Source code in taps/apps/synthetic.py
noop_task
¶
No-op sleep task.
Parameters:
-
data(Data, default:()) –Input data.
-
output_size(int) –Size in bytes of output byte-string.
-
sleep(float) –Minimum runtime of the task. Time required to generate the output data will be subtracted from this sleep time.
-
task_id(UUID | None, default:None) –Optional unique task ID to prevent engines from caching the task result.
Returns:
-
Data–Byte-string of length
output_size.
Source code in taps/apps/synthetic.py
warmup_task
¶
run_bag_of_tasks
¶
run_bag_of_tasks(
engine: Engine,
task_count: int,
task_data_bytes: int,
task_sleep: float,
max_running_tasks: int,
task_std: float,
) -> None
Run bag of tasks workflow.
Source code in taps/apps/synthetic.py
run_diamond
¶
run_diamond(
engine: Engine,
task_count: int,
task_data_bytes: int,
task_sleep: float,
task_std: float,
) -> None
Run diamond workflow.
Source code in taps/apps/synthetic.py
run_reduce
¶
run_reduce(
engine: Engine,
task_count: int,
task_data_bytes: int,
task_sleep: float,
task_std: float,
) -> None
Run reduce worklow.
Source code in taps/apps/synthetic.py
run_sequential
¶
run_sequential(
engine: Engine,
task_count: int,
task_data_bytes: int,
task_sleep: float,
task_std: float,
) -> None
Run sequential workflow.