@@ -69,8 +69,8 @@ void generic_moe_gemm_kernelLauncher(const T* A,
69
69
cudaStream_t stream,
70
70
int * kernel_occupancy = nullptr ) {
71
71
if (gemm_config.split_k_style != SplitKStyle::NO_SPLIT_K) {
72
- PADDLE_THROW (
73
- phi::errors::Fatal ( " [MoeGemm] Grouped gemm does not support split-k" ) );
72
+ throw std::runtime_error (
73
+ " [MoeGemm] Grouped gemm does not support split-k" );
74
74
}
75
75
76
76
#ifdef PADDLE_CUDA_BF16
@@ -170,9 +170,9 @@ void generic_moe_gemm_kernelLauncher(const T* A,
170
170
int occupancy = std::min (2 , GemmGrouped::maximum_active_blocks ());
171
171
172
172
if (occupancy == 0 ) {
173
- PADDLE_THROW ( phi::errors::Fatal (
173
+ throw std::runtime_error (
174
174
" [MoE Runner] GPU lacks the shared memory resources to run "
175
- " GroupedGEMM kernel" )) ;
175
+ " GroupedGEMM kernel" );
176
176
}
177
177
const int threadblock_count = multi_processor_count * occupancy;
178
178
@@ -198,7 +198,7 @@ void generic_moe_gemm_kernelLauncher(const T* A,
198
198
if (can_implement != cutlass::Status::kSuccess ) {
199
199
std::string err_msg = " MoEFC kernel will fail for params. Error: " +
200
200
std::string (cutlassGetStatusString (can_implement));
201
- PADDLE_THROW ( phi::errors::Fatal (" [MoE Runner] " + err_msg) );
201
+ throw std::runtime_error (" [MoE Runner] " + err_msg);
202
202
}
203
203
204
204
auto init_status = gemm.initialize (args);
@@ -244,7 +244,7 @@ struct dispatch_stages {
244
244
std::string err_msg = " Cutlass fpA_intB gemm. Not instantiates for arch " +
245
245
std::to_string (arch::kMinComputeCapability ) +
246
246
" with stages set to " + std::to_string (Stages);
247
- PADDLE_THROW ( phi::errors::Fatal (" [dispatch_stages::dispatch] " + err_msg) );
247
+ throw std::runtime_error (" [dispatch_stages::dispatch] " + err_msg);
248
248
}
249
249
};
250
250
@@ -395,8 +395,8 @@ void dispatch_gemm_config(const T* A,
395
395
default :
396
396
std::string err_msg = " dispatch_gemm_config does not support stages " +
397
397
std::to_string (gemm_config.stages );
398
- PADDLE_THROW (
399
- phi::errors::Fatal ( " [MoE][dispatch_gemm_config] " + err_msg) );
398
+ throw std::runtime_error (
399
+ " [MoE][dispatch_gemm_config] " + err_msg);
400
400
break ;
401
401
}
402
402
}
@@ -454,18 +454,18 @@ void dispatch_moe_gemm_to_cutlass(const T* A,
454
454
dispatch_gemm_config_macro (64 , 128 , 64 , 32 , 64 , 64 );
455
455
dispatch_gemm_config_macro (128 , 128 , 64 , 64 , 32 , 64 );
456
456
case CutlassTileConfig::Undefined:
457
- PADDLE_THROW ( common::errors::InvalidArgument (
458
- " [dispatch_moe_gemm_to_cutlass] gemm config undefined." )) ;
457
+ throw std::runtime_error (
458
+ " [dispatch_moe_gemm_to_cutlass] gemm config undefined." );
459
459
break ;
460
460
case CutlassTileConfig::ChooseWithHeuristic:
461
- PADDLE_THROW ( common::errors::InvalidArgument (
461
+ throw std::runtime_error (
462
462
" [dispatch_moe_gemm_to_cutlass] gemm config should have "
463
- " already been set by heuristic." )) ;
463
+ " already been set by heuristic." );
464
464
break ;
465
465
default :
466
- PADDLE_THROW ( common::errors::InvalidArgument (
466
+ throw std::runtime_error (
467
467
" [dispatch_moe_gemm_to_cutlass] Config is invalid for same "
468
- " type MoE tensorop GEMM." )) ;
468
+ " type MoE tensorop GEMM." );
469
469
break ;
470
470
}
471
471
}
@@ -500,18 +500,18 @@ void dispatch_moe_gemm_to_cutlass(const T* A,
500
500
dispatch_gemm_config_macro (32 , 128 , 64 , 32 , 32 , 64 );
501
501
dispatch_gemm_config_macro (64 , 128 , 64 , 64 , 64 , 64 );
502
502
case CutlassTileConfig::Undefined:
503
- PADDLE_THROW ( common::errors::InvalidArgument (
504
- " [dispatch_moe_gemm_to_cutlass] gemm config undefined." )) ;
503
+ throw std::runtime_error (
504
+ " [dispatch_moe_gemm_to_cutlass] gemm config undefined." );
505
505
break ;
506
506
case CutlassTileConfig::ChooseWithHeuristic:
507
- PADDLE_THROW ( common::errors::InvalidArgument (
507
+ throw std::runtime_error (
508
508
" [dispatch_moe_gemm_to_cutlass] gemm config should have "
509
- " already been set by heuristic." )) ;
509
+ " already been set by heuristic." );
510
510
break ;
511
511
default :
512
- PADDLE_THROW ( common::errors::InvalidArgument (
512
+ throw std::runtime_error (
513
513
" [dispatch_moe_gemm_to_cutlass] Config is invalid for "
514
- " mixed type tensorop GEMM." )) ;
514
+ " mixed type tensorop GEMM." );
515
515
break ;
516
516
}
517
517
} else {
@@ -526,18 +526,20 @@ void dispatch_moe_gemm_to_cutlass(const T* A,
526
526
dispatch_gemm_config_macro (128 , 128 , 64 , 128 , 32 , 64 );
527
527
dispatch_gemm_config_macro (128 , 256 , 64 , 64 , 64 , 64 );
528
528
dispatch_gemm_config_macro (64 , 128 , 64 , 64 , 32 , 64 );
529
+ dispatch_gemm_config_macro (256 , 128 , 64 , 64 , 64 , 64 );
529
530
case CutlassTileConfig::Undefined:
530
- PADDLE_THROW ( common::errors::InvalidArgument (
531
- " [dispatch_moe_gemm_to_cutlass] gemm config undefined." )) ;
531
+ throw std::runtime_error (
532
+ " [dispatch_moe_gemm_to_cutlass] gemm config undefined." );
532
533
break ;
533
534
case CutlassTileConfig::ChooseWithHeuristic:
534
- PADDLE_THROW ( common::errors::InvalidArgument (
535
+ throw std::runtime_error (
535
536
" [dispatch_moe_gemm_to_cutlass] gemm config should have "
536
- " already been set by heuristic." )) ;
537
+ " already been set by heuristic." );
537
538
break ;
538
539
default :
539
- PADDLE_THROW (common::errors::InvalidArgument (
540
- " [dispatch_moe_gemm_to_cutlass] gemm config undefined." ));
540
+ throw std::runtime_error (
541
+ " [dispatch_moe_gemm_to_cutlass] Config is invalid for "
542
+ " mixed type tensorop GEMM." );
541
543
break ;
542
544
}
543
545
}
@@ -568,19 +570,19 @@ void dispatch_moe_gemm_to_cutlass(const T* A,
568
570
switch (gemm_config.tile_config ) {
569
571
dispatch_gemm_config_macro (128 , 128 , 8 , 64 , 64 , 8 );
570
572
case CutlassTileConfig::Undefined:
571
- PADDLE_THROW ( common::errors::InvalidArgument (
573
+ throw std::runtime_error (
572
574
" [dispatch_moe_gemm_to_cutlass][SIMT] gemm config "
573
- " undefined." )) ;
575
+ " undefined." );
574
576
break ;
575
577
case CutlassTileConfig::ChooseWithHeuristic:
576
- PADDLE_THROW ( common::errors::InvalidArgument (
578
+ throw std::runtime_error (
577
579
" [dispatch_moe_gemm_to_cutlass][SIMT] gemm config should "
578
- " have already been set by heuristic." )) ;
580
+ " have already been set by heuristic." );
579
581
break ;
580
582
default :
581
- PADDLE_THROW ( common::errors::InvalidArgument (
583
+ throw std::runtime_error (
582
584
" [dispatch_moe_gemm_to_cutlass][SIMT] Unsupported config "
583
- " for float MoE gemm." )) ;
585
+ " for float MoE gemm." );
584
586
break ;
585
587
}
586
588
}
0 commit comments