monarch_rdma/config.rs
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8
9//! RDMA configuration attributes.
10
11use hyperactor_config::CONFIG;
12use hyperactor_config::ConfigAttr;
13use hyperactor_config::attrs::declare_attrs;
14
15declare_attrs! {
16 /// Maximum chunk size in MiB for TCP-based RDMA transfers.
17 @meta(CONFIG = ConfigAttr::new(
18 Some("MONARCH_RDMA_MAX_CHUNK_SIZE_MB".to_string()),
19 Some("rdma_max_chunk_size_mb".to_string()),
20 ))
21 pub attr RDMA_MAX_CHUNK_SIZE_MB: usize = 64;
22
23 /// Allow TCP fallback when ibverbs hardware is unavailable.
24 ///
25 /// When true (the default), RDMA operations fall back to chunked
26 /// hyperactor messaging over the default channel transport. When
27 /// false, operations fail if no ibverbs backend is available.
28 @meta(CONFIG = ConfigAttr::new(
29 Some("MONARCH_RDMA_ALLOW_TCP_FALLBACK".to_string()),
30 Some("rdma_allow_tcp_fallback".to_string()),
31 ))
32 pub attr RDMA_ALLOW_TCP_FALLBACK: bool = true;
33
34 /// Disable ibverbs even when hardware is present.
35 ///
36 /// When true, `RdmaManagerActor` skips ibverbs initialization and
37 /// relies on the TCP fallback (if enabled). Useful for testing the
38 /// TCP transport on machines that have RDMA hardware.
39 @meta(CONFIG = ConfigAttr::new(
40 Some("MONARCH_RDMA_DISABLE_IBVERBS".to_string()),
41 Some("rdma_disable_ibverbs".to_string()),
42 ))
43 pub attr RDMA_DISABLE_IBVERBS: bool = false;
44}