Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add fallback search for extra-underscore-suffixed symbols #137

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

staticfloat
Copy link
Member

MKL v2024 has ILP64-suffixed symbols, but the suffix applied to FORTRAN symbols (64, mapping dgemm_ to dgemm_64) is different from the suffix applied to non-FORTRAN symbols (_64, mapping cblas_dgemm to cblas_dgemm_64). This wreaks havoc with LBT, which assumes that all symbols undergo the same name transformation. To work around this, we add a fallback path to our symbol forwarding routine; if a symbol does not exist in a library, we look for the same symbol but with an underscore in front of the symbol name. Because this all happens only after we have already found isamax_ and dpotrf_ in autodetect_symbol_suffix(), we have some measure of assurance that we will not be blindly guessing ridiculous symbol names.

@ViralBShah
Copy link
Collaborator

We'll need this version of LBT backported to 1.11 and 1.10. cc @KristofferC

@staticfloat
Copy link
Member Author

This isn't in Kristoffer's court yet; I need to finish this LBT release, push it through Yggdrasil, open a PR to Julia master, then tag it for backporting. :)

@ViralBShah
Copy link
Collaborator

Yes, perhaps tagging him was premature - but it would be nice to get this into 1.11 and hence the heads up.

MKL v2024 has ILP64-suffixed symbols, but the suffix applied to FORTRAN
symbols (`64`, mapping `dgemm_` to `dgemm_64`) is different from the
suffix applied to non-FORTRAN symbols (`_64`, mapping `cblas_dgemm` to
`cblas_dgemm_64`).  This wreaks havoc with LBT, which assumes that all
symbols undergo the same name transformation.  To work around this, we
add a fallback path to our symbol forwarding routine; if a symbol does
not exist in a library, we look for the same symbol but with an
underscore in front of the symbol name. Because this all happens only
after we have already found `isamax_` and `dpotrf_` in
`autodetect_symbol_suffix()`, we have some measure of assurance that we
will not be blindly guessing ridiculous symbol names.
@staticfloat staticfloat merged commit 5a08240 into main Jul 31, 2024
5 checks passed
@staticfloat staticfloat deleted the sf/mkl_v2024_fix branch July 31, 2024 17:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants