Repository navigation
Conversation
git-subtree-dir: src/common/thirdparty/hiredis git-subtree-split: acd1966bf7f5e1be74b426272635c672def78779
…n/thirdparty/hiredis'
devin-petersohn
referenced
this pull request
in devin-petersohn/ray
Mar 16, 2018
devin-petersohn
referenced
this pull request
in devin-petersohn/ray
Mar 28, 2018
romilbhardwaj
added a commit
to romilbhardwaj/ray
that referenced
this pull request
Apr 8, 2019
� This is the 1st commit message: Rounding error fixes, removing cpu addition in cython and test fixes. � This is the commit message ray-project#2: Plumbing and support for dynamic custom resources. � This is the commit message ray-project#3: update cluster utils to use EntryType. � This is the commit message ray-project#4: Update node_manager to use new zero resource == deletion semantics.
rkooo567
referenced
this pull request
in rkooo567/ray
Mar 24, 2020
[Hosted Dashboard] Running Grafana instances with pre-configured dashboards.
bentzinir
pushed a commit
to bentzinir/ray
that referenced
this pull request
Jul 29, 2020
sven1977
added a commit
that referenced
this pull request
Dec 7, 2020
ericl
added a commit
that referenced
this pull request
Feb 19, 2021
ijrsvt
pushed a commit
that referenced
this pull request
Apr 23, 2021
1 of 2 tasks
2 of 6 tasks
1 of 2 tasks
1 of 6 tasks
sven1977
added a commit
that referenced
this pull request
Jan 25, 2022
3 of 6 tasks
1 of 2 tasks
3 of 6 tasks
ericl
pushed a commit
that referenced
this pull request
Apr 14, 2022
…#23821) This PR refactors `LazyBlockList` in service of out-of-band serialization (see [mono-PR](#22616)) and is a precursor to an execution plan refactor (PR #2) and adding the actual out-of-band serialization APIs (PR #3). The following is included in this refactor: 1. `ReadTask`s are now a first-class concept, replacing calls; 2. read stage progress tracking is consolidated into `LazyBlockList._get_blocks_with_metadta()` and more of the read task complexity, e.g. the read remote function, was pushed into `LazyBlockList` to make `ray.data.read_datasource()` simpler; 3. we are a bit smarter with how we progressively launch tasks and fetch and cache metadata, including fetching the metadata for read tasks in `.iter_blocks_with_metadata()` instead of relying on the pre-read task metadata (which will be less accurate), and we also fix some small bugs in the lazy ramp-up around progressive metadata fetching. (1) is the most important item for supporting out-of-band serialization and fundamentally changes the `LazyBlockList` data model. This is required since we need to be able to reference the underlying read tasks when rewriting read stages during optimization and when serializing the lineage of the Dataset. See the [mono-PR](#22616) for more context. Other changes: 1. Changed stats actor to a global named actor singleton in order to obviate the need for serializing the actor handle with the Dataset stats; without this, we were encountering serialization failures.
MengjinYan
pushed a commit
that referenced
this pull request
Feb 28, 2026
## Description
grpc 1.57.1 will call `GetEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG")`
on every grpc channel establishment for parsing load-balancing policy.
This causes race conditions between user tasks as they are allowed to do
setenv at anytime. This PR upgrades the grpc lib to 1.58.0 to get rid of
the `GetEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG")`.
```
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=129183804413504, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
#3 0x00007580a7545476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#4 <signal handler called>
#5 __pthread_kill_implementation (no_tid=0, signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:44
#6 __pthread_kill_internal (signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:78
#7 __GI___pthread_kill (threadid=129183804413504, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
#8 0x00007580a7545476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#9 <signal handler called>
#10 __GI_getenv (name=0x7580a6a078c2 "PC_EXPERIMENTAL_PICKFIRST_LB_CONFIG") at ./stdlib/getenv.c:84
#11 0x00007580a67e8b8a in grpc_core::GetEnv(char const*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#12 0x00007580a649601f in grpc_core::ShufflePickFirstEnabled() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#13 0x00007580a64960ed in grpc_core::json_detail::FinishedJsonObjectLoader<grpc_core::(anonymous namespace)::PickFirstConfig, 1ul, void>::LoadInto(grpc_core::experimental::Json const&, grpc_core::JsonArgs const&, void*, grpc_core::ValidationErrors*) const () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#14 0x00007580a6787384 in grpc_core::json_detail::LoadWrapped::LoadInto(grpc_core::experimental::Json const&, grpc_core::JsonArgs const&, void*, grpc_core::ValidationErrors*) const ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#15 0x00007580a6497b07 in grpc_core::(anonymous namespace)::PickFirstFactory::ParseLoadBalancingConfig(grpc_core::experimental::Json const&) const ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#16 0x00007580a67c18a7 in grpc_core::LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(grpc_core::experimental::Json const&) const ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#17 0x00007580a66ad9b8 in grpc_core::ClientChannel::OnResolverResultChangedLocked(grpc_core::Resolver::Result) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#18 0x00007580a66ae452 in grpc_core::ClientChannel::ResolverResultHandler::ReportResult(grpc_core::Resolver::Result) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#19 0x00007580a63bc603 in grpc_core::PollingResolver::OnRequestCompleteLocked(grpc_core::Resolver::Result) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#20 0x00007580a63bcb2d in std::_Function_handler<void (), grpc_core::PollingResolver::OnRequestComplete(grpc_core::Resolver::Result)::{lambda()#1}>::_M_invoke(std::_Any_data const&)
() from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#21 0x00007580a67cbf46 in grpc_core::WorkSerializer::WorkSerializerImpl::Run(std::function<void ()>, grpc_core::DebugLocation const&) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#22 0x00007580a67cc0ea in grpc_core::WorkSerializer::Run(std::function<void ()>, grpc_core::DebugLocation const&) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#23 0x00007580a63bd117 in grpc_core::PollingResolver::OnRequestComplete(grpc_core::Resolver::Result) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#24 0x00007580a63b3f86 in grpc_core::(anonymous namespace)::AresClientChannelDNSResolver::AresRequestWrapper::OnHostnameResolved(void*, absl::lts_20230802::Status) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#25 0x00007580a67c44c4 in grpc_core::ExecCtx::Flush() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#26 0x00007580a63408a2 in grpc_core::ExecCtx::~ExecCtx() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#27 0x00007580a6740343 in grpc_call_start_batch () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#28 0x00007580a5e281e9 in grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallOpRecvInitialMetadata, grpc::internal::CallOpRecvMessage<google::protobuf::MessageLite>, grpc::internal::CallOpClientSendClose, grpc::internal::CallOpClientRecvStatus>::ContinueFillOpsAfterInterception() ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#29 0x00007580a5e2d809 in grpc::internal::BlockingUnaryCallImpl<google::protobuf::MessageLite, google::protobuf::MessageLite>::BlockingUnaryCallImpl(grpc::ChannelInterface*, grpc::inte--Type <RET> for more, q to quit, c to continue without paging--c
rnal::RpcMethod const&, grpc::ClientContext*, google::protobuf::MessageLite const&, google::protobuf::MessageLite*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#30 0x00007580a62d76ea in opentelemetry::proto::collector::metrics::v1::MetricsService::Stub::Export(grpc::ClientContext*, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceRequest const&, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceResponse*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#31 0x00007580a62ca40c in opentelemetry::v1::exporter::otlp::OtlpGrpcClient::DelegateExport(opentelemetry::proto::collector::metrics::v1::MetricsService::StubInterface*, std::unique_ptr<grpc::ClientContext, std::default_delete<grpc::ClientContext> >&&, std::unique_ptr<google::protobuf::Arena, std::default_delete<google::protobuf::Arena> >&&, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceRequest&&, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceResponse*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#32 0x00007580a62c23ed in opentelemetry::v1::exporter::otlp::OtlpGrpcMetricExporter::Export(opentelemetry::v1::sdk::metrics::ResourceMetrics const&) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#33 0x00007580a62c0334 in (anonymous namespace)::OpenTelemetryMetricExporter::Export(opentelemetry::v1::sdk::metrics::ResourceMetrics const&) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#34 0x00007580a62e5fdf in opentelemetry::v1::sdk::metrics::PeriodicExportingMetricReader::CollectAndExportOnce()::{lambda()#1}::operator()() const::{lambda(opentelemetry::v1::sdk::metrics::ResourceMetrics&)#1}::operator()(opentelemetry::v1::sdk::metrics::ResourceMetrics&) const () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#35 0x00007580a62ee7a6 in opentelemetry::v1::sdk::metrics::MetricReader::Collect(opentelemetry::v1::nostd::function_ref<bool (opentelemetry::v1::sdk::metrics::ResourceMetrics&)>) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#36 0x00007580a62e5085 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<opentelemetry::v1::sdk::metrics::PeriodicExportingMetricReader::CollectAndExportOnce()::{lambda()#1}> > >::_M_run() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#37 0x00007580a6997be0 in execute_native_thread_routine () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#38 0x00007580a7597ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#39 0x00007580a76298d0 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
```
Signed-off-by: Rueian Huang <[email protected]>
kamil-kaczmarek
pushed a commit
that referenced
this pull request
Mar 3, 2026
## Description
grpc 1.57.1 will call `GetEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG")`
on every grpc channel establishment for parsing load-balancing policy.
This causes race conditions between user tasks as they are allowed to do
setenv at anytime. This PR upgrades the grpc lib to 1.58.0 to get rid of
the `GetEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG")`.
```
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=129183804413504, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
#3 0x00007580a7545476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#4 <signal handler called>
#5 __pthread_kill_implementation (no_tid=0, signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:44
#6 __pthread_kill_internal (signo=11, threadid=129183804413504) at ./nptl/pthread_kill.c:78
#7 __GI___pthread_kill (threadid=129183804413504, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
#8 0x00007580a7545476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#9 <signal handler called>
#10 __GI_getenv (name=0x7580a6a078c2 "PC_EXPERIMENTAL_PICKFIRST_LB_CONFIG") at ./stdlib/getenv.c:84
#11 0x00007580a67e8b8a in grpc_core::GetEnv(char const*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#12 0x00007580a649601f in grpc_core::ShufflePickFirstEnabled() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#13 0x00007580a64960ed in grpc_core::json_detail::FinishedJsonObjectLoader<grpc_core::(anonymous namespace)::PickFirstConfig, 1ul, void>::LoadInto(grpc_core::experimental::Json const&, grpc_core::JsonArgs const&, void*, grpc_core::ValidationErrors*) const () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#14 0x00007580a6787384 in grpc_core::json_detail::LoadWrapped::LoadInto(grpc_core::experimental::Json const&, grpc_core::JsonArgs const&, void*, grpc_core::ValidationErrors*) const ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#15 0x00007580a6497b07 in grpc_core::(anonymous namespace)::PickFirstFactory::ParseLoadBalancingConfig(grpc_core::experimental::Json const&) const ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#16 0x00007580a67c18a7 in grpc_core::LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(grpc_core::experimental::Json const&) const ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#17 0x00007580a66ad9b8 in grpc_core::ClientChannel::OnResolverResultChangedLocked(grpc_core::Resolver::Result) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#18 0x00007580a66ae452 in grpc_core::ClientChannel::ResolverResultHandler::ReportResult(grpc_core::Resolver::Result) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#19 0x00007580a63bc603 in grpc_core::PollingResolver::OnRequestCompleteLocked(grpc_core::Resolver::Result) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#20 0x00007580a63bcb2d in std::_Function_handler<void (), grpc_core::PollingResolver::OnRequestComplete(grpc_core::Resolver::Result)::{lambda()#1}>::_M_invoke(std::_Any_data const&)
() from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#21 0x00007580a67cbf46 in grpc_core::WorkSerializer::WorkSerializerImpl::Run(std::function<void ()>, grpc_core::DebugLocation const&) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#22 0x00007580a67cc0ea in grpc_core::WorkSerializer::Run(std::function<void ()>, grpc_core::DebugLocation const&) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#23 0x00007580a63bd117 in grpc_core::PollingResolver::OnRequestComplete(grpc_core::Resolver::Result) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#24 0x00007580a63b3f86 in grpc_core::(anonymous namespace)::AresClientChannelDNSResolver::AresRequestWrapper::OnHostnameResolved(void*, absl::lts_20230802::Status) ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#25 0x00007580a67c44c4 in grpc_core::ExecCtx::Flush() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#26 0x00007580a63408a2 in grpc_core::ExecCtx::~ExecCtx() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#27 0x00007580a6740343 in grpc_call_start_batch () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#28 0x00007580a5e281e9 in grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallOpRecvInitialMetadata, grpc::internal::CallOpRecvMessage<google::protobuf::MessageLite>, grpc::internal::CallOpClientSendClose, grpc::internal::CallOpClientRecvStatus>::ContinueFillOpsAfterInterception() ()
from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#29 0x00007580a5e2d809 in grpc::internal::BlockingUnaryCallImpl<google::protobuf::MessageLite, google::protobuf::MessageLite>::BlockingUnaryCallImpl(grpc::ChannelInterface*, grpc::inte--Type <RET> for more, q to quit, c to continue without paging--c
rnal::RpcMethod const&, grpc::ClientContext*, google::protobuf::MessageLite const&, google::protobuf::MessageLite*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#30 0x00007580a62d76ea in opentelemetry::proto::collector::metrics::v1::MetricsService::Stub::Export(grpc::ClientContext*, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceRequest const&, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceResponse*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#31 0x00007580a62ca40c in opentelemetry::v1::exporter::otlp::OtlpGrpcClient::DelegateExport(opentelemetry::proto::collector::metrics::v1::MetricsService::StubInterface*, std::unique_ptr<grpc::ClientContext, std::default_delete<grpc::ClientContext> >&&, std::unique_ptr<google::protobuf::Arena, std::default_delete<google::protobuf::Arena> >&&, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceRequest&&, opentelemetry::proto::collector::metrics::v1::ExportMetricsServiceResponse*) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#32 0x00007580a62c23ed in opentelemetry::v1::exporter::otlp::OtlpGrpcMetricExporter::Export(opentelemetry::v1::sdk::metrics::ResourceMetrics const&) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#33 0x00007580a62c0334 in (anonymous namespace)::OpenTelemetryMetricExporter::Export(opentelemetry::v1::sdk::metrics::ResourceMetrics const&) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#34 0x00007580a62e5fdf in opentelemetry::v1::sdk::metrics::PeriodicExportingMetricReader::CollectAndExportOnce()::{lambda()#1}::operator()() const::{lambda(opentelemetry::v1::sdk::metrics::ResourceMetrics&)#1}::operator()(opentelemetry::v1::sdk::metrics::ResourceMetrics&) const () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#35 0x00007580a62ee7a6 in opentelemetry::v1::sdk::metrics::MetricReader::Collect(opentelemetry::v1::nostd::function_ref<bool (opentelemetry::v1::sdk::metrics::ResourceMetrics&)>) () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#36 0x00007580a62e5085 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<opentelemetry::v1::sdk::metrics::PeriodicExportingMetricReader::CollectAndExportOnce()::{lambda()#1}> > >::_M_run() () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#37 0x00007580a6997be0 in execute_native_thread_routine () from /home/ray/anaconda3/lib/python3.10/site-packages/ray/_raylet.so
#38 0x00007580a7597ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#39 0x00007580a76298d0 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
```
Signed-off-by: Rueian Huang <[email protected]>
Signed-off-by: Kamil Kaczmarek <[email protected]>
This was referenced May 9, 2026
4 tasks
Sparks0219
added a commit
that referenced
this pull request
Jun 23, 2026
## Why are these changes needed? Ray's NIXL tensor transport currently hardcodes the UCX backend (`nixl_agent_config(backends=["UCX"])`). On AWS EFA instances UCX cannot drive the EFA NICs (they are libfabric-only), so cross-node RDT transfers silently degrade to **software-emulated RMA over TCP (~0.3 GB/s)** — correct data, but ~600× slower than the hardware is capable of, with no warning emitted. NIXL itself logs a hint recommending LIBFABRIC. This change makes `NixlTensorTransport` select the **LIBFABRIC** backend on EFA hardware (falling back to UCX everywhere else), unlocking genuine GPUDirect RDMA over EFA. Builds on the initial draft (`joshlee/use-libfabric-nixl-backend`) and hardens it for the environments where naive device-presence selection fails: containers/K8s, hosts without GPUDirect, and CUDA VMM allocators. ### What's included 1. **Backend auto-selection** (`select_backend()`): `LIBFABRIC` when EFA is present, else `UCX`. `get_nixl_agent()` uses it instead of the hardcoded UCX. 2. **Container/K8s-aware EFA detection.** Device presence alone (`glob /sys/class/net/efa*`) is **empty inside pods** — netdevs are network- namespaced — so on K8s the naive check reports "no EFA" and silently selects the slow UCX/TCP path. Detection also accepts the rdma-verbs devices the EFA k8s device-plugin mounts (`/dev/infiniband/uverbs*` + `/sys/class/infiniband/*`). 3. **Validate before committing to LIBFABRIC.** EFA-present ≠ GPUDirect-works: on hosts/drivers without `nvidia-peermem`/dmabuf, LIBFABRIC instantiates and registers *small* CUDA buffers via EFA's ~32 MiB host bounce pool (looks healthy), but `fi_mr_reg` of a real-size buffer fails at transfer time with `NIXL_ERR_BACKEND`. We register/deregister a CUDA buffer **at realistic transfer size** before committing, and fall back to UCX on failure. Size is tunable via `RAY_NIXL_VALIDATE_BYTES`. 4. **VMM (`expandable_segments`) safety.** CUDA VMM memory (`PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True`, standard in large-model training) cannot be RDMA-registered. The validation probe allocates non-expandable memory so it mirrors a real registrable buffer rather than false-failing on a VMM probe. 5. **`RAY_NIXL_BACKEND` override.** Per-process auto-detection can diverge between the two endpoints of a transfer when they run in different processes / Ray jobs with different allocator state (observed: sender → UCX, receiver → LIBFABRIC → every read fails `NIXL_ERR_BACKEND`). `RAY_NIXL_BACKEND=UCX| LIBFABRIC` lets an orchestrator pin both sides; the size-matched probe makes auto-selection deterministic across same-shaped hosts as the default. 6. **Per-transfer stats + backend-specific diagnostics** (`NixlTransferStats`: bytes, xfer time, throughput, backend) and backend-aware error hints (`FI_LOG_LEVEL=Debug` for LIBFABRIC, `UCX_LOG_LEVEL=debug` for UCX) on registration failure. ## Benchmark results Validated in a downstream RL trainer (miles) weight-sync workload (Megatron trainer → sglang rollout engines) on Anyscale, p5.48xlarge (8×H100-80GB, 32×EFA), Ray 2.55.1 + this change, cross-node (every transfer crosses the node boundary). This addresses the draft's "TODO: benchmarking". | Backend | path | effective bandwidth | |---|---|---| | **LIBFABRIC (this PR)** | GPUDirect RDMA over EFA | **~23–30 GiB/s per source** | | UCX (status quo on EFA) | software-emulated RMA over TCP | ~0.3 GB/s | End-to-end weight-sync time (`pull_wait` = pure transfer; full model bf16): | Model | size | shard/src | `pull_wait` (transfer) | full sync | |---|---|---|---|---| | Qwen3-30B-A3B | 57 GiB | 14.24 GiB | 0.61 s | 2.7 s | | GLM-4.7-Flash (MLA+MoE) | — | 14.13 GiB | 0.61 s | 1.9 s | | Moonlight-16B (MLA) | — | 7.48 GiB | 0.33 s | 1.0 s | - LIBFABRIC over EFA was **~8–9× faster than NCCL broadcast** for the same cross-node sync (~3 s vs ~26 s for the 57 GiB model). - Flat across 2→4 nodes (transfer is per-source-shard bound, not node-count bound). - All transfers byte-correct end-to-end (downstream `--check-weight-update-equal` byte-compares the received weights, incl. MLA and fused-MoE tensors). Without fix #2 (K8s detection) the change is a silent no-op on pods (stays on UCX/TCP). Without #3/#4 it selects LIBFABRIC and then fails at transfer time on no-GPUDirect/VMM hosts. With all of them, the LIBFABRIC path is correct and fast across dense, MoE, and MLA models. ## Related issue number Builds on / supersedes the draft on `joshlee/use-libfabric-nixl-backend`. ## Checks - Testing strategy: exercised via a real cross-node RDT weight-sync workload on EFA hardware (numbers above), plus the fallback paths — UCX selection on non-EFA, and LIBFABRIC→UCX fallback when the transfer-size CUDA registration fails (no-GPUDirect host). Suggested unit coverage: `select_backend()` honors `RAY_NIXL_BACKEND` and the EFA globs; `get_nixl_agent()` falls back to UCX when the validation registration raises. - [ ] Signed off commits - [ ] `scripts/format.sh` - [ ] Doc update (`doc/source/ray-core/direct-transport.rst` — backend selection section) - [ ] Tests passing ## Notes for reviewers - The `NixlTransferStats` backend field reads `list(nixl_agent.backends.keys())`; confirm `backends` is always a dict on the supported NIXL version (an earlier review flagged a possible `AttributeError`) and consider guarding it, since the stats path runs on the hot recv path. - Detection globs are cached (`functools.lru_cache`) — fine since hardware doesn't change within a process. --------- Signed-off-by: Joshua Lee <[email protected]> Signed-off-by: xyuzh <[email protected]> Co-authored-by: xyuzh <[email protected]>
limarkdcunha
pushed a commit
to limarkdcunha/ray
that referenced
this pull request
Jun 30, 2026
## Why are these changes needed? Ray's NIXL tensor transport currently hardcodes the UCX backend (`nixl_agent_config(backends=["UCX"])`). On AWS EFA instances UCX cannot drive the EFA NICs (they are libfabric-only), so cross-node RDT transfers silently degrade to **software-emulated RMA over TCP (~0.3 GB/s)** — correct data, but ~600× slower than the hardware is capable of, with no warning emitted. NIXL itself logs a hint recommending LIBFABRIC. This change makes `NixlTensorTransport` select the **LIBFABRIC** backend on EFA hardware (falling back to UCX everywhere else), unlocking genuine GPUDirect RDMA over EFA. Builds on the initial draft (`joshlee/use-libfabric-nixl-backend`) and hardens it for the environments where naive device-presence selection fails: containers/K8s, hosts without GPUDirect, and CUDA VMM allocators. ### What's included 1. **Backend auto-selection** (`select_backend()`): `LIBFABRIC` when EFA is present, else `UCX`. `get_nixl_agent()` uses it instead of the hardcoded UCX. 2. **Container/K8s-aware EFA detection.** Device presence alone (`glob /sys/class/net/efa*`) is **empty inside pods** — netdevs are network- namespaced — so on K8s the naive check reports "no EFA" and silently selects the slow UCX/TCP path. Detection also accepts the rdma-verbs devices the EFA k8s device-plugin mounts (`/dev/infiniband/uverbs*` + `/sys/class/infiniband/*`). 3. **Validate before committing to LIBFABRIC.** EFA-present ≠ GPUDirect-works: on hosts/drivers without `nvidia-peermem`/dmabuf, LIBFABRIC instantiates and registers *small* CUDA buffers via EFA's ~32 MiB host bounce pool (looks healthy), but `fi_mr_reg` of a real-size buffer fails at transfer time with `NIXL_ERR_BACKEND`. We register/deregister a CUDA buffer **at realistic transfer size** before committing, and fall back to UCX on failure. Size is tunable via `RAY_NIXL_VALIDATE_BYTES`. 4. **VMM (`expandable_segments`) safety.** CUDA VMM memory (`PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True`, standard in large-model training) cannot be RDMA-registered. The validation probe allocates non-expandable memory so it mirrors a real registrable buffer rather than false-failing on a VMM probe. 5. **`RAY_NIXL_BACKEND` override.** Per-process auto-detection can diverge between the two endpoints of a transfer when they run in different processes / Ray jobs with different allocator state (observed: sender → UCX, receiver → LIBFABRIC → every read fails `NIXL_ERR_BACKEND`). `RAY_NIXL_BACKEND=UCX| LIBFABRIC` lets an orchestrator pin both sides; the size-matched probe makes auto-selection deterministic across same-shaped hosts as the default. 6. **Per-transfer stats + backend-specific diagnostics** (`NixlTransferStats`: bytes, xfer time, throughput, backend) and backend-aware error hints (`FI_LOG_LEVEL=Debug` for LIBFABRIC, `UCX_LOG_LEVEL=debug` for UCX) on registration failure. ## Benchmark results Validated in a downstream RL trainer (miles) weight-sync workload (Megatron trainer → sglang rollout engines) on Anyscale, p5.48xlarge (8×H100-80GB, 32×EFA), Ray 2.55.1 + this change, cross-node (every transfer crosses the node boundary). This addresses the draft's "TODO: benchmarking". | Backend | path | effective bandwidth | |---|---|---| | **LIBFABRIC (this PR)** | GPUDirect RDMA over EFA | **~23–30 GiB/s per source** | | UCX (status quo on EFA) | software-emulated RMA over TCP | ~0.3 GB/s | End-to-end weight-sync time (`pull_wait` = pure transfer; full model bf16): | Model | size | shard/src | `pull_wait` (transfer) | full sync | |---|---|---|---|---| | Qwen3-30B-A3B | 57 GiB | 14.24 GiB | 0.61 s | 2.7 s | | GLM-4.7-Flash (MLA+MoE) | — | 14.13 GiB | 0.61 s | 1.9 s | | Moonlight-16B (MLA) | — | 7.48 GiB | 0.33 s | 1.0 s | - LIBFABRIC over EFA was **~8–9× faster than NCCL broadcast** for the same cross-node sync (~3 s vs ~26 s for the 57 GiB model). - Flat across 2→4 nodes (transfer is per-source-shard bound, not node-count bound). - All transfers byte-correct end-to-end (downstream `--check-weight-update-equal` byte-compares the received weights, incl. MLA and fused-MoE tensors). Without fix ray-project#2 (K8s detection) the change is a silent no-op on pods (stays on UCX/TCP). Without ray-project#3/ray-project#4 it selects LIBFABRIC and then fails at transfer time on no-GPUDirect/VMM hosts. With all of them, the LIBFABRIC path is correct and fast across dense, MoE, and MLA models. ## Related issue number Builds on / supersedes the draft on `joshlee/use-libfabric-nixl-backend`. ## Checks - Testing strategy: exercised via a real cross-node RDT weight-sync workload on EFA hardware (numbers above), plus the fallback paths — UCX selection on non-EFA, and LIBFABRIC→UCX fallback when the transfer-size CUDA registration fails (no-GPUDirect host). Suggested unit coverage: `select_backend()` honors `RAY_NIXL_BACKEND` and the EFA globs; `get_nixl_agent()` falls back to UCX when the validation registration raises. - [ ] Signed off commits - [ ] `scripts/format.sh` - [ ] Doc update (`doc/source/ray-core/direct-transport.rst` — backend selection section) - [ ] Tests passing ## Notes for reviewers - The `NixlTransferStats` backend field reads `list(nixl_agent.backends.keys())`; confirm `backends` is always a dict on the supported NIXL version (an earlier review flagged a possible `AttributeError`) and consider guarding it, since the stats path runs on the hot recv path. - Detection globs are cached (`functools.lru_cache`) — fine since hardware doesn't change within a process. --------- Signed-off-by: Joshua Lee <[email protected]> Signed-off-by: xyuzh <[email protected]> Co-authored-by: xyuzh <[email protected]>
AarryaSaraf
added a commit
to AarryaSaraf/ray
that referenced
this pull request
Jul 28, 2026
… probe thrift_string_size_limit / thrift_container_size_limit only decide whether a file's footer is accepted or rejected — they can never change decoded bytes. Instead of falling the whole read back to PyArrow, the planned native read now runs a metadata-only pyarrow footer parse with the limits applied (_verify_footer_limits, one footer read per file, only when a limit is set): the same C++ thrift parser the scanner uses, so the accept/reject verdict and the raised OSError are identical by construction, and the data decode stays native. The per-fragment re-gate still blocks them (no probe machinery there). This is the one deliberate exception to "pyarrow never opens a supported file". The fallback audit test now uses page_checksum_verification (still blocked; crate crc feature is compile-time always-on — TODO.md ray-project#3); new test_thrift_limits_native_parity pins generous-limit → native + equal and tiny-limit → identical OSError from BOTH readers. Suite: 70 passed + 13 skipped (S3 env); ruff+black clean. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: Aarrya <[email protected]>
AarryaSaraf
added a commit
to AarryaSaraf/ray
that referenced
this pull request
Jul 28, 2026
… SIGSEGV) The 2026-07 master nightly SIGSEGVs in TaskEventBufferImpl::SendRayEventsToAggregator -> GrpcClient::CallMethod, killing workers AND the driver (reproduced deterministically on the 2026-07-28 workspace box during setup.sh's verify step). The harness doesn't use task events, so bench_suite.py now setdefaults RAY_task_events_report_interval_ms=0 and setup.sh's verify sets it on the invocation; runbook pitfall ray-project#3 updated to say it's automatic. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Aarrya <[email protected]>
AarryaSaraf
added a commit
to AarryaSaraf/ray
that referenced
this pull request
Aug 17, 2026
…osses (M31/M32/M33) Each release loss shape (read_large_parquet_autoscaling, write_parquet, wide_schema tensors) runs standalone (no Ray/no S3), through Ray on local files, and through Ray on S3 — both readers per part, plus a MALLOC_ARENA_MAX=2 arm on the arrow-rs Ray cells — so one table attributes each loss to the native decoder, Ray integration, or the crate S3 path. Ray cells poll per-task USS at 20 Hz because the release 1 Hz poll cannot measure the sub-second autoscaling tasks (end-of-task sample, not a peak). New auto_rg fixture: 48 files x one ~69 MiB row group (the M31 geometry). Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Aarrya <[email protected]>
400Ping
pushed a commit
to 400Ping/ray
that referenced
this pull request
Aug 18, 2026
## Why are these changes needed? Ray's NIXL tensor transport currently hardcodes the UCX backend (`nixl_agent_config(backends=["UCX"])`). On AWS EFA instances UCX cannot drive the EFA NICs (they are libfabric-only), so cross-node RDT transfers silently degrade to **software-emulated RMA over TCP (~0.3 GB/s)** — correct data, but ~600× slower than the hardware is capable of, with no warning emitted. NIXL itself logs a hint recommending LIBFABRIC. This change makes `NixlTensorTransport` select the **LIBFABRIC** backend on EFA hardware (falling back to UCX everywhere else), unlocking genuine GPUDirect RDMA over EFA. Builds on the initial draft (`joshlee/use-libfabric-nixl-backend`) and hardens it for the environments where naive device-presence selection fails: containers/K8s, hosts without GPUDirect, and CUDA VMM allocators. ### What's included 1. **Backend auto-selection** (`select_backend()`): `LIBFABRIC` when EFA is present, else `UCX`. `get_nixl_agent()` uses it instead of the hardcoded UCX. 2. **Container/K8s-aware EFA detection.** Device presence alone (`glob /sys/class/net/efa*`) is **empty inside pods** — netdevs are network- namespaced — so on K8s the naive check reports "no EFA" and silently selects the slow UCX/TCP path. Detection also accepts the rdma-verbs devices the EFA k8s device-plugin mounts (`/dev/infiniband/uverbs*` + `/sys/class/infiniband/*`). 3. **Validate before committing to LIBFABRIC.** EFA-present ≠ GPUDirect-works: on hosts/drivers without `nvidia-peermem`/dmabuf, LIBFABRIC instantiates and registers *small* CUDA buffers via EFA's ~32 MiB host bounce pool (looks healthy), but `fi_mr_reg` of a real-size buffer fails at transfer time with `NIXL_ERR_BACKEND`. We register/deregister a CUDA buffer **at realistic transfer size** before committing, and fall back to UCX on failure. Size is tunable via `RAY_NIXL_VALIDATE_BYTES`. 4. **VMM (`expandable_segments`) safety.** CUDA VMM memory (`PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True`, standard in large-model training) cannot be RDMA-registered. The validation probe allocates non-expandable memory so it mirrors a real registrable buffer rather than false-failing on a VMM probe. 5. **`RAY_NIXL_BACKEND` override.** Per-process auto-detection can diverge between the two endpoints of a transfer when they run in different processes / Ray jobs with different allocator state (observed: sender → UCX, receiver → LIBFABRIC → every read fails `NIXL_ERR_BACKEND`). `RAY_NIXL_BACKEND=UCX| LIBFABRIC` lets an orchestrator pin both sides; the size-matched probe makes auto-selection deterministic across same-shaped hosts as the default. 6. **Per-transfer stats + backend-specific diagnostics** (`NixlTransferStats`: bytes, xfer time, throughput, backend) and backend-aware error hints (`FI_LOG_LEVEL=Debug` for LIBFABRIC, `UCX_LOG_LEVEL=debug` for UCX) on registration failure. ## Benchmark results Validated in a downstream RL trainer (miles) weight-sync workload (Megatron trainer → sglang rollout engines) on Anyscale, p5.48xlarge (8×H100-80GB, 32×EFA), Ray 2.55.1 + this change, cross-node (every transfer crosses the node boundary). This addresses the draft's "TODO: benchmarking". | Backend | path | effective bandwidth | |---|---|---| | **LIBFABRIC (this PR)** | GPUDirect RDMA over EFA | **~23–30 GiB/s per source** | | UCX (status quo on EFA) | software-emulated RMA over TCP | ~0.3 GB/s | End-to-end weight-sync time (`pull_wait` = pure transfer; full model bf16): | Model | size | shard/src | `pull_wait` (transfer) | full sync | |---|---|---|---|---| | Qwen3-30B-A3B | 57 GiB | 14.24 GiB | 0.61 s | 2.7 s | | GLM-4.7-Flash (MLA+MoE) | — | 14.13 GiB | 0.61 s | 1.9 s | | Moonlight-16B (MLA) | — | 7.48 GiB | 0.33 s | 1.0 s | - LIBFABRIC over EFA was **~8–9× faster than NCCL broadcast** for the same cross-node sync (~3 s vs ~26 s for the 57 GiB model). - Flat across 2→4 nodes (transfer is per-source-shard bound, not node-count bound). - All transfers byte-correct end-to-end (downstream `--check-weight-update-equal` byte-compares the received weights, incl. MLA and fused-MoE tensors). Without fix ray-project#2 (K8s detection) the change is a silent no-op on pods (stays on UCX/TCP). Without ray-project#3/ray-project#4 it selects LIBFABRIC and then fails at transfer time on no-GPUDirect/VMM hosts. With all of them, the LIBFABRIC path is correct and fast across dense, MoE, and MLA models. ## Related issue number Builds on / supersedes the draft on `joshlee/use-libfabric-nixl-backend`. ## Checks - Testing strategy: exercised via a real cross-node RDT weight-sync workload on EFA hardware (numbers above), plus the fallback paths — UCX selection on non-EFA, and LIBFABRIC→UCX fallback when the transfer-size CUDA registration fails (no-GPUDirect host). Suggested unit coverage: `select_backend()` honors `RAY_NIXL_BACKEND` and the EFA globs; `get_nixl_agent()` falls back to UCX when the validation registration raises. - [ ] Signed off commits - [ ] `scripts/format.sh` - [ ] Doc update (`doc/source/ray-core/direct-transport.rst` — backend selection section) - [ ] Tests passing ## Notes for reviewers - The `NixlTransferStats` backend field reads `list(nixl_agent.backends.keys())`; confirm `backends` is always a dict on the supported NIXL version (an earlier review flagged a possible `AttributeError`) and consider guarding it, since the stats path runs on the hot recv path. - Detection globs are cached (`functools.lru_cache`) — fine since hardware doesn't change within a process. --------- Signed-off-by: Joshua Lee <[email protected]> Signed-off-by: xyuzh <[email protected]> Co-authored-by: xyuzh <[email protected]> Signed-off-by: 400Ping <[email protected]>
suppagoddo
added a commit
to suppagoddo/ray
that referenced
this pull request
Sep 17, 2026
…troller Address review (ray-project#3/ray-project#4/ray-project#12 in the thread): - Do not checkpoint the tracing config on first start. Ray replays the controller's constructor arg on restart (max_restarts=-1), so persisting the initial config buys nothing, and a checkpoint written on start lets a controller killed without shutdown() shadow a later serve.start(tracing_config=...). Only a runtime change (serve deploy / reconfigure) is now checkpointed, which is the state that is *not* in the replayed constructor arg and so must survive recovery. - Extract `_apply_global_tracing_config(config, *, checkpoint)` shared by the constructor (checkpoint=False) and reconfigure (checkpoint=True), removing the duplicated store/broadcast/log block. This intentionally differs from the logging-config path, which still checkpoints on first start (same latent shadowing, out of scope here). - Add a test that a runtime change is checkpointed, deleted on shutdown, and does not shadow the next serve.start() in the same cluster (the checkpoint delete previously had no coverage). Signed-off-by: uditagrawal <[email protected]>
daiping8
added a commit
to daiping8/ray
that referenced
this pull request
Sep 22, 2026
… Put, local mode, public API, tests) (ray-project#3) * feat(go): add zero-copy Put and complete the local-mode runtime Port the internal Go runtime delta onto the open-source base: - Zero-copy Put: Go encodes once into a pooled buffer and writes directly into plasma memory via the new CObjectStore_CreateOwned/CreateExisting/ WriteData/SealOwned/SealExisting ABI; ObjectIDs come from the C++ core worker; the buffer pool tracks ownership so Close() returns only pool-allocated buffers. - Local mode full chain: api-layer routing (two-arg RegisterInitializer), localstore folded into objectstore, function discovery via function.Registry.ListEntries, and the public pkg/runtime/local entry point (local.Enable + api.InitLocal). - Public API surface: KillActor, RegisterActorClass, GetRegisteredFunctionsVersion, InitLocal, Internal, and the Python task/actor caller types. - Express ObjectID index size in bits (32) to match the C++ constant. Signed-off-by: daiping8 <[email protected]> * chore(go): slim the Go runtime binary and trim protobuf deps Strip debug info from the raygo binary, tolerate unknown raylet-appended worker flags (FParseErrWhitelist), and drop the gRPC dependency from the Go protobuf output so go_runtime.so links without the grpc stubs. Prefer go_proto_compile over go_grpc_compile for messages-only output. Signed-off-by: daiping8 <[email protected]> * test(go): port internal unit tests and examples Add the B-class Go test files (cgo/native/serializer/objectstore/resource, pkg runtime api/function/object/gcs/options) plus the userfuncs, zero_copy_benchmark, actor_integration_driver and driver_call_python examples, adapted to the open-source API surface and testify version. Tests gated on internal-only symbols (zero-copy Get, actor-executor, call scaffolding) are left out. Align ObjectIDIndexSize assertion with the bit- width constant. Signed-off-by: daiping8 <[email protected]> * fix(go): address code review on the internal delta port Fix four semantic regressions that review found in the port, aligned with the internal tree: - createObjectRefWithFinalizer no longer calls AddLocalReference for task return IDs: the C++ TaskManager already registered the local reference, so the Go call double-counted and leaked (internal 0ea9a1eaa6). - convertArgToFunctionArg now deep-copies Metadata for pass-by-value arguments via a functionArgByValue helper, so cross-language (e.g. Python) receivers get a non-empty metadata (internal functionArgByValue). - ObjectSerializerImpl.Serialize carries the dataFromPool flag onto the returned NativeRayObject so pooled small-object encodings are returned to the pool on Close instead of leaking to the GC. - Pass-by-reference arguments now carry getCurrentWorkerRpcAddress as the owner address so the raylet can locate the owner when pulling the object (an empty owner crashes CoreWorkerClientPool::GetOrConnect). Also implement KillActor end-to-end (it previously always returned kill_actor_not_supported): add TaskSubmitterOperations::KillActor and the CNativeTaskSubmitter_KillActor C ABI, ported from the internal bridge, and implement it on both the cgo NativeTaskSubmitter and the local-mode submitter (with removeActorState). Adds a local-mode KillActor test. Signed-off-by: daiping8 <[email protected]> * test(go): drop the cluster-dependent GetActor case from the cgo unit target GetActor resolves a named actor through the C++ CoreWorker GCS client, which aborts the process when no core worker is running. Go runs tests in declaration order in one binary, so that abort also killed every test declared after it (the task_executor and converter tests), leaving 14 tests unexecuted and the target red. Named-actor lookup needs a live cluster and belongs in an integration test target. With this, //go/... is green: 32 of 32 targets pass (cgo_test: 57 pass, 12 skip, 0 fail), and the converter/task-executor tests now actually run. Signed-off-by: daiping8 <[email protected]> --------- Signed-off-by: daiping8 <[email protected]>
edoakes
pushed a commit
that referenced
this pull request
Nov 4, 2026
…ompatible with passive setup (#66635) ## Description Under the Active-Passive GCS architecture (`RAY_ENABLE_GCS_LEADER_ELECTION=true`), a passive GCS instance rejects all mutating RPCs with `StatusCode::GcsPassive`. Previously, Python head processes (`ray start --head`, Dashboard, Autoscaler, Log Monitor, Reporter) assumed they were always talking to an active GCS. Consequently, starting a passive head led to fatal crashes, 60-second startup hangs, log-bombing, or state divergence upon failover. This PR makes all Python head components resilient to passive GCS write refusals. Passive heads can now boot cleanly, idle safely without split-brain side effects, suppress repetitive error logging, and seamlessly replay critical cluster state upon promotion to leader. All changes are gated behind `RAY_ENABLE_GCS_LEADER_ELECTION` (default `False`), ensuring zero behavioral impact when leader election is disabled. ### Key Changes (by Subsystem) #### 1. Core Exception & Centralized Passive Utilities * **Dedicated Exception (`GcsPassiveError`)**: Subclasses `RpcError` to distinguish expected passive GCS write refusals from fatal network partitions or GCS crashes without relying on fragile error string parsing. * **Consolidated Utilities (`ray._private.gcs_passive_utils`)**: * `is_refused_by_passive_gcs(exc, latch=None)`: Unified predicate for passive refusal detection. * `PassiveLatch`: Edge-triggered latch that logs transitions entering and exiting passive mode once, eliminating per-second log spam across loops. * `wait_until_gcs_leader()`: Async loop gating utility that suspends processing until the node is promoted. * Passive-safe KV helpers (`put_kv_passive_safe`, `async_put_kv_passive_safe`, `del_kv_passive_safe`, `async_del_kv_passive_safe`): Unified sync/async helpers handling passive refusals and latch transitions cleanly. #### 2. Head Node Bootstrap & Process Supervision (`ray start --head`) * **Survive Passive Write Rejections**: `_write_cluster_info_to_kv()` catches `GcsPassiveError` and allows node initialization to continue without writing initial cluster info. * **Eliminate 60s Startup Timeout**: `start_api_server()` skips polling for `DASHBOARD_ADDRESS` when GCS is passive and returns `process_info` immediately. This prevents a 60-second stall and avoids dropping the dashboard from KubeRay’s `dead_processes()` liveness supervisor. * **Skip Dead Writes**: Passive nodes skip writing `webui:url` to GCS since the URL is deferred until promotion. #### 3. Dashboard Head, Agents & Promotion Replay Contract * **Dashboard Agent Survival**: Dashboard Agent retries registering its node-specific address rather than crashing on passive refusal (preventing the fate-shared Raylet on the passive head from dying). * **Dashboard Head Promotion Loop**: Dashboard Head defers publishing its address and waits for leadership in `_register_addresses_loop()` (leveraging existing `_gcs_check_alive()` cache without extra RPCs). * **Explicit Promotion Replay Contract (`HEAD_PROMOTION_REPLAY_KEYS`)**: Defined in `dashboard/consts.py` to enumerate all keys that must be replayed upon promotion (`DASHBOARD_ADDRESS`, `webui:url`, `session_name`, `CLUSTER_METADATA`, `tracing_startup_hook`, and bulk extra usage tags). * **Agent Log Muting**: `EventAgent` and `ReporterAgent` use `PassiveLatch` to mute repetitive registration failures while waiting for promotion. #### 4. NodeHead Subprocess * **Pause Subscriptions on Passive**: Uses `wait_until_gcs_leader()` to pause node and actor update subscriptions until promoted. * **State Consistency**: Records `_registered_head_node_id` only *after* the KV put succeeds to prevent poisoned in-memory state on write rejections. * **Passive-Safe Address Cleanup**: Dead node agent address cleanup (`_delete_agent_addresses`) ignores passive GCS refusals. * **Fault Isolation**: Catches per-node update errors in `_update_nodes` so a single malformed entry does not terminate the subscription loop. #### 5. Autoscaler Monitors (v1 & v2) * **Pause autoscaler on Passive** * **Safe Startup**: Catches passive rejections during `AutoscalerMetricsAddress` registration and `DEBUG_AUTOSCALING_ERROR` cleanup. * **Split-Brain Prevention**: Reconcile loops in both v1 and v2 check `is_gcs_leader()` before each pass, remaining idle while passive. This prevents passive heads from issuing unauthorized node launches or terminations to cloud providers. * **Promotion Takeover**: On promotion, atomically rewrites `AutoscalerMetricsAddress` and clears stale error status so `ray status` reflects the newly active autoscaler. #### 6. Log Monitor * **Log-Storm Suppression**: Catches `GcsPassiveError` on rejected log publish batches and uses `PassiveLatch` to log state transitions once. * **Continuous File Consumption**: Continues advancing file read offsets while passive instead of parking. This avoids costly `is_gcs_leader()` polling and prevents massive re-reading/publishing log storms upon promotion. #### 7. Usage Stats & Telemetry * **Silence Passive Telemetry**: Restricts `UsageStatsHead` reporting to active leaders, preventing duplicate empty telemetry reports under the same session ID. * **Graceful Metadata Read**: `get_cluster_metadata()` returns `None` instead of raising `AttributeError` when the key has not yet been written, allowing early joining workers to connect safely. ###GCS `internal_kv` Key Handling Strategies Because different cluster state keys have distinct consistency requirements and lifecycles, mutating operations on GCS `internal_kv` are categorized into explicit synchronization strategies: | Key | Namespace | Strategy | Passive Startup Behavior | Promotion Behavior | Design Rationale & Considerations | | :--- | :--- | :--- | :--- | :--- | :--- | | **`session_name`** | `KV_NAMESPACE_SESSION`<br>(`"session"`) | **Write When Absent**<br>(`overwrite=False`) | `Node._write_cluster_info_to_kv()` catches write refusal and skips; startup continues. | Replayed by `DashboardHead` with `overwrite=False`. | **Idempotent recovery**: Cluster must have exactly one immutable session name. If the previous leader already wrote it, promotion will not overwrite it; if the previous leader crashed before writing it, this closes the gap so workers can join. | | **`CLUSTER_METADATA`** | `KV_NAMESPACE_CLUSTER`<br>(`"cluster"`) | **Deferred Overwrite**<br>(`overwrite=True`) | `Node` catches write refusal and skips. Readers return `None` instead of raising `AttributeError`. | Replayed by `DashboardHead` with `overwrite=True`; `ReporterHead` stops permanently caching it. | **Supports rolling upgrades**: Passive head may be upgraded before taking over. Overwriting ensures joining workers validate version compatibility against the promoted head rather than a decommissioned predecessor. | | **`DASHBOARD_ADDRESS`** | `KV_NAMESPACE_DASHBOARD`<br>(`"dashboard"`) | **Deferred to Promotion**<br>(`overwrite=True`) | `DashboardHead` defers registration; `start_api_server()` skips polling and returns `process_info` immediately. | Replayed by `DashboardHead` with `overwrite=True`. | **Eliminates 60s hang & preserves supervision**: Avoids burning `RAY_DASHBOARD_STARTUP_TIMEOUT_S`. Returning valid `process_info` prevents KubeRay's `dead_processes()` monitor from losing track of the spawned dashboard. | | **`webui:url`** | `KV_NAMESPACE_DASHBOARD`<br>(`"dashboard"`) | **Skip & Deferred**<br>(`overwrite=True`) | `Node` skips writing `webui:url` upon detecting a passive GCS. | Replayed by `DashboardHead` with `overwrite=True`. | **Avoids deterministic write failure**: Uses the explicit passive rejection signal from the preceding write rather than relying on delayed leadership caches. | | **`DashboardMetricsAddress`** | `None` (default) | **Deferred to Promotion**<br>(`overwrite=True`) | `DashboardHead` catches write refusal and suppresses registration. | Replayed by `DashboardHead` with `overwrite=True`. | **Metrics routing**: Ensures metrics collectors (e.g. Prometheus) only scrape the currently active dashboard instance. | | **`tracing_startup_hook`** | `KV_NAMESPACE_TRACING`<br>(`"tracing"`) | **Deferred to Promotion**<br>(`overwrite=True`) | `Node` skips initial registration if GCS is passive. | Replayed by `DashboardHead` with `overwrite=True` (if configured on startup). | **Distributed tracing continuity**: Drivers read this key to determine whether to enable tracing; must be republished by the promoted head. | | **`extra_usage_tag_*`**<br>(e.g. `AUTOSCALER_VERSION`) | `KV_NAMESPACE_USAGE_STATS`<br>(`"usage_stats"`) | **In-Memory Buffering & Bulk Replay** | Buffered in in-memory dictionary; individual GCS write failures log at debug level and degrade silently. | `async_put_recorded_extra_usage_tags()` bulk replays all buffered tags upon promotion. | **Telemetry completeness**: Overcomes process-level memoization where tags recorded during passive would otherwise be marked "already recorded" and never re-sent. | | **`AutoscalerMetricsAddress`** | `None` (default) | **Deferred to Promotion**<br>(`overwrite=True`) | Monitor startup catches rejection; `PassiveLatch` mutes repeat logs. | Replayed once on promotion rising edge with `overwrite=True`. | **Endpoints consistency**: Ensures `ray status` and monitoring tools query the active autoscaler rather than the dead predecessor. | | **`DEBUG_AUTOSCALING_ERROR`** | `None` (default) | **Deferred Cleanup / Safe Overwrite** | Startup deletion skips on passive; failure handler uses passive-safe write. | Deleted in `_resume_after_promotion()` upon taking over. | **Prevents false death alerts**: Avoids falsely reporting the autoscaler as dead during passive; clears stale errors left by the dead leader upon promotion. | | **`DEBUG_AUTOSCALING_STATUS`** | `None` (default) | **Leader-Only Loop** | Loop checks `is_gcs_leader()` before each pass; completely idles while passive. | Reconcile loop activates and publishes periodic resource metrics. | **Split-brain prevention**: Autoscaler mutates cloud provider resources (outside GCS gating); loop must never execute while in passive. | | **`DASHBOARD_AGENT_ADDR_NODE_ID_PREFIX*`<br>`DASHBOARD_AGENT_ADDR_IP_PREFIX*`** | `KV_NAMESPACE_DASHBOARD`<br>(`"dashboard"`) | **Retry In-Place Until OK**<br>(Node-scoped, **no replay**) | `DashboardAgent` catches refusal and retries registration in background until accepted. | **No replay needed** (key describes this specific node, not cluster leadership). | **Prevents node crash**: Dashboard Agent is fate-shared with Raylet. Agent must survive write refusals on passive nodes without taking down the host. | | **Dead node agent addresses** | `KV_NAMESPACE_DASHBOARD`<br>(`"dashboard"`) | **Tolerant Deletion**<br>(Refusal safely ignored) | `NodeHead` calls `async_internal_kv_del`; passive refusals are caught and ignored. | **No replay needed** (active leader already performed cleanup; rejoining agent will overwrite). | **Stateless passive**: Avoids maintaining a dead-node cleanup queue across promotion. | | **`head_node_id`** | `KV_NAMESPACE_JOB`<br>(`"job"`) | **Commit-After-Write**<br>(`overwrite=True`) | Written by `NodeHead` when head node becomes ALIVE. | Maintained by current active head. | **Memory state hygiene**: In-memory `_registered_head_node_id` is only committed after the KV put succeeds, preventing poisoned state on write failure. | --- ### Test Plan #### 1. Layered Unit Test Suite Covers isolated passive rejection handling, latches, loop gating, KV helpers, and promotion replay across all modified components. ####2. Manual test: Single-head cluster (Zero Regression) Tested standard single-head cluster behavior with default settings (RAY_ENABLE_GCS_LEADER_ELECTION off): 1. Cluster Startup and verify clean startup and all components are healthy. 2. Submit a job and verify success. 3. Logs are clean and no passive warning. ####3. Manual test: Standby Behavior Verification Started a dual-head local cluster with Node A as active leader and Node B as passive standby 1. Verify both head nodes remained alive 2. Verify the components behavior on passive head 3. Verify no log spamming ## Related issues #63643 --------- Signed-off-by: Yuchen Zhou <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.