-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LibTorch-Lite] Add a custom flag to build LibTorch-Lite with LAPACK included #68871
Comments
@anhappdev Thanks for opening this issue. We'll consider including LAPACK support in our libraries. Thanks for all the detailed context! |
@anhappdev I tried to build LibTorch-Lite with LAPACK on iOS. I added
My code is as follows:
Log:
Do you know what the problem is? Thanks |
@Gaozhongpai The code involved overtime, so I don't know if there are any other changes in the build script. You may want to test with the commit I used at that time |
@Gaozhongpai it was long time ago. I don鈥檛 have the files anymore. |
@anhappdev It works. Thanks |
馃殌 Feature
Add a custom flag to build LibTorch-Lite with
LAPACK
to./scripts/build_ios.sh
(and./scripts/build_android.sh
).Motivation
There are many issues caused by error
when trying running TorchScript on mobile devices.
Since LibTorch-Lite from Cocoapods does not include
LAPACK
, the only option is to build it from source.Pitch
We can build LibTorch-Lite from source with
LAPACK
included by setting the environment variableUSE_LAPACK=1
Alternatives
Include
LAPACK
into LibTorch-Lite from CocoapodsAdditional context
I tried to build LibTorch-Lite for iOS from source with LAPACK included.
Some answers found on the internet suggest adding
CMAKE_ARGS+=("-DUSE_LAPACK=ON")
to the build script.But it did not work in my case because in the file Dependencies.cmake#L1580
USE_LAPACK
is first disabled withset(USE_LAPACK 0)
then later in Dependencies.cmake#L1771 enabled ifLAPACK_FOUND
is true. And somehow it could not findLAPACK
on my Mac.My workaround for now is just comment out that line
#set(USE_LAPACK 0)
then the build run successfully withLAPACK
included (no error when running on iOS).Some related issues are:
torch::stft
function in LibTorch-Lite expects0 < n_fft < 1
,torch::fft_fft2
function says ATen not compiled with MKL, and LAPACK not found聽#66543The text was updated successfully, but these errors were encountered: