This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmarks moved out of test dir (#472)
- Loading branch information
1 parent
9fc02a0
commit ab40760
Showing
26 changed files
with
184 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Benchmarks | ||
|
||
In this directory we write benchmarks for Mentat's performance on different tasks. | ||
|
||
## Running Exercism Benchmarks | ||
|
||
``` | ||
./benchmarks/exercism_practice.py | ||
``` | ||
|
||
Flags that control the performance of the benchmarks are defined [here](arg_parser.py) and set conservatively so benchmarks without flags will run relatively quickly and cheaply. To run the exercism benchmark with multiple workers on all the tests with one retry for the clojure language run the following: | ||
``` | ||
./benchmarks/exercism_practice.py --max_benchmarks 134 --max_iterations 2 --max_workers 2 --language clojure | ||
``` | ||
|
||
Warning: If you increase `max_workers` much higher you'll start to get rate limited. | ||
|
||
## Running Real World Benchmarks | ||
|
||
``` | ||
./benchmarks/benchmark_runner.py | ||
``` | ||
|
||
## Making Real World Benchmarks | ||
|
||
Real world benchmarks can either be [samples](benchmarks/mentat/sample_15223222005645d08b81f093e51d52fe.json) or [python files](benchmarks/mentat/). |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import argparse | ||
|
||
|
||
def common_benchmark_parser(): | ||
parser = argparse.ArgumentParser(description="Run exercism benchmarks") | ||
parser.add_argument( | ||
"--refresh_repo", | ||
action="store_true", | ||
default=False, | ||
help="When set local changes will be discarded.", | ||
) | ||
parser.add_argument( | ||
"--language", | ||
default="python", | ||
type=str, | ||
help="Which exercism language to do exercises for", | ||
) | ||
parser.add_argument( | ||
"--benchmarks", | ||
action="append", | ||
nargs="*", | ||
default=[[]], | ||
help=( | ||
"Which benchmarks to run. max_benchmarks ignored when set. Exact meaning" | ||
" depends on benchmark." | ||
), | ||
) | ||
parser.add_argument( | ||
"--max_benchmarks", | ||
default=1, | ||
type=int, | ||
help="The maximum number of exercises to run", | ||
) | ||
parser.add_argument( | ||
"--max_iterations", | ||
default=1, | ||
type=int, | ||
help="Number of times to rerun mentat with error messages", | ||
) | ||
parser.add_argument( | ||
"--max_workers", | ||
default=1, | ||
type=int, | ||
help="Number of workers to use for multiprocessing", | ||
) | ||
parser.add_argument( | ||
"--retries", | ||
action="store", | ||
default=1, | ||
type=int, | ||
help="Number of times to retry a benchmark", | ||
) | ||
parser.add_argument( | ||
"--repo", | ||
action="store", | ||
default="mentat", | ||
help="For benchmarks that are evaluated against a repo", | ||
) | ||
parser.add_argument( | ||
"--evaluate_baseline", | ||
action="store_true", | ||
help="Evaluate the baseline for the benchmark", | ||
) | ||
|
||
return parser |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...ercise_runners/clojure_exercise_runner.py → ...ercise_runners/clojure_exercise_runner.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 3 additions & 7 deletions
10
...ercise_runners/exercise_runner_factory.py → ...ercise_runners/exercise_runner_factory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...ise_runners/javascript_exercise_runner.py → ...ise_runners/javascript_exercise_runner.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...xercise_runners/python_exercise_runner.py → ...xercise_runners/python_exercise_runner.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.