[Multi-GPU Polars] Ray mode in PDSH benchmarks - #21811
Conversation
TomAugspurger
left a comment
There was a problem hiding this comment.
Trying this out locally, I hit
Traceback (most recent call last):
File "/home/nfs/toaugspurger/gh/rapidsai/cudf/python/cudf_polars/cudf_polars/experimental/benchmarks/pdsh.py", line 1804, in <module>
run_polars(PDSHQueries, args)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/home/nfs/toaugspurger/gh/rapidsai/cudf/python/cudf_polars/cudf_polars/experimental/benchmarks/utils.py", line 1766, in run_polars
run_polars_ray(
~~~~~~~~~~~~~~^
benchmark,
^^^^^^^^^^
...<5 lines>...
validation_files,
^^^^^^^^^^^^^^^^^
)
^
File "/home/nfs/toaugspurger/gh/rapidsai/cudf/python/cudf_polars/cudf_polars/experimental/benchmarks/utils.py", line 1955, in run_polars_ray
with ray_execution(
~~~~~~~~~~~~~^
executor_options=executor_options,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
engine_options=engine_options,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
) as (ray_client, engine):
^
File "/home/nfs/toaugspurger/gh/rapidsai/cudf/python/cudf_polars/cudf_polars/experimental/rapidsmpf/frontend/ray.py", line 615, in ray_execution
root_ucxx_address_as_bytes = ray.get(rank_actors[0].setup_root.remote())
File "/raid/toaugspurger/envs/gh/rapidsai/cudf/lib/python3.13/site-packages/ray/_private/auto_init_hook.py", line 22, in auto_init_wrapper
return fn(*args, **kwargs)
File "/raid/toaugspurger/envs/gh/rapidsai/cudf/lib/python3.13/site-packages/ray/_private/client_mode_hook.py", line 104, in wrapper
return func(*args, **kwargs)
File "/raid/toaugspurger/envs/gh/rapidsai/cudf/lib/python3.13/site-packages/ray/_private/worker.py", line 2981, in get
values, debugger_breakpoint = worker.get_objects(
~~~~~~~~~~~~~~~~~~^
object_refs, timeout, use_object_store=_use_object_store
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/raid/toaugspurger/envs/gh/rapidsai/cudf/lib/python3.13/site-packages/ray/_private/worker.py", line 1014, in get_objects
raise value
ray.exceptions.ActorDiedError: The actor died because of an error raised in its creation task, ray::RankActor.__init__() (pid=2859867, ip=10.33.227.162, actor_id=dfbdb6136704c13c8ef33ba101000000, repr=<cudf_polars.experimental.rapidsmpf.frontend.ray.FunctionActorManager._create_fake_actor_class.<locals>.TemporaryActor object at 0x7fd68c0df770>)
...<4 lines>...
)
RuntimeError: The actor with name RankActor failed to import on the worker. This may be because needed library dependencies are not installed in the worker environment:
IIRC, you might have hit that as well. Did you come to a conclusion on what caused it?
| ) | ||
| executor_options = get_executor_options(run_config, benchmark=benchmark) | ||
| # "runtime", "cluster" are reserved — ray_execution sets them | ||
| executor_options.pop("runtime", None) |
There was a problem hiding this comment.
Validate that the user didn't pass something here? I guess the default is tasks, which makes this not straightforward :/
There was a problem hiding this comment.
I say we just raise an error? The Ray frontend requires the "rapidsmpf" runtime for sure.
There was a problem hiding this comment.
The plan is to remove the runtime option altogether. The runtime is implied by the chosen cluster; you simply set --cluster <single | ray | dask | spmd> (we may rename this to --frontend).
Currently, --cluster <spmd | ray> ignores --runtime, but it still affects performance. For example:
- Sampling is only enabled with
runtime="rapidsmpf". - The native C++ Parquet reader is only enabled with
runtime="rapidsmpf".
For now, let’s ignore the --runtime option, but this is another strong reason to standardize all benchmark options and logging!
| default=None, | ||
| type=str, | ||
| choices=["single", "distributed", "spmd"], | ||
| choices=["single", "distributed", "spmd", "ray"], |
There was a problem hiding this comment.
Just a note (nothing to do in this PR): I'd like to see these options become ["single", "dask", "spmd", "ray"] for 26.06
| raise NotImplementedError( | ||
| "--collect-traces is not yet supported with --cluster ray." | ||
| ) |
There was a problem hiding this comment.
Can you describe the blocker for this? I use this option extensively when I debug performance.
There was a problem hiding this comment.
The blocker is mainly that I do not yet have the full picture. I want to take this design one step at a time.
Once the new Dask frontend and its benchmark are merged, I plan to work on:
- Standardizing all configuration options by defining a clear policy for how
cudf-polarsoptions propagate to RapidsMPF, and which options must be configured directly in RapidsMPF rather than throughcudf-polars. - Standardizing all benchmark options and logging.
| raise NotImplementedError( | ||
| "--rmm-async is not yet supported with --cluster ray." | ||
| ) |
There was a problem hiding this comment.
Are we just always using the async allocator with Ray?
There was a problem hiding this comment.
Are we accounting for --spill-device anywhere? That option is pretty critical for tuning performance in our nightlies.
There was a problem hiding this comment.
Currently, you would have to set RAPIDSMPF_SPILL_DEVICE_LIMIT.
There was a problem hiding this comment.
Are we just always using the async allocator with Ray?
yes
| ) | ||
| executor_options = get_executor_options(run_config, benchmark=benchmark) | ||
| # "runtime", "cluster" are reserved — ray_execution sets them | ||
| executor_options.pop("runtime", None) |
There was a problem hiding this comment.
I say we just raise an error? The Ray frontend requires the "rapidsmpf" runtime for sure.
| args, | ||
| run_config, | ||
| engine, | ||
| None, |
There was a problem hiding this comment.
This is the client argument, right? Do we need _run_query_loop/etc to handle the Ray client to do collect traces and statistics?
There was a problem hiding this comment.
Yes, we would need to either implement a general run method on the ray client, or implement specific logging methods.
Yes, I ran into that as well when using the pip installation. In a conda environment, it seems to work. UPDATE: Hopefully, this fixes the issue: rapidsai/rapidsmpf#921 |
rjzamora
left a comment
There was a problem hiding this comment.
Looks good. Approving since I'm expecting more changes to follow anyway.
My only remaining concern is that the spill-device argument is ignored, and so users may try to tune this value and not understand why it's having no effect.
|
/merge |
Update the PDSH benchmarks to support
--cluster=rayruns.Run using something like:
python \ python/cudf_polars/cudf_polars/experimental/benchmarks/pdsh.py \ --executor=streaming \ --suffix="" \ --spill-device=0.5 \ --shuffle=rapidsmpf \ --runtime=rapidsmpf \ --stream-policy=pool \ --no-print-results --no-summarize \ --iterations=10 \ --path /datasets/datasets/tpch-rs/scale-10 \ --cluster ray \ 1