Skip to content

Commit e0ffdbb

Browse files
bmehta001Copilot
andcommitted
Restrict 1D MatMulInteger tests to CPU EP only
The 1D input tests were running on all EPs including CUDA, which does not support 1D quantized inputs the same way. Restrict to CPU-only using the same pattern as other EP-specific tests in this file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ed7662a commit e0ffdbb

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

onnxruntime/test/providers/cpu/math/matmul_integer_test.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,12 @@ TEST(MatmulIntegerOpTest, MatMulInteger_1D_DimensionMismatch) {
514514
test.AddInput<uint8_t>("a_zero_point", {}, {0});
515515
test.AddInput<uint8_t>("b_zero_point", {}, {0});
516516
test.AddOutput<int32_t>("T3", {}, {0});
517-
test.Run(OpTester::ExpectResult::kExpectFailure, "MatMul dimension mismatch");
517+
518+
// Restrict to CPU — other EPs may not support 1D quantized inputs.
519+
std::vector<std::unique_ptr<IExecutionProvider>> cpu_only;
520+
cpu_only.push_back(DefaultCpuExecutionProvider());
521+
test.Run(OpTester::ExpectResult::kExpectFailure, "MatMul dimension mismatch",
522+
{}, nullptr, &cpu_only);
518523
}
519524

520525
// Valid 1D × 1D dot product: both vectors have the same K.
@@ -526,7 +531,11 @@ TEST(MatmulIntegerOpTest, MatMulInteger_1D_Valid) {
526531
test.AddInput<uint8_t>("a_zero_point", {}, {0});
527532
test.AddInput<uint8_t>("b_zero_point", {}, {0});
528533
test.AddOutput<int32_t>("T3", {}, {23});
529-
test.Run();
534+
535+
// Restrict to CPU — other EPs may not support 1D quantized inputs.
536+
std::vector<std::unique_ptr<IExecutionProvider>> cpu_only;
537+
cpu_only.push_back(DefaultCpuExecutionProvider());
538+
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {}, nullptr, &cpu_only);
530539
}
531540

532541
} // namespace test

0 commit comments

Comments
 (0)