Modules
do_commit(cwd)
¶
Commits the benchmark results to the repository.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cwd
|
str
|
The current working directory. |
required |
Raises¶
CalledProcessError: If any of the subprocess commands fail.
Source code in src/benchie/__init__.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
main(output, data, force, commit, course_id, exercise_name, exercise_id, solutions, token, skip_fetch, skip_benchmark, subset, subset_data, disable_pretest, timeout, loop, loop_timeout, benchmark_options, docker_image, *args, **kwargs)
¶
Main function for benchmarking and processing data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output
|
str
|
Path to the output directory. |
required |
data
|
str
|
Path to the data folder. |
required |
force
|
bool
|
Flag indicating whether to force benchmarking even if there are no new submissions. |
required |
commit
|
bool
|
Flag indicating whether to commit the changes. |
required |
course_id
|
str
|
Course ID. |
required |
exercise_name
|
str
|
Exercise name. |
required |
exercise_id
|
str
|
Exercise ID. |
required |
solutions
|
str
|
Path to the solutions directory. |
required |
token
|
str
|
Path to the token location. |
required |
skip_fetch
|
bool
|
Flag indicating whether to skip fetching new submissions. |
required |
skip_benchmark
|
bool
|
Flag indicating whether to skip benchmarking. |
required |
subset
|
int
|
Number of solutions to consider. |
required |
subset_data
|
int
|
Number of data files to consider. |
required |
disable_pretest
|
bool
|
Flag indicating whether to test the correctness of the solutions. |
required |
timeout
|
float
|
Timeout value for benchmarking. |
required |
loop
|
bool
|
Flag indicating whether to run the benchmark in an infinite loop. |
required |
loop_timeout
|
float
|
Timeout value for the loop. |
required |
benchmark_options
|
list[BenchmarkOption]
|
List of benchmarking options. |
required |
docker_image
|
str
|
Docker image to use for benchmarking. |
required |
Returns¶
None
Source code in src/benchie/__init__.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
benchmark
¶
BenchmarkOption
¶
Bases: Enum
Benchmarking options.
Source code in src/benchie/benchmark.py
16 17 18 19 20 21 22 |
|
benchmark(testfile, output, solutions, timeout, disable_pretest, benchmark_options, subset=None, docker_image=None)
¶
Perform benchmarking on submissions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
testfile
|
Path
|
Path to the test file. |
required |
subset
|
str
|
Subset of the test file to use. |
None
|
output
|
Path
|
Path to the output directory. |
required |
solutions
|
List[Path]
|
List of paths to the solutions. |
required |
timeout
|
int
|
Timeout value in seconds. |
required |
Returns¶
List[Path]: List of correct solutions.
Source code in src/benchie/benchmark.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
create_command(path, testfile, interpreter='python')
¶
Create a command to execute a test file using a given path and interpreter.
Source code in src/benchie/benchmark.py
25 26 27 28 29 30 31 32 33 34 35 |
|
reporting
¶
create_table(with_imports, with_tracker, timings=None)
¶
Expected output:
Command | Mean [s] | Min [s] | Max [s] | Rank |
---|---|---|---|---|
13309298 |
4.500 ± 0.036 | 4.474 | 4.541 | 1.00 |
13309297 |
4.515 ± 0.116 | 4.445 | 4.648 | 1.00 ± 0.03 |
create_table({'13309298': '1.0 MB'}) ' | Command | Peak memory | Rank | \n | :--- | ---: | ---: | \n |
13309298
| | | | 1.0 MB | 0 | ' create_table({'13309298': '1.0 MB'}, {'results': [{'command': '13309298', 'mean': 4.5, 'stddev': 0.036, 'min': 4.474, 'max': 4.541}]}) ' | Command | Mean [s] | Min [s] | Max [s] | Peak memory | Rank | \n | :--- | ---: | ---: | ---: | ---: | ---: | \n |13309298
| 4.500 ± 0.036 | 4.474 | 4.541 | 1.0 MB | 0 | '
Source code in src/benchie/reporting.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
key_by_memory(s)
¶
summary
:param s: description :return: description
key_by_memory('1.0 MB') 1.0 key_by_memory('1.0 GB') 1000.0
Source code in src/benchie/reporting.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
make_relative(d)
¶
summary
:param d: description :return: description
make_relative({'a': '1.0 MB', 'b': '2.0 MB'}) {'a': 0, 'b': 1} make_relative({'a': '1.0 MB', 'b': '1.0 MB'}) {'a': 0, 'b': 1} make_relative({'a': '1.0 GB', 'b': '2.0 KB'}) {'b': 0, 'a': 1}
Source code in src/benchie/reporting.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|