mirror of
https://github.com/nod-ai/AMD-SHARK-Studio.git
synced 2026-02-19 11:56:43 -05:00
* Small changes to OPT example. * Update opt README. * Add a few modes to batch script. * Update README.md
31 lines
787 B
Python
31 lines
787 B
Python
"""
|
|
Script for running opt_perf_comparison.py in batch with a series of arguments.
|
|
|
|
Usage: python opt_perf_comparison_batch.py
|
|
"""
|
|
|
|
from typing import Iterable, List
|
|
import shlex
|
|
import subprocess
|
|
|
|
|
|
def make_commands() -> Iterable[List[str]]:
|
|
command = shlex.split("python opt_perf_comparison.py --no-save-json")
|
|
max_seq_lens = [32, 128, 256, 512]
|
|
model_names = ["facebook/opt-" + e for e in ["125m", "350m", "1.3b"]]
|
|
for max_seq_len in max_seq_lens:
|
|
for model_name in model_names:
|
|
yield command + [
|
|
f"--max-seq-len={max_seq_len}",
|
|
f"--model-name={model_name}",
|
|
]
|
|
|
|
|
|
def main():
|
|
for command in make_commands():
|
|
result = subprocess.run(command, check=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|