Skip to content

Commit e767356

Browse files
Modernize logger interface (#1161)
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent be5d1b5 commit e767356

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

benchmarks/client/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def worker(thread_idx, task_queue, client, model, max_output, send_request_func,
2828
task = task_queue.get()
2929
logging.debug(f"Worker {thread_idx} receive task...")
3030
if task is None: # Stop signal
31-
logging.warn(f"Worker {thread_idx} exit.")
31+
logging.warning(f"Worker {thread_idx} exit.")
3232
break
3333
else:
3434
loop.run_until_complete(send_request_func(client, model, max_output, *task))
@@ -198,13 +198,13 @@ async def benchmark_streaming(api_key: str,
198198
for task_queue in task_queues:
199199
task_queue.join()
200200
# Stop all worker threads
201-
logging.warn("Producer completed ...")
201+
logging.warning("Producer completed ...")
202202
for i, thread in enumerate(threads):
203203
task_queues[i].put(None)
204204

205205
for thread in threads:
206206
thread.join()
207-
logging.warn(f"Worker thread {thread} completed ...")
207+
logging.warning(f"Worker thread {thread} completed ...")
208208
logging.warning(f"All {num_requests} requests completed for deployment.")
209209

210210
# Asynchronous request handler
@@ -339,7 +339,7 @@ async def benchmark_batch(api_key: str,
339339

340340
for thread in threads:
341341
thread.join()
342-
logging.warn(f"Worker thread {thread} completed ...")
342+
logging.warning(f"Worker thread {thread} completed ...")
343343
logging.warning(f"All {num_requests} requests completed for deployment.")
344344

345345
def create_client(api_key: str,

benchmarks/generator/dataset_generator/multiturn_prefix_sharing_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def main(args):
8686
})
8787
save_dataset_jsonl(sessioned_prompts, args.output)
8888
analyze_dataset(sessioned_prompts, tokenizer)
89-
logging.warn(f"...Finished saving dataset {args.output}.")
89+
logging.warning(f"...Finished saving dataset {args.output}.")
9090

9191

9292
if __name__ == "__main__":

benchmarks/generator/workload_generator/sample_request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _load_plain_dataset(
6868
}
6969
for entry in dataset if entry['prompt'] is not None
7070
)
71-
logging.warn(f"...Complete sessioned dataframe transformation")
71+
logging.warning(f"...Complete sessioned dataframe transformation")
7272
return df
7373

7474
class RequestFinder:
@@ -197,7 +197,7 @@ def _find_requests_plain_len_range(
197197
if not repeating:
198198
self.df.drop(index=sample_idx, inplace=True) # Remove the selected row
199199
self.df.reset_index(drop=True, inplace=True) # Reset index to avoid issues
200-
logging.warn(f"No exact match found for request {i + 1}, target input/output lengths {input_len}/{output_len}, use closest QA pair input {closest_input} output {closest_output}.")
200+
logging.warning(f"No exact match found for request {i + 1}, target input/output lengths {input_len}/{output_len}, use closest QA pair input {closest_input} output {closest_output}.")
201201

202202
return filtered_results
203203

@@ -265,7 +265,7 @@ def _find_requests_sessioned_len_range(
265265
if len(sample_session["prompts"] == 0):
266266
self.df.drop(index=sample_idx, inplace=True) # Remove the selected row
267267
self.df.reset_index(drop=True, inplace=True) # Reset index to avoid issues
268-
logging.warn(f"No exact match found for request {i + 1}, target input/output lengths {input_len}/{output_len}, use closest QA pair input {closest_input} output {closest_output}.")
268+
logging.warning(f"No exact match found for request {i + 1}, target input/output lengths {input_len}/{output_len}, use closest QA pair input {closest_input} output {closest_output}.")
269269
return filtered_results
270270

271271
def sample_requests_all(

benchmarks/generator/workload_generator/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ def save_workload(load_struct: List[Any],
289289
for row in load_struct:
290290
json_line = json.dumps(row) # Convert list to JSON string
291291
file.write(json_line + "\n")
292-
logging.warn(f'Saved workload file to {output_path + ".jsonl"}')
292+
logging.warning(f'Saved workload file to {output_path + ".jsonl"}')
293293
else:
294294
with open(output_path + ".json", 'w') as file:
295295
json.dump(load_struct, file, indent=4)
296-
logging.warn(f'Saved workload file to {output_path + ".json"}')
296+
logging.warning(f'Saved workload file to {output_path + ".json"}')
297297

298298
def load_config(config_path: str) -> Dict[str, Any]:
299299
with open(config_path, "r") as file:

0 commit comments

Comments
 (0)