-
Notifications
You must be signed in to change notification settings - Fork 223
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
Adding new cmake/scikitbuild core based workflow #85
base: master
Are you sure you want to change the base?
Conversation
Is this repo still being updated ? Last pushed commit was 5 years ago, so I though it was mainly archived, and seeing a Meta employee submitting a new PR after all this time is weird. Anyway, I suppose it's still very early development since I can see all sorts of The introduction of a Makefile is actually very interesting, but I suppose the tutorial should mention that somewhere as well |
@ClementPinard This repo has been archived for some number of time. There has been an influx of new cpp/cuda extensions in the PyTorch Community; flash-attention, mamba, bitsandbytes... One common problem is that extensions dont interact correctly with torch.compile. @zou3519 and I are going to work on updating this repo to provide clean templates for users. The state of this PR is still very drafty |
*.cubin | ||
*.fatbin | ||
build/** | ||
driss_torch/lib/** |
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.
fix
build/** | ||
driss_torch/lib/** | ||
compile_commands.json | ||
benchmarks/data |
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.
fix
- ufmt == 2.1.0 | ||
- libcst == 1.0.1 | ||
|
||
# missing host field? |
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.
fix
find_package(Torch REQUIRED CONFIG) | ||
|
||
# simple_cuda source files | ||
file(GLOB_RECURSE CU_SOURCES csrc/*.cu) |
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.
not some conditionals on building cuda sources
) | ||
|
||
# cache CUDA_ARCHITECTURES, which seems to be reset by Torch | ||
set(TMP_STORE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}") |
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.
I dont think I need this, however pytorch does deviate from regualre cuda cmake builds
MESSAGE(STATUS "CPP_SOURCES: ${CPP_SOURCES}") | ||
|
||
add_library(${SKBUILD_PROJECT_NAME} SHARED | ||
${CU_SOURCES} |
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.
same here for conditional
# simple_cuda source files | ||
file(GLOB_RECURSE CU_SOURCES csrc/*.cu) | ||
file(GLOB_RECURSE CPP_SOURCES csrc/*.cpp) | ||
MESSAGE(STATUS "CU_SOURCES: ${CU_SOURCES}") |
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.
change the message to debug
lib_path = Path(__file__).parent / "lib" / "libextension_cpp.so" | ||
torch.ops.load_library(str(lib_path.resolve())) | ||
torch.ops.load_library(lib_path) | ||
# torch.ops.import_module("my_extension.abstract_impls") |
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.
need to right correct abstract impls
|
||
# Specify CMake defines: | ||
[tool.scikit-build.cmake.define] | ||
TORCH_CUDA_ARCH_LIST="9.0" |
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.
this should be more generic by default
No description provided.