Skip to content

Commit 45b18bd

Browse files
pzhan9facebook-github-bot
authored andcommitted
Make multipart default (#1113)
Summary: Pull Request resolved: #1113 I have been using it in perf tests. It looks good so far. Make it default. Reviewed By: mariusae Differential Revision: D81800129 fbshipit-source-id: 79b61ac5123b5289d0d795fc18a57bcc4452342f
1 parent 987ee15 commit 45b18bd

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

hyperactor/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ declare_attrs! {
5252
pub attr REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL: Duration = Duration::from_secs(5);
5353

5454
/// The default encoding to be used.
55-
pub attr DEFAULT_ENCODING: Encoding = Encoding::Bincode;
55+
pub attr DEFAULT_ENCODING: Encoding = Encoding::Multipart;
5656

5757
/// Whether to use multipart encoding for network channel communications.
58-
pub attr CHANNEL_MULTIPART: bool = false;
58+
pub attr CHANNEL_MULTIPART: bool = true;
5959

6060
/// How often to check for full MSPC channel on NetRx.
6161
pub attr CHANNEL_NET_RX_BUFFER_FULL_CHECK_INTERVAL: Duration = Duration::from_secs(5);

hyperactor/src/data.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ mod tests {
777777
let serialized = Serialized::serialize(&data).unwrap();
778778
let serialized_json = serialized.clone().transcode_to_json().unwrap();
779779

780-
assert!(serialized.encoded.is_bincode());
780+
assert!(serialized.encoded.is_multipart());
781781
assert!(serialized_json.encoded.is_json());
782782

783783
let json_string =
@@ -816,6 +816,8 @@ mod tests {
816816

817817
#[test]
818818
fn test_emplace_prefix() {
819+
let config = config::global::lock();
820+
let _guard = config.override_key(config::DEFAULT_ENCODING, Encoding::Bincode);
819821
let data = TestDumpStruct {
820822
a: "hello".to_string(),
821823
b: 1234,

hyperactor_mesh/src/actor_mesh.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ mod tests {
683683
use hyperactor::ProcId;
684684
use hyperactor::WorldId;
685685
use hyperactor::attrs::Attrs;
686+
use hyperactor::data::Encoding;
686687
use timed_test::async_timed_test;
687688

688689
use super::*;
@@ -1328,6 +1329,9 @@ mod tests {
13281329
unsafe {
13291330
std::env::set_var("HYPERACTOR_CODEC_MAX_FRAME_LENGTH", "1024");
13301331
};
1332+
let _guard3 =
1333+
config.override_key(hyperactor::config::DEFAULT_ENCODING, Encoding::Bincode);
1334+
let _guard4 = config.override_key(hyperactor::config::CHANNEL_MULTIPART, false);
13311335

13321336
let alloc = process_allocator()
13331337
.allocate(AllocSpec {

0 commit comments

Comments
 (0)