Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ray Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-ray-knowledge-patch-nevaberry-plugins)
---
name: ray-knowledge-patch
description: Ray
version: null
license: MIT
metadata:
author: Nevaberry
---
# Ray knowledge patch
Load this skill when updating or troubleshooting Ray Data pipelines, Serve
applications, Core tasks and actors, KubeRay workloads, Train runs, or Tune searches.
Use the topic references for complete compatibility details and examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [Data processing](references/data-processing.md) | Readers, catalogs, expressions, batches, shuffles, autoscaling, checkpointing, LLM batch inference, metrics |
| [Kubernetes operations](references/kubernetes-operations.md) | RayJob modes, retries, deadlines, deletion, RayService endpoints, authentication, worker resizing |
| [Serving and recovery](references/serving-and-recovery.md) | Serve routing, HAProxy, batching, autoscaling, gRPC, LLM engines, shutdown, failure recovery |
| [Tasks and actors](references/tasks-and-actors.md) | Runtime compatibility, actor typing, cancellation, scheduling, transports, memory, jobs, security, observability |
| [Training and API stability](references/training-and-api-stability.md) | Train migration, workers, ingestion, checkpoints, preemption, public API policy, RLlib |
| [Tuning](references/tuning.md) | Trainables, budgets, schedulers, search compatibility, concurrency, resource changes |
## Breaking changes and deprecations
### Runtime and dependencies
- Ray removed `ray.init(local_mode=True)` and the experimental `_owner` argument
to `ray.put()`. `DAGNode.execute()` is deprecated.
- Ray dropped Python 3.9 support and declares Python 3.10 or later in wheel metadata.
- Ray 2.56.0 requires Pydantic V2. Its release notes announce minimums for 2.57.0
of NumPy 2.1, protobuf 5.26, pandas 2.2.3, PyArrow 18.0.0, Pydantic 2.9,
grpcio 1.66, and SciPy 1.14.1.
- Use `STORAGE_ROOT_DIR` in place of `RAY_ROOT_DIR` for the Ray History Server's
storage root.
### Ray Data migration
- Replace removed `read_parquet_bulk()` with `ray.data.read_parquet()`.
Ray Data also removed `TENSOR_COLUMN_NAME`, `meta_provider`, and `locality_with_output`.
- Ray Data deprecates `ConcurrencyCapBackpressurePolicy`, `DataIterator.to_torch()`,
pandas batches for UDFs, `DataContext.scheduling_strategy`, `actor_locality_enabled`,
`exclude_resources`, and `local://` paths. `read_tfrecords()` removed `tfx-bsl` support.
- `Dataset.zip()` and `ray_remote_args_fn` are deprecated in 2.58.0.
- DataSourceV2 is disabled by default in 2.56.0 and enabled for supported readers
such as `read_parquet()` in 2.57.0. To revert to V1, set
`ray.data.DataContext.get_current().use_datasource_v2 = False` before creating the dataset.
- NumPy pickle loading defaults to off. Use
`ray.data.read_numpy("trusted.npy", allow_pickle=True)` for a trusted file that requires it.
Ray Data blocks pickled object columns from untrusted Parquet files;
unsafe WebDataset deserialization requires opt-in.
- `Dataset.write_lance()` raises an error in `CREATE` mode if the destination exists.
In Ray 2.60.1, `ray.data.read_delta()` and `Dataset.write_delta()` reject Delta Lake
tables with column mapping enabled; earlier versions could silently produce null columns.
- Replace the subcluster label `__subcluster__` with `ray-subcluster`.
Replace the Daft integration dependency `getdaft` with `daft`.
- Starting in 2.56.1, restore the previous pandas conversion behavior with
`ray.data.DataContext.get_current().enable_arrow_backed_pandas_conversion = False`
before converting, or by disabling `RAY_DATA_ENABLE_ARROW_BACKED_PANDAS_CONVERSION`.
### Serve configuration and routing
- Configure HTTP, gRPC, and logging through `http_options`, `grpc_options`, and
`LoggingConfig`; the removed Serve environment settings are listed in the serving reference.
- Set `proxy_location` instead of deprecated `HTTPOptions.location`.
A nonzero `HTTPOptions.num_cpus` raises an error. `DeploymentMode` was removed.
- An ingress deployment under direct ingress cannot use a custom request router
or `serve.multiplexed`: Serve raises an error.
- A subclass of an `@serve.ingress` class that defines a synchronous `__init__`
raises an error.
- Autoscaling requires `lookback_period_s` strictly greater than `metrics_interval_s`.
Forwarding request bodies to custom ingress routers requires explicit opt-in.
### LLM, Train, Tune, and Kubernetes migration
- Ray LLM removed `guided_decoding`, `truncate_prompt_tokens`, and `build_llm_processor`.
Serve LLM also removed its config generator.
- Use `apply_chat_template_stage`, `tokenize_stage`, and `detokenize_stage` in place
of their unsuffixed helpers. Ray removed `PrepareImageStage` and deprecated the `image` row column.
- Use `AcceleratorType` in place of `GPUType`.
`VLLMEngineConfig` identifies cached models by `model_id`.
- Train V1 removed `Predictor`. `ray.train.report(..., checkpoint=...)` accepts
only in-band checkpoints. Train validates that training function returns are serializable.
- Tune removed `Logger` and `logger_creator`; `OptunaSearch` requires `optuna>=3.0.0`.
- Kubernetes token authentication uses separate configuration instead of
`RAY_AUTH_MODE=k8s` and reads tokens from a dedicated service-account path.
Use the authorization verb `ray:write` and the `RayCluster` name as the `ServiceAccount` name.
## Ray Data execution and ingestion
### Batching and concurrency
- Function transforms use automatic task concurrency. Set
`compute=ray.data.TaskPoolStrategy(size=2)` to cap concurrency at two tasks.
Callable classes default to an autoscaling actor pool; use
`compute=ray.data.ActorPoolStrategy(size=2)` for two actors with one initialization each.
- Pass `batch_size=None` to `map_batches()` to give a UDF all rows of a block in one call.
When requesting GPUs for a batch transform, pass an explicit integer batch size.
For CPU transforms, `dataset.map_batches(transform, batch_size="auto")` chooses row counts automatically.
- Asynchronous batch transforms use a callable class with `async def __call__`
passed to `map_batches()` and require `uvloop==0.21.0`.
- Transforms can emit blocks out of input order. Set
`ray.data.DataContext.get_current().execution_options.preserve_order = True`
before creating the dataset to preserve input order.
- `Dataset.sort()` and `Dataset.groupby()` introduce a shuffle that materializes
data before downstream operators continue; map stages can otherwise consume
blocks while upstream stages are still running.
### Autoscaling, recovery, and reads
- The utilization-based Ray Data cluster autoscaler is enabled by default;
its v1 predecessor was removed. It skips head-only node groups and is disabled
when execution uses `PlacementGroupSchedulingStrategy`.
- Ray Data supports pipeline checkpoints, two-phase commits, and checkpoint
loading during recovery. It can retry UDFs that raise transient exceptions.
- Set `ray.data.DataContext.get_current().max_consecutive_actor_init_deaths`
to control consecutive actor deaths tolerated during initialization.
Execution fails when no operator makes progress within the timeout.
- `read_kafka()` accepts per-partition `start_offset` and `end_offset` values.
`read_sql()` accepts `sql_params` using the database driver's placeholder syntax.
- Unity Catalog Parquet reads on AWS require `region`. Catalog-issued AWS
credentials stay out of the process environment, preserving the job's AWS
identity for operations on other buckets.
- `Dataset.mix()` combines datasets with relative weights. `iter_jax_batches()`
feeds JAX training loops, and `iter_torch_batches()` accepts `collate_fn` with an explicit `device`.
## Serve routing, scaling, and LLM inference
- Deployment handles expose `choose_replica()` and `dispatch()` to separate
replica selection from dispatch, with replica-side slot reservation.
Serve includes experimental round-robin routing, `ConsistentHashRouter` for
session affinity, and `CapacityQueueRouter` for token-based capacity scheduling.
- Pass a `DeploymentResponse` directly to another handle's `.remote()` call
and await the final response for a chain of deployment calls.
- `@serve.batch` accepts a custom size function, so `max_batch_size` can express
a total-token budget. Each batch contains a single multiplexed model ID.
- Set application `external_scaler_enabled` for external replica-count control.
Custom policies can retain state, use `policy_kwargs`, and apply standard
delays, scaling factors, and bounds through `apply_autoscaling_config`.
- `TaskConsumer` deployments can scale from pending Redis or RabbitMQ tasks;
a `QueueMonitor` actor measures queue length.
- Serve supports bidirectional gRPC streaming. If a deployment sets a gRPC
status code and raises, the client receives that code; error messages are limited to 4 KB.
- Set `RAY_SERVE_LLM_ENABLE_DIRECT_STREAMING=1` to separate token streaming from
ingress handling. Use 2.56.1 or later with body-aware routers such as
`PrefixCacheAffinityRouter` for the fix to routing hangs in this mode.
- `RAY_SERVE_SESSION_ID_HEADER_KEY` names the HTTP session-ID header for sticky routing.
The completed KV-aware route tokenizes on `LLMRouter` ingress and passes tokens
to the engine; CPU-offloaded cache blocks count toward a replica's cache hit.
- Ray LLM offers `/tokenize`, `/detokenize`, classification and scoring, and a
`pooling` parameter. `/collective_rpc` synchronizes inference weights during RLHF.
- Batch inference uses `should_continue_on_error`; `ServeDeploymentStage` honors it.
Set `request_timeout_s` on `ServeDeploymentProcessor` to bound the wait for a Serve response.
`vLLMEngineStage` accepts `tokenized_prompt` without `prompt`.
## Train, Tune, and RayJob controls
- Enable Train V2 with `RAY_TRAIN_V2_ENABLED=1`. `ScalingConfig.label_selector`
places workers on matching nodes. Worker-group startup defaults to a 60-second timeout.
- `DataConfig.execution_options` can map dataset names to separate options.
Train replaces dataset execution options during ingestion: set a subcluster
selector in both the construction context and the Trainer's `dataset_config`.
- `get_all_reported_checkpoints()` supports `CheckpointConsistencyMode` and
`timeout_s`. Metrics-only reports no longer block checkpoint retrieval.
`Result.get_best_checkpoint()` can rank by a nested metric.
- Asynchronous checkpoint validation requires a checkpoint, accepts Ray remote
arguments for the validation task, and resumes when the training driver is restored.
- With `delete_local_checkpoint_after_upload=True`, a local checkpoint inside
the experiment directory raises an error. `ReportedCheckpoint.status` exposes checkpoint state.
- Tune function trainables can yield metrics dictionaries. Set `num_samples=-1`
and `time_budget_s` for an open-ended trial count bounded by time.
Checkpoint and search requirements vary by scheduler; see the tuning reference.
- RayJob `spec.backoffLimit` defaults to `0` and creates a new RayCluster per retry;
`spec.submitterConfig.backoffLimit` defaults to `2` and retries the submitter Job.
- RayJob `SidecarMode` requires head-Pod `restartPolicy: Never` and excludes
`clusterSelector`, `submitterPodTemplate`, and `submitterConfig`.
- With the `RayJobDeletionPolicy` gate enabled, beta `deletionRules` support
`DeleteWorkers`, `DeleteCluster`, `DeleteSelf`, and `DeleteNone`. When using rules,
omit `shutdownAfterJobFinishes` and `ttlSecondsAfterFinished`; set delays per rule.
## Cancellation, shutdown, and recovery
- A running synchronous actor method can poll
`ray.get_runtime_context().is_canceled()`. Inside an async actor task, this call
raises `RuntimeError`; `ray.cancel(ref)` requests cancellation of its `asyncio.Task`,
which can take effect when the method yields at an `await`.
- Actor task order is sequenced within each concurrency group; ordering across
groups requires explicit coordination. Method `enable_task_events` overrides
actor settings, and nested tasks use their own settings.
- Serve replaces failed replicas and restarts failed proxies. A restarted
controller restores configuration from GCS; node failure can drop live connections
and queued requests. Use KubeRay `RayService` for full-cluster recovery.
- HTTP, gRPC, and `DeploymentHandle` requests can continue during a controller
outage. Autoscaling pauses until recovery and resumes with fresh metrics.
- Dependency-ordered Serve shutdown lets a deployment finish before the deployments it calls.
With token authentication enabled, replica `ASGIService` requests require a valid token.
- Embedded RocksDB GCS persistence uses `RAY_gcs_storage=rocksdb` and
`RAY_gcs_storage_path` in the GCS server environment; choose persistent storage for recovery.
- On `SIGTERM`, `ray start --block` drains the node before shutdown.
`process_group_cleanup_enabled` defaults to enabled, and `ray.shutdown()` waits for subprocesses.