You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mapper tool can be used to map the functions in a given trace directory (with memory and duration traces) to the proxy functions in the [`vSwarm`](https://github.com/vhive-serverless/vSwarm/tree/main/) benchmark suite. The benchmarks present in the vSwarm benchmark suite have been profiled and their memory utilization and duration traces have been collected and stored in the `profile.json` file. Each function in the trace is mapped to a function in the benchmark suite as its closest proxy (based on memory and duration correlation).
4
+
5
+
The `profile.json` JSON output file is generated by the [`profiler` tool](https://github.com/vhive-serverless/vSwarm/tree/load-generator/tools/profiler#profiler) to obtain the profile of the benchmark suite functions.
Whether to assign unique proxy functions to each trace function
20
+
```
21
+
The tool reads the trace information(memory and duration details) from the `trace/` directory (can be configured using `-t` or `--trace-directorypath` flags). The `trace/` directory must contain the `memory.csv` and `durations.csv` files containing the respective trace information of the format mentioned in [*Azure Functions Dataset 2019*](https://github.com/Azure/AzurePublicDataset/blob/master/AzureFunctionsDataset2019.md)
22
+
23
+
#### Function Execution Duration `durations.csv` Schema
24
+
25
+
|Field|Description |
26
+
|--|--|
27
+
| HashOwner | unique id of the application owner |
28
+
| HashApp | unique id for application name |
29
+
| HashFunction | unique id for the function name within the app |
30
+
|Average | Average execution time (ms) across all invocations of the 24-period|
31
+
|Count | Number of executions used in computing the average|
32
+
|Minimum | Minimum execution time|
33
+
|Maximum | Maximum execution time|
34
+
|percentile_Average_0| Weighted 0th-percentile of the execution time *average*|
35
+
|percentile_Average_1| Weighted 1st-percentile of the execution time *average*|
36
+
|percentile_Average_25 | Weighted 25th-percentile of the execution time *average*|
37
+
|percentile_Average_50 | Weighted 50th-percentile of the execution time *average*|
38
+
|percentile_Average_75 | Weighted 75th-percentile of the execution time *average*|
39
+
|percentile_Average_99 | Weighted 99th-percentile of the execution time *average*|
40
+
|percentile_Average_100 | Weighted 100th-percentile of the execution time *average*|
41
+
Execution time is in milliseconds.
42
+
43
+
#### Function Memory Usage `memory.csv` Schema
44
+
45
+
|Field|Description |
46
+
|--|--|
47
+
| HashOwner | unique id of the application owner |
48
+
| HashApp | unique id for application name |
49
+
| HashFunction | unique id for the function name within the app |
50
+
|SampleCount | Number of samples used for computing the average |
51
+
|AverageAllocatedMb | Average allocated memory across all SampleCount measurements|
52
+
|AverageAllocatedMb_pct1 | 1st percentile of the average allocated memory|
53
+
|AverageAllocatedMb_pct5 | 5th percentile of the average allocated memory|
54
+
|AverageAllocatedMb_pct25 | 25th percentile of the average allocated memory|
55
+
|AverageAllocatedMb_pct50 | 50th percentile of the average allocated memory|
56
+
|AverageAllocatedMb_pct75 | 75th percentile of the average allocated memory|
57
+
|AverageAllocatedMb_pct95 | 95th percentile of the average allocated memory|
58
+
|AverageAllocatedMb_pct99 | 99th percentile of the average allocated memory|
59
+
|AverageAllocatedMb_pct100 | 100th percentile of the average allocated memory|
60
+
61
+
The [`sampler`](https://github.com/vhive-serverless/invitro/tree/main/sampler) tool in InVitro can be used to generate the sampled traces from the original Azure traces.
62
+
63
+
For every function in the trace, the closest function in the [`vSwarm`](https://github.com/vhive-serverless/vSwarm/tree/main/) benchmark suite is set as its proxy (75-percentile memory and 75-percentile duration are considered to find the highest correlation). If the `-u` (or `--unique-assignment`) flag is set to true, the tool tries to find a one-to-one (injective) mapping between trace functions and proxy functions by modelling it as a *linear sum assignment* problem which is solved by the SciPy implementation of the *Jonker-Volgenant algorithm*. The 75th percentile is used to ensure that the mapping is not only corresponding to the peak values of the workload, but is also leading to a representative proxy function. If the number of trace functions is greater than the number of proxy functions, or if the mapping is not achieved, the injective constraint is removed, and the closest proxy function is obtained. Currently the tool utilizes only _Serving Functions_ that are _NOT Pipelined_ as proxy functions.
64
+
65
+
This mapping requires the profiles of the benchmark functions for it to be used as a proxy. The tool utilizes the `profile.json` JSON output file generated by the [`profiler` tool](https://github.com/vhive-serverless/vSwarm/tree/load-generator/tools/profiler#profiler) to obtain the profile of the benchmark suite functions. The User can configure the path of the JSON file through the `-p` (or `--profile-filepath`) flag (by default, it is `profile.json`, which needs to be unzipped).
66
+
67
+
An example of a generated output file is as follows:
The mapper output file will be stored in the trace directory with the name `mapper_output.json` by default. The output file contains the mapping of the trace functions to the proxy functions in the vSwarm benchmark suite.
f"Found proxy function for {function_name}: {trace_functions[function_name]['proxy-function']} with correlation: {trace_functions[function_name]['proxy-correlation']}"
176
+
)
177
+
178
+
forfunction_nameinproxy_functions:
179
+
delproxy_functions[function_name]["index"]
180
+
181
+
returntrace_functions, 0
182
+
183
+
exceptExceptionase:
184
+
log.error(f"Finding closest proxy function failed. Error: {e}")
0 commit comments