@@ -461,6 +461,7 @@ pub(crate) mod test_util {
461
461
use hyperactor:: Context ;
462
462
use hyperactor:: Handler ;
463
463
use hyperactor:: PortRef ;
464
+ use ndslice:: extent;
464
465
465
466
use super :: * ;
466
467
use crate :: comm:: multicast:: CastInfo ;
@@ -590,16 +591,14 @@ pub(crate) mod test_util {
590
591
// The actor creates a mesh.
591
592
use std:: sync:: Arc ;
592
593
593
- use ndslice:: shape;
594
-
595
594
use crate :: alloc:: AllocSpec ;
596
595
use crate :: alloc:: Allocator ;
597
596
use crate :: alloc:: LocalAllocator ;
598
597
599
598
let mut allocator = LocalAllocator ;
600
599
let alloc = allocator
601
600
. allocate ( AllocSpec {
602
- shape : shape ! { replica = 1 } ,
601
+ extent : extent ! { replica = 1 } ,
603
602
constraints : Default :: default ( ) ,
604
603
} )
605
604
. await
@@ -652,7 +651,7 @@ mod tests {
652
651
( $allocator: expr_2021) => {
653
652
use std:: assert_matches:: assert_matches;
654
653
655
- use ndslice:: shape ;
654
+ use ndslice:: extent ;
656
655
use $crate:: alloc:: AllocSpec ;
657
656
use $crate:: alloc:: Allocator ;
658
657
use $crate:: assign:: Ranks ;
@@ -674,11 +673,11 @@ mod tests {
674
673
675
674
hyperactor_telemetry:: initialize_logging( hyperactor:: clock:: ClockKind :: default ( ) ) ;
676
675
677
- use ndslice:: shape ;
676
+ use ndslice:: extent ;
678
677
679
678
let alloc = $allocator
680
679
. allocate( AllocSpec {
681
- shape : shape ! { replica = 1 } ,
680
+ extent : extent ! { replica = 1 } ,
682
681
constraints: Default :: default ( ) ,
683
682
} )
684
683
. await
@@ -695,7 +694,7 @@ mod tests {
695
694
async fn test_basic( ) {
696
695
let alloc = $allocator
697
696
. allocate( AllocSpec {
698
- shape : shape! { replica = 4 } ,
697
+ extent : extent! ( replica = 4 ) ,
699
698
constraints: Default :: default ( ) ,
700
699
} )
701
700
. await
@@ -720,7 +719,7 @@ mod tests {
720
719
721
720
let alloc = $allocator
722
721
. allocate( AllocSpec {
723
- shape : shape! { replica = 2 } ,
722
+ extent : extent! ( replica = 2 ) ,
724
723
constraints: Default :: default ( ) ,
725
724
} )
726
725
. await
@@ -755,7 +754,7 @@ mod tests {
755
754
const Z : usize = 3 ;
756
755
let alloc = $allocator
757
756
. allocate( AllocSpec {
758
- shape : shape! { x = X , y = Y , z = Z } ,
757
+ extent : extent! ( x = X , y = Y , z = Z ) ,
759
758
constraints: Default :: default ( ) ,
760
759
} )
761
760
. await
@@ -798,7 +797,7 @@ mod tests {
798
797
async fn test_cast( ) {
799
798
let alloc = $allocator
800
799
. allocate( AllocSpec {
801
- shape : shape! { replica = 2 , host = 2 , gpu = 8 } ,
800
+ extent : extent! ( replica = 2 , host = 2 , gpu = 8 ) ,
802
801
constraints: Default :: default ( ) ,
803
802
} )
804
803
. await
@@ -838,7 +837,7 @@ mod tests {
838
837
// Sizes intentionally small to keep the time
839
838
// required for this test in the process case
840
839
// reasonable (< 60s).
841
- shape : shape! { replica = 2 , host = 2 , gpu = 8 } ,
840
+ extent : extent! ( replica = 2 , host = 2 , gpu = 8 ) ,
842
841
constraints: Default :: default ( ) ,
843
842
} )
844
843
. await
@@ -868,7 +867,7 @@ mod tests {
868
867
for _ in 0 ..2 {
869
868
let alloc = $allocator
870
869
. allocate( AllocSpec {
871
- shape : shape! { replica = 1 } ,
870
+ extent : extent! ( replica = 1 ) ,
872
871
constraints: Default :: default ( ) ,
873
872
} )
874
873
. await
@@ -911,11 +910,11 @@ mod tests {
911
910
use $crate:: comm:: test_utils:: TestActorParams as CastTestActorParams ;
912
911
use $crate:: comm:: test_utils:: TestMessage as CastTestMessage ;
913
912
914
- let shape = shape! { replica = 4 , host = 4 , gpu = 4 } ;
915
- let num_actors = shape . slice ( ) . len( ) ;
913
+ let extent = extent! ( replica = 4 , host = 4 , gpu = 4 ) ;
914
+ let num_actors = extent . len( ) ;
916
915
let alloc = $allocator
917
916
. allocate( AllocSpec {
918
- shape ,
917
+ extent ,
919
918
constraints: Default :: default ( ) ,
920
919
} )
921
920
. await
@@ -938,7 +937,7 @@ mod tests {
938
937
async fn test_delivery_failure( ) {
939
938
let alloc = $allocator
940
939
. allocate( AllocSpec {
941
- shape : shape! { replica = 1 } ,
940
+ extent : extent! ( replica = 1 ) ,
942
941
constraints: Default :: default ( ) ,
943
942
} )
944
943
. await
@@ -966,7 +965,7 @@ mod tests {
966
965
async fn test_send_with_headers( ) {
967
966
let alloc = $allocator
968
967
. allocate( AllocSpec {
969
- shape : shape! { replica = 1 } ,
968
+ extent : extent! ( replica = 1 ) ,
970
969
constraints: Default :: default ( ) ,
971
970
} )
972
971
. await
@@ -1025,7 +1024,7 @@ mod tests {
1025
1024
1026
1025
let alloc = LocalAllocator
1027
1026
. allocate ( AllocSpec {
1028
- shape : shape ! { replica = 2 } ,
1027
+ extent : extent ! ( replica = 2 ) ,
1029
1028
constraints : Default :: default ( ) ,
1030
1029
} )
1031
1030
. await
@@ -1092,7 +1091,7 @@ mod tests {
1092
1091
1093
1092
let alloc = LocalAllocator
1094
1093
. allocate ( AllocSpec {
1095
- shape : shape ! { replica = 1 } ,
1094
+ extent : extent ! ( replica = 1 ) ,
1096
1095
constraints : Default :: default ( ) ,
1097
1096
} )
1098
1097
. await
@@ -1158,7 +1157,7 @@ mod tests {
1158
1157
1159
1158
let alloc = LocalAllocator
1160
1159
. allocate ( AllocSpec {
1161
- shape : shape ! { replica = 2 } ,
1160
+ extent : extent ! ( replica = 2 ) ,
1162
1161
constraints : Default :: default ( ) ,
1163
1162
} )
1164
1163
. await
@@ -1241,10 +1240,10 @@ mod tests {
1241
1240
// One rank is enough for this test, because the timeout failure
1242
1241
// occurred in the `client->1st comm actor` channel, and thus will
1243
1242
// not be sent further to the rest of the network.
1244
- let shape = shape ! { replica = 1 } ;
1243
+ let extent = extent ! { replica = 1 } ;
1245
1244
let alloc = process_allocator ( )
1246
1245
. allocate ( AllocSpec {
1247
- shape ,
1246
+ extent ,
1248
1247
constraints : Default :: default ( ) ,
1249
1248
} )
1250
1249
. await
0 commit comments