Hello,
I am trying to build and use Pytorch with APL on Windows. The build seems successful, but I get errors such as:
Can you help us identify the problem? Can it be a problem with the build or is it an APL bug?
Hi Irem,
Normally errors like this mean that you've linked against a library using the wrong integer size. Most programs default to using 32-bit integers ('int' in C) but some choose to use 64-bit integers ('long long' in C). The BLAS interface was defined at a time when Fortran was the main language and this choice was a compile-time option. As such libraries like ArmPL have to provide both.
Probably what you want to do is to ensure you're linked against the 32-bit version, i.e. a version with "lp64" in its name, not "ilp64". For example, if you want the non-threaded version this should be armpl_lp64_mp (as in -larmpl_lp64_mp).
An example of this linking stage with the MSVC compiler is:
cl /MD example.obj /Feexample.exe %ARMPL_DIR%\lib\armpl_lp64.lib %ARMPL_DIR%\lib\FortranRuntime.lib %ARMPL_DIR%\lib\FortranDecimal.lib
Hope this helps. Do let us know if that doesn't work.
Chris
Hi Chris,
Thanks a lot for the quick reply. Just like you've said, we have been linking against armpl_ilp64 instead of armpl_lp64. Changing it to armpl_lp64 fixed the problem.
Hi Chris, I have 2 follow-up questions for you. I was trying to build pytorch on arm with both a single threaded and a multithreaded variant and I ran into this issue:
armpl_lp64_mp.lib: unresolved external symbol __kmpc_fork_call
armpl_lp64_mp.lib: unresolved external symbol __kmpc_global_thread_num
armpl_lp64_mp.lib: unresolved external symbol __kpmc_for_static_fini
armpl_lp64_mp.lib: unresolved external symbol __kpmc_for_static_init_8
armpl_lp64_mp.lib: unresolved external symbol __kpmc_barrier
Do you maybe have an idea what am I missing?
Also, I came across this page on the documentation: Get started with Arm Performance Libraries (stand-alone Linux version). From that table it looks like there is no difference between single and multithreaded 32 bit libraries, is that correct ?
Hi.
I think you'll be better off with the latest version of the Windows documentation which has more details in it. On that page you can see that to link to the OpenMP (*_mp) version you also need to include the relevant omp.dll library. In the first example you can see that includes the compile line:
cl.exe /MD armpl_dgemm_interleave_batch_c_example.obj C:\arm-performance-libraries_23.10\armpl_23.10\lib\armpl_lp64_mp.dll.lib C:\arm-performance-libraries_23.10\armpl_23.10\lib\FortranRuntime.lib C:\arm-performance-libraries_23.10\armpl_23.10\lib\FortranDecimal.lib C:\arm-performance-libraries_23.10\armpl_23.10\lib\omp.dll.lib /Fearmpl_dgemm_interleave_batch_c_example.exewhere the "C:\arm-performance-libraries_23.10\armpl_23.10\lib\omp.dll.lib" option is the specification of the OpenMP library that will provide your missing symbols.
Hope that helps.