Skip to content

Commit

Permalink
sjf with bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mchen644 committed Oct 22, 2024
1 parent 317c4ee commit 776baba
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 240 deletions.
4 changes: 2 additions & 2 deletions benchmarks/1_serving_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ result_dir="${pwd}/result"
declare -a scheduler_swap_policies
# scheduler_swap_policies[0]="tfittradeoff partial"
# scheduler_swap_policies[1]="fcfs full"
scheduler_swap_policies[2]="las full"
# scheduler_swap_policies[2]="las full"
# scheduler_swap_policies[1]="tfittradeoff full"
# scheduler_swap_policies[2]="sjf full"
scheduler_swap_policies[2]="sjf full"
# scheduler_swap_policies[3]="sjmlfq full"
# scheduler_swap_policies[3]="infer partial"
# scheduler_swap_policies[4]="inferpreempt full"
Expand Down
10 changes: 1 addition & 9 deletions benchmarks/backend_request_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,24 +225,16 @@ async def async_request_openai_completions(
policy: str,
request_func_input: RequestFuncInput,
pbar: Optional[tqdm] = None,
data=None,
) -> RequestFuncOutput:
api_url = request_func_input.api_url
assert api_url.endswith(
"v1/completions"
), "OpenAI Completions API URL must end with 'v1/completions'."




async with aiohttp.ClientSession(timeout=AIOHTTP_TIMEOUT) as session:
assert not request_func_input.use_beam_search
if policy in ["sjf"]:
file_path = get_json_file()
if file_path:
with open(file_path, 'r', encoding="utf-8") as file:
data = json.load(file)
else:
raise FileNotFoundError("JSON file not found for sjf")
payload = {
"model": request_func_input.model,
"prompt": request_func_input.prompt,
Expand Down
Loading

0 comments on commit 776baba

Please sign in to comment.