File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ fn main() -> anyhow::Result<()> {
370
370
#[ cfg( feature = "metal" ) ]
371
371
let device = Device :: new_metal ( 0 ) ?;
372
372
#[ cfg( not( feature = "metal" ) ) ]
373
- let device = if cfg ! ( feature = "nccl" ) {
373
+ let device = if mistralrs_core :: distributed :: use_nccl ( ) {
374
374
Device :: Cpu
375
375
} else {
376
376
Device :: cuda_if_available ( 0 ) ?
@@ -433,7 +433,7 @@ fn main() -> anyhow::Result<()> {
433
433
DeviceMapSetting :: Auto ( auto_device_map_params)
434
434
} ;
435
435
436
- let no_paged_attn = if device. is_cuda ( ) || cfg ! ( feature = "nccl" ) {
436
+ let no_paged_attn = if device. is_cuda ( ) || mistralrs_core :: distributed :: use_nccl ( ) {
437
437
args. no_paged_attn
438
438
} else if device. is_metal ( ) {
439
439
!args. paged_attn
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use core::ffi::c_char;
4
4
use interprocess:: local_socket:: traits:: { Listener , Stream } ;
5
5
use interprocess:: local_socket:: { GenericNamespaced , Name , ToNsName } ;
6
6
use interprocess:: local_socket:: { ListenerOptions , Stream as LocalStream } ;
7
+ pub use mistralrs_quant:: distributed:: use_nccl;
7
8
use mistralrs_quant:: { ShardedSafeTensors , ShardedVarBuilder } ;
8
9
use serde:: { Deserialize , Serialize } ;
9
10
use serde_big_array:: BigArray ;
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ static DEVICE: OnceLock<Result<Device>> = OnceLock::new();
44
44
#[ cfg( not( feature = "metal" ) ) ]
45
45
fn get_device ( seed : Option < u64 > ) -> & ' static Result < Device > {
46
46
DEVICE . get_or_init ( || {
47
- let device = if cfg ! ( feature = "nccl" ) {
47
+ let device = if mistralrs_core :: distributed :: use_nccl ( ) {
48
48
Device :: Cpu
49
49
} else {
50
50
Device :: cuda_if_available ( 0 ) ?
@@ -652,7 +652,7 @@ impl Runner {
652
652
None => DeviceMapSetting :: Auto ( auto_map_params) ,
653
653
} ;
654
654
655
- let no_paged_attn = if device. is_cuda ( ) || cfg ! ( feature = "nccl" ) {
655
+ let no_paged_attn = if device. is_cuda ( ) || mistralrs_core :: distributed :: use_nccl ( ) {
656
656
no_paged_attn
657
657
} else if device. is_metal ( ) {
658
658
!paged_attn
Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ async fn main() -> Result<()> {
317
317
let device = if args. cpu {
318
318
args. no_paged_attn = true ;
319
319
Device :: Cpu
320
- } else if cfg ! ( feature = "nccl" ) {
320
+ } else if mistralrs_core :: distributed :: use_nccl ( ) {
321
321
Device :: Cpu
322
322
} else {
323
323
Device :: cuda_if_available ( 0 ) ?
@@ -379,7 +379,7 @@ async fn main() -> Result<()> {
379
379
DeviceMapSetting :: Auto ( auto_device_map_params)
380
380
} ;
381
381
382
- let no_paged_attn = if device. is_cuda ( ) || cfg ! ( feature = "nccl" ) {
382
+ let no_paged_attn = if device. is_cuda ( ) || mistralrs_core :: distributed :: use_nccl ( ) {
383
383
args. no_paged_attn
384
384
} else if device. is_metal ( ) {
385
385
!args. paged_attn
You can’t perform that action at this time.
0 commit comments