Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions python/cudf_polars/cudf_polars/experimental/benchmarks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,15 @@ def parse_args(
default=False,
help="Enable statistics planning.",
)
parser.add_argument(
"--reset-memory-resource",
action=argparse.BooleanOptionalAction,
default=False,
help=(
"Reset the memory resource between each iteration. "
"Note: this only affects the single-node cluster."
),
)

parsed_args = parser.parse_args(args)

Expand Down Expand Up @@ -928,6 +937,11 @@ def run_polars(
if args.print_results:
print(result)

if run_config.executor != "cpu" and args.reset_memory_resource:
import cudf_polars.callback

cudf_polars.callback.default_memory_resource.cache_clear()

print(f"Query {q_id} - Iteration {i} finished in {record.duration:0.4f}s")
records[q_id].append(record)

Expand Down
Loading