mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Summary: This is a copy of https://github.com/pytorch/pytorch/pull/97152 to make the landing easier. This PR implements a two-pass wrapper codegen for the Triton backend to achieve ahead-of-time compilation. In the first pass, the regular python wrapper code will be generated, and then the generated code will be executed to perform Triton compilation and autotuning. After that, the second pass wrapper codegen will generate C++ wrapper with proper CUDA API to load and launch Triton-generated CUDA kernels. Like the AOT mode for the cpp backend, the next step would be to provide a more complete API for AOT. Pull Request resolved: https://github.com/pytorch/pytorch/pull/98214 Approved by: https://github.com/eellison
21 lines
No EOL
801 B
CMake
21 lines
No EOL
801 B
CMake
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
|
project(test)
|
|
|
|
set(Torch_DIR "../../../../torch/share/cmake/Torch")
|
|
find_package(Torch REQUIRED)
|
|
|
|
add_library(aot_inductor_output SHARED IMPORTED)
|
|
set_property(TARGET aot_inductor_output PROPERTY
|
|
IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/aot_inductor_output.so)
|
|
add_custom_command(
|
|
OUTPUT ${CMAKE_BINARY_DIR}/aot_inductor_output.so
|
|
COMMAND python ${CMAKE_SOURCE_DIR}/test.py
|
|
DEPENDS ${CMAKE_SOURCE_DIR}/test.py
|
|
)
|
|
add_custom_target(aot_inductor_output_target ALL
|
|
DEPENDS ${CMAKE_BINARY_DIR}/aot_inductor_output.so)
|
|
|
|
add_executable(test test.cpp)
|
|
target_link_libraries(test ${TORCH_LIBRARIES} aot_inductor_output)
|
|
add_dependencies(test aot_inductor_output_target)
|
|
set_property(TARGET test PROPERTY CXX_STANDARD 17) |