Skip to content

Commit

Permalink
Merge branch 'main' into kind-setup-related-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tdoublep authored Oct 31, 2024
2 parents b0210b6 + 97b23e0 commit 73a7c85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions fmperf/loadgen/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
from fmperf.utils.constants import REQUESTS_DIR, REQUESTS_FILENAME, RESULTS_ALL_FILENAME


def run():
def run(result_filename=None):
if result_filename is None:
result_filename = RESULTS_ALL_FILENAME

def get_streaming_response_tgis(response):
stop = False
generated_tokens = 0
Expand Down Expand Up @@ -73,7 +76,7 @@ def get_streaming_response_vllm(response):
yield None, 0, time.time_ns(), False, StopIteration()

infile = os.path.join(REQUESTS_DIR, REQUESTS_FILENAME)
outfile = os.path.join(REQUESTS_DIR, RESULTS_FILENAME)
outfile = os.path.join(REQUESTS_DIR, result_filename)
target = os.environ["TARGET"]
api_url = os.environ["URL"]
num_users = int(os.environ["NUM_USERS"])
Expand Down
9 changes: 5 additions & 4 deletions fmperf/loadgen/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

for u in users:
os.environ["NUM_USERS"] = str(u)
os.environ["RESULTS_FILENAME"] = "result_sweep_u%d.json" % (u)

run()
result_filename = "result_sweep_u%d.json" % (u)

filename = os.path.join(REQUESTS_DIR, "requests/result_sweep_u%d.json" % (u))
run(result_filename)

filename = os.path.join(REQUESTS_DIR, result_filename)

with open(filename, "rb") as f:
tmp = json.load(f)
Expand All @@ -23,7 +24,7 @@

parse_results(results, print_df=True)

outfile = os.path.point(REQUESTS_DIR, RESULTS_ALL_FILENAME)
outfile = os.path.join(REQUESTS_DIR, RESULTS_ALL_FILENAME)
print(f">> writing all results to file: {outfile}")
with open(outfile, "w") as f:
json.dump(results, f)

0 comments on commit 73a7c85

Please sign in to comment.