-
Notifications
You must be signed in to change notification settings - Fork 49
[WA] Fix the lack of exceptions vector in getrf_batch #1916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Plan to remove this WA after upgrading to oneMKL 2025.3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a segmentation fault issue in the MKL batch linear algebra error handling by providing a workaround for missing exception vectors in batch_error exceptions. The fix includes adding debug output when exceptions are missing and creating a CPU-based temporary tensor for info handling.
- Adds error handling for cases where batch_error.exceptions() returns an empty vector
- Modifies lu_factor_mkl to use a CPU-based temporary tensor for info data instead of zeroing the original tensor
- Includes debug output to log batch error details when exceptions are unavailable
15dac16
to
29605c0
Compare
info.zero_(); | ||
int32_t* infos_data = info.data_ptr<int32_t>(); | ||
Tensor info_ = at::zeros_like(info, Device(at::kCPU)); | ||
int32_t* infos_data = info_.data_ptr<int32_t>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you provide more explanation here? why you create a zero tensor on cpu and pass it to apply_lu_xpu_? and then you copy info_ to xpu? mkl will get seg fault when info is on xpu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On stock Pytorch side, original info Tensor is on device instead of host.
This PR provides a work-around for the lack of exception vector within batch_error exception, otherwise segmentation fault would happen while accessing exceptions.