-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Serialize engine config in new pdsh benchmark CLI #22365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
904cfb3
9cb80fd
8f497d7
044eb4c
91faeb8
3e383fa
a0b7c7f
bfb6dba
b98a0b4
62cb242
b766790
e9433e0
0f2a37a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1078,6 +1078,7 @@ def _finalize_benchmark_run( | |
| run_config: RunConfig, | ||
| validation_failures: list[int], | ||
| query_failures: list[tuple[int, int]], | ||
| engine: StreamingEngine | None, | ||
| ) -> None: | ||
| """Summarize, serialize, and exit after a benchmark run.""" | ||
| if args.summarize: | ||
|
|
@@ -1092,7 +1093,7 @@ def _finalize_benchmark_run( | |
| ) | ||
| else: | ||
| print("✅ All validated queries passed.") | ||
| args.output.write(json.dumps(run_config.serialize(engine=None))) | ||
| args.output.write(json.dumps(run_config.serialize(engine=engine))) | ||
| args.output.write("\n") | ||
| sys.exit(1 if (query_failures or validation_failures) else 0) | ||
|
|
||
|
|
@@ -1152,7 +1153,9 @@ def _allgather_result(df: pl.DataFrame) -> pl.DataFrame: | |
| run_config = _consolidate_logs( | ||
| run_config, engine=engine, gather_client_logs=False | ||
| ) | ||
| _finalize_benchmark_run(args, run_config, validation_failures, query_failures) | ||
| _finalize_benchmark_run( | ||
| args, run_config, validation_failures, query_failures, engine=engine | ||
| ) | ||
|
|
||
|
|
||
| def run_polars_ray( | ||
|
|
@@ -1200,7 +1203,9 @@ def run_polars_ray( | |
| run_config = dataclasses.replace(run_config, records=dict(records), plans=plans) | ||
| run_config = _consolidate_logs(run_config, engine=engine) | ||
|
|
||
| _finalize_benchmark_run(args, run_config, validation_failures, query_failures) | ||
| _finalize_benchmark_run( | ||
| args, run_config, validation_failures, query_failures, engine=engine | ||
| ) | ||
|
|
||
|
|
||
| def run_polars_dask( | ||
|
|
@@ -1261,7 +1266,9 @@ def run_polars_dask( | |
| finally: | ||
| if dask_client is not None: | ||
| dask_client.close() | ||
| _finalize_benchmark_run(args, run_config, validation_failures, query_failures) | ||
| _finalize_benchmark_run( | ||
| args, run_config, validation_failures, query_failures, engine=engine | ||
| ) | ||
|
Comment on lines
+1263
to
+1265
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Finalize the Dask run while the engine is still alive. By the time this call executes, the Suggested fix try:
with DaskEngine(
rapidsmpf_options=run_config.streaming_options.to_rapidsmpf_options(),
executor_options=executor_options,
engine_options=engine_options,
dask_client=dask_client,
) as engine:
run_config = dataclasses.replace(run_config, n_workers=engine.nranks)
records, plans, validation_failures, query_failures = _run_query_loop(
benchmark,
args,
run_config,
engine,
numeric_type,
date_type,
validation_files,
)
run_config = dataclasses.replace(
run_config, records=dict(records), plans=plans
)
run_config = _consolidate_logs(run_config, engine)
+ _finalize_benchmark_run(
+ args, run_config, validation_failures, query_failures, engine=engine
+ )
finally:
if dask_client is not None:
dask_client.close()
- _finalize_benchmark_run(
- args, run_config, validation_failures, query_failures, engine=engine
- )🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| def setup_logging(query_id: int, iteration: int) -> None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serialize the Ray engine before leaving the context manager.
This now runs after
with RayEngine(...)exits, soshutdown()has already torn down the engine state thatRunConfig.serialize(engine=engine)reads. That means the new config recording can emit empty/default data or fail instead of capturing the live runtime settings. Move_finalize_benchmark_run(...)back inside thewithblock.Suggested fix
with RayEngine( rapidsmpf_options=run_config.streaming_options.to_rapidsmpf_options(), executor_options=executor_options, engine_options=engine_options, ray_init_options=ray_init_options, ) as engine: run_config = dataclasses.replace(run_config, n_workers=engine.nranks) records, plans, validation_failures, query_failures = _run_query_loop( benchmark, args, run_config, engine, numeric_type, date_type, validation_files, ) run_config = dataclasses.replace(run_config, records=dict(records), plans=plans) run_config = _consolidate_logs(run_config, engine=engine) - - _finalize_benchmark_run( - args, run_config, validation_failures, query_failures, engine=engine - ) + _finalize_benchmark_run( + args, run_config, validation_failures, query_failures, engine=engine + )🤖 Prompt for AI Agents