mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-07 17:15:29 +00:00
Fix moe tests to run on supported arch (#20872)
### Description <!-- Describe your changes. --> https://github.com/microsoft/onnxruntime/issues/20788 Will do sm70 validation separately. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
parent
65ef270e06
commit
2200a0b3dd
1 changed files with 7 additions and 3 deletions
|
|
@ -16,9 +16,10 @@ static void RunMoETest(const std::vector<float>& input, const std::vector<float>
|
|||
const std::vector<float>& fc2_experts_bias, const std::vector<float>& output_data, int num_rows,
|
||||
int num_experts, int hidden_size, int inter_size, std::string activation_type,
|
||||
int normalize_routing_weights = 0, int top_k = 1, bool use_float16 = false) {
|
||||
int min_cuda_architecture = use_float16 ? 700 : 0;
|
||||
constexpr int min_cuda_arch = 700;
|
||||
constexpr int max_cuda_arch = 900;
|
||||
|
||||
bool enable_cuda = HasCudaEnvironment(min_cuda_architecture);
|
||||
bool enable_cuda = HasCudaEnvironment(min_cuda_arch) && !NeedSkipIfCudaArchGreaterEqualThan(max_cuda_arch);
|
||||
if (enable_cuda) {
|
||||
OpTester tester("MoE", 1, onnxruntime::kMSDomain);
|
||||
tester.AddAttribute<int64_t>("k", static_cast<int64_t>(top_k));
|
||||
|
|
@ -91,7 +92,10 @@ static void RunQMoETest(const std::vector<float>& input, const std::vector<float
|
|||
const std::vector<float>& fc2_scales, const std::vector<float>& fc3_scales,
|
||||
const std::vector<float>& output_data, int num_rows, int num_experts, int hidden_size,
|
||||
int inter_size, std::string activation_type, int normalize_routing_weights = 0, int top_k = 1) {
|
||||
bool enable_cuda = HasCudaEnvironment(700);
|
||||
constexpr int min_cuda_arch = 700;
|
||||
constexpr int max_cuda_arch = 900;
|
||||
|
||||
bool enable_cuda = HasCudaEnvironment(min_cuda_arch) && !NeedSkipIfCudaArchGreaterEqualThan(max_cuda_arch);
|
||||
if (enable_cuda) {
|
||||
OpTester tester("QMoE", 1, onnxruntime::kMSDomain);
|
||||
tester.AddAttribute<int64_t>("k", static_cast<int64_t>(top_k));
|
||||
|
|
|
|||
Loading…
Reference in a new issue