Migrating to Ray ray-2.41.0
Version ray-2.41.0 introduces 1 breaking change. This guide details how to update your code.
Released: 1/23/2025
1
Breaking Changes
7
Migration Steps
36
Affected Symbols
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
write_parquetpartition_colsExpression filter supportmulti-directional sortExecutionCallbackseed (read files)select_columnsrename_columnsProject operatormap_groupsread_sqlDataContextto_tfgroupbyfile_extensionsmap operator fusionoptuna_searchRAY_SERVE_RUN_SYNC_IN_THREADPOOLAggregatorActorsMetricsLoggerOfflineDataEpisodeReplayBufferon_episode_createdSingleAgentEnvRunnertrain_batch_size_per_learnerDefault[algo]RLModuleormsgpacktask_nametask_function_nameactor_namensight.nvtxray[cg]compiled graphsredis/valkey authenticationTPU v6e head resourceAzure accelerated networking flagBreaking Changes
●Issue #1
Ray Serve sync methods will run in a threadpool by default, changing their execution semantics; set the environment variable RAY_SERVE_RUN_SYNC_IN_THREADPOOL=1 to retain the current behavior.
Migration Steps
- 1Set the environment variable `RAY_SERVE_RUN_SYNC_IN_THREADPOOL=1` if you want to keep the current synchronous method execution behavior in Ray Serve.
- 2Update any code that relied on the previous default of sync methods running in the main thread, as they will now run in a threadpool.
- 3If you use `write_parquet` in Ray Data, pass the new `partition_cols` argument as needed to control partitioning.
- 4Review and adjust any custom callbacks that rely on the old single‑callback style; lambda‑style callbacks are now supported.
- 5Check for usage of deprecated RLlib features referenced by issues #49488 and #49144 and replace them with the recommended alternatives.
- 6If you depend on compiled graphs, install the new optional extra with `pip install "ray[cg]"` to get the latest CG features.
- 7Review any usage of `task_name`, `task_function_name`, or `actor_name` in structured logging to take advantage of the new fields.
Release Summary
This release adds extensive new features across Ray Data, Train, Tune, Serve, RLlib, and core components, upgrades key dependencies like Arrow, Dask, and Hudi, and includes numerous bug fixes and deprecations to prepare for future API changes.
Need More Details?
View the full release notes and all changes for Ray ray-2.41.0.
View Full Changelog