cmake: introduce USE_SYSTEM_* flags
Similar to the work done in https://github.com/pytorch/pytorch/pull/37137, this adds the following CMake options:
-
USE_SYSTEM_LIBS -
USE_SYSTEM_ASMJIT -
USE_SYSTEM_CPUINFO -
USE_SYSTEM_GOOGLETEST
This is particularly useful in the context of Nix, where we can build these libraries once and then re-use them elsewhere to avoid rebuilding vendors dependencies.
I'm unsure of how to best enable this for fbgemm_gpu.
What's the relationship between FBGEMM and libtorch? Does libtorch require fbgemm, fbgemm_gpu, or both?
Deploy Preview for pytorch-fbgemm-docs canceled.
| Name | Link |
|---|---|
| Latest commit | 8dc96b908062fb5584f1e8669f467a4e0a53c084 |
| Latest deploy log | https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/64e43cb85fc3e90008b17749 |
@q10 I see that you've worked with the CMake in this repo before, would you have the bandwidth to review this?
@q10 I see that you've worked with the CMake in this repo before, would you have the bandwidth to review this?
Yes I can. Let me run it through the OSS CI system before reviewing this more thoroughly on Monday.
Much appreciated! And any insight on changes I'd need to make for the GPU variant would be awesome :)
@q10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@q10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
As a followup, any thoughts on offering an fbgemm-config.cmake for users who would like to be able to do find_package(fbgemm)?
I know that fbgemmLibraryConfig.cmake is produced, but that's also located in /share/cmake/fbgemm and so I need to use find_package(fbgemmLibrary) and pass "-DfbgemmLibrary_DIR:PATH=${fbgemm}/share/cmake/fbgemm" to have CMake find it.
Although, I'm not very proficient in writing or interpreting CMake, so that may be working as intended or a best practice.
As a followup, any thoughts on offering an
fbgemm-config.cmakefor users who would like to be able to dofind_package(fbgemm)?I know that
fbgemmLibraryConfig.cmakeis produced, but that's also located in/share/cmake/fbgemmand so I need to usefind_package(fbgemmLibrary)and pass"-DfbgemmLibrary_DIR:PATH=${fbgemm}/share/cmake/fbgemm"to have CMake find it.Although, I'm not very proficient in writing or interpreting CMake, so that may be working as intended or a best practice.
I think it's a good idea to offer an fbgemm-config.cmake, though we are not experts on CMake either, which is why we have not gotten around to working on this.
I'm looking at the CI builds, and it appears that the CMake changes made in this PR have broken all the CMake-based builds of FBGEMM (see here)...
@q10 would you mind triggering CI again to see if it's fixed?
@q10 would you mind triggering CI again to see if it's fixed?
Looks to be broken still :(
Alrighty, @q10 would you mind running the CI again?
bumping this thread.
Hi @ConnorBaker, if there is still desire to land this PR, could you rebase it onto latest main?
Im happy to help if @ConnorBaker is no longer interested.
@ConnorBaker I have rebased and fixed merge conflicts if you can give me access to push to your repo
@BwL1289 you should have access now, thank you!
Deploy Preview for pytorch-fbgemm-docs ready!
| Name | Link |
|---|---|
| Latest commit | e6af349433d75ab81dc6cf8ee0a85360d0355654 |
| Latest deploy log | https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/68137140d845300008db4f93 |
| Deploy Preview | https://deploy-preview-1859--pytorch-fbgemm-docs.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
@ConnorBaker thanks! Just pushed and synced the last few commits. @q10 let us know if you can run CI again.
@q10 bump
@q10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Ths diff appears to break linux and macos builds - see https://github.com/pytorch/FBGEMM/actions/runs/14775835150/job/41508826517?pr=1859 for example
/__w/FBGEMM/FBGEMM/bench/SparseDenseMMInt8Benchmark.cc:9:10: fatal error: bench/BenchUtils.h: No such file or directory
@ConnorBaker hate to ask, but any idea? Possibly something in this block but not 100%
# Ensure that we can include header files from the root directory.
target_include_directories(${TESTNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
I probably wonβt have a chance to look at this again until next week :(
No worries! Thanks Connor.
@ConnorBaker FYI I opened a PR on your branch to attempt to fix the test CI errors.