Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/ATen/native/xpu/mkl/BatchLinearAlgebra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ void error_handle(
auto errs = be.exceptions();
auto ids = be.ids();

if (!errs.size()) {
TORCH_WARN(
"Caught lapack exception:\nWhat: ", be.what(), "\nInfo: ", be.info());
for (auto& i : ids) {
TORCH_WARN("Error in matrix #", i);
info_cpu[i] = 1;
}
return;
}

for (size_t i = 0; i < errs.size(); ++i) {
try {
std::rethrow_exception(errs[i]);
Expand All @@ -65,10 +55,10 @@ void error_handle(
e.info(),
"\nDetail: ",
e.detail());
info_cpu[i] = e.info();
info_cpu[ids[i]] = e.info();
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential out-of-bounds access: ids[i] is used to index info_cpu, but there's no validation that ids[i] is within the bounds of info_cpu. This could cause a segfault or memory corruption if the batch exception contains an invalid matrix ID.

Copilot uses AI. Check for mistakes.
} catch (const sycl::exception& e) {
TORCH_WARN("Caught SYCL exception:\nWhat: ", e.what(), "\nInfo: -1");
info_cpu[i] = -1;
info_cpu[ids[i]] = -1;
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential out-of-bounds access: Same issue as above - ids[i] is used to index info_cpu without bounds checking. Consider adding validation that ids[i] < info_cpu.size() before indexing.

Copilot uses AI. Check for mistakes.
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions test/xpu/skip_list_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,6 @@
"test_scaled_gemm_offline_tunableop_xpu_float8_e5m2fnuz",
# case need to port for xpu
"test_gemm_bias_offline_tunableop_xpu_bfloat16",
# Exception is temporarily unavailable due to regression in oneMKL
"test_inv_errors_and_warnings_xpu_float32",
"test_inv_errors_and_warnings_xpu_float64",
"test_inverse_errors_large_xpu_float32",
"test_inverse_errors_large_xpu_float64",
"test_inverse_errors_xpu_float32",
"test_inverse_errors_xpu_float64",
"test_inv_ex_singular_xpu_float32",
"test_inv_ex_singular_xpu_float64",
),
"test_ops_fwd_gradients_xpu.py": (
# All of the followings are oneDNN issues
Expand Down
Loading