tensoracle 2.1.1__tar.gz → 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tensoracle-2.2.1/CMakeLists.txt +46 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/PKG-INFO +4 -4
- {tensoracle-2.1.1 → tensoracle-2.2.1}/README.md +2 -2
- {tensoracle-2.1.1 → tensoracle-2.2.1}/build_backend.py +42 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/CMakeLists.txt +13 -15
- tensoracle-2.2.1/cpp/README.md +66 -0
- tensoracle-2.2.1/cpp/cmake/TensoracleDependencies.cmake +6 -0
- tensoracle-2.2.1/cpp/conan/bootstrap.cmake +13 -0
- tensoracle-2.2.1/cpp/conan/install.cmake +92 -0
- tensoracle-2.2.1/cpp/conan/miniz/CMakeLists.txt +11 -0
- tensoracle-2.2.1/cpp/conan/miniz/LICENSE +22 -0
- tensoracle-2.2.1/cpp/conan/miniz/conandata.yml +4 -0
- tensoracle-2.2.1/cpp/conan/miniz/conanfile.py +58 -0
- tensoracle-2.2.1/cpp/conan/package/conanfile.py +52 -0
- tensoracle-2.2.1/cpp/conan/package/recipes.txt +1 -0
- tensoracle-2.2.1/cpp/conan/prepare-tests.cmake +7 -0
- tensoracle-2.2.1/cpp/conan/profiles/linux-gcc13 +20 -0
- tensoracle-2.2.1/cpp/conan/profiles/linux-gcc14 +21 -0
- tensoracle-2.2.1/cpp/conan/tensorrt/LICENSE.NVIDIA +180 -0
- tensoracle-2.2.1/cpp/conan/tensorrt/LICENSE.OSS +479 -0
- tensoracle-2.2.1/cpp/conan/tensorrt/conandata.yml +32 -0
- tensoracle-2.2.1/cpp/conan/tensorrt/conanfile.py +70 -0
- tensoracle-2.2.1/cpp/conan.lock +14 -0
- tensoracle-2.2.1/cpp/conanfile.py +34 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/engine.h +23 -3
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/engine.hpp +15 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/tensoracle.h +1 -1
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/cache.cpp +49 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/cache.hpp +15 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/cache_open.cpp +6 -17
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/engine.cpp +70 -32
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/tensoracle.map +5 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/CMakeLists.txt +28 -25
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/builder.cpp +201 -28
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/builder_probe.cpp +3 -13
- tensoracle-2.2.1/cpp/tests/concurrent_builder.hpp +67 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/driver_failures.cpp +29 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/execution.cpp +238 -0
- tensoracle-2.2.1/cpp/tests/runtime.cmake +28 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/api/index.md +1 -1
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/cpp-python-repositories.md +2 -2
- tensoracle-2.2.1/docs/cpp-sdk.md +88 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/index.md +19 -3
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/migration.md +1 -1
- tensoracle-2.2.1/docs/tensorrt-sdk.md +95 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/CMakeLists.txt +7 -2
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/README.md +5 -7
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/wheel_consumer/CMakeLists.txt +8 -1
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/wheel_consumer/README.md +5 -3
- {tensoracle-2.1.1 → tensoracle-2.2.1}/mkdocs.yml +1 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/pyproject.toml +3 -3
- {tensoracle-2.1.1 → tensoracle-2.2.1}/src/tensoracle/_version.py +2 -2
- tensoracle-2.2.1/src/tensoracle/py.typed +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/native/cache/CMakeLists.txt +4 -2
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/native_build.py +52 -0
- tensoracle-2.2.1/tests/test_build_distributions.py +483 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_cmake_plugin.py +18 -1
- tensoracle-2.2.1/tests/test_conan.py +119 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_cpp_core.py +7 -10
- tensoracle-2.2.1/tests/test_cpp_test_runtime.py +105 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_distribution.py +98 -9
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_example_plugin.py +4 -4
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_plugin_io.py +4 -5
- tensoracle-2.2.1/tests/test_sdk_recipe.py +95 -0
- tensoracle-2.2.1/tests/test_tensorrt_recipe.py +112 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/uv.lock +1 -1
- tensoracle-2.1.1/CMakeLists.txt +0 -36
- tensoracle-2.1.1/cpp/cmake/TensoracleDependencies.cmake +0 -21
- tensoracle-2.1.1/cpp/cmake/TensoracleJson.cmake +0 -12
- tensoracle-2.1.1/docs/tensorrt-sdk.md +0 -125
- {tensoracle-2.1.1 → tensoracle-2.2.1}/.gitignore +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/LICENSE +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/bindings.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/cmake/TensoracleCubinPlugin.cmake +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/cmake/TensoracleCuda.cmake +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/cmake/tensoracleConfig.cmake.in +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/builder.h +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/builder.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/cache.h +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/cache.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/cubin.h +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/cubin.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/cubin_plugin.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/plugins.h +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/plugins.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/include/tensoracle/tensoracle.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/abi.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/builder.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/builder_internal.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/bundle.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/bundle_internal.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/cache_management.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/cache_management_internal.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/cache_management_internal.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/comparison.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/cubin_plugin.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/engine_internal.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/error.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/error.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/native_exports.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/plugins.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/producer.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/safetensors.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/safetensors.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/sha256.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/src/structure.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/abi.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/builder_fixture.hpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/c_consumer.c +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/cache.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/cache_management.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/cache_probe.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/comparison.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/consumer/CMakeLists.txt +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/consumer/main.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/core.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/cubin.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/installed.cmake +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/native_exports.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/native_exports_fixture.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/plugin_fixture.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/plugins.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/precision.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/utilities.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cpp/tests/weights.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/cubin_bindings.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/api/bundle.md +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/api/producer.md +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/optimization.md +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/docs/precision.md +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bindings.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/bundle.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/bundle.json +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm120/bias.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm120/dot.specialized.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm120/dot.tf32-control.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm120/dot.unspecialized.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm120/scale.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm86/bias.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm86/dot.specialized.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm86/dot.tf32-control.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm86/dot.unspecialized.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm86/scale.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm89/bias.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm89/dot.specialized.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm89/dot.tf32-control.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm89/dot.unspecialized.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/bundle/cubins/sm89/scale.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/example_cubin_plugin/__init__.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/example_cubin_plugin/weights.safetensors +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/kernels.cu +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/kernels.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/plugin.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/cubin_plugin/pyproject.toml +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/wheel_consumer/bindings.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/wheel_consumer/pyproject.toml +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/examples/wheel_consumer/src/tensoracle_consumer/__init__.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/src/tensoracle/__init__.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/src/tensoracle/_cli.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/src/tensoracle/_comparison.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/src/tensoracle/bundle.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/src/tensoracle/convert.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/src/tensoracle/producer.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/cubin_io/check.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/cubins/ptxas-12.9.86/sm120.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/cubins/ptxas-12.9.86/sm86.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/cubins/ptxas-12.9.86/sm89.cubin +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/native/CMakeLists.txt +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/native/cache/writer.cpp +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/native/export.h +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_bundle.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_cache_cli.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_cmake_cuda.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_comparison.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_comparison_binding.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_convert.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_native.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_producer.py +0 -0
- {tensoracle-2.1.1 → tensoracle-2.2.1}/tests/test_public_api.py +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.26)
|
|
2
|
+
# A staged sdist has cpp next to CMakeLists.txt; the checkout has ../cpp.
|
|
3
|
+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cpp/CMakeLists.txt")
|
|
4
|
+
set(_cpp "${CMAKE_CURRENT_SOURCE_DIR}/cpp")
|
|
5
|
+
else()
|
|
6
|
+
set(_cpp "${CMAKE_CURRENT_SOURCE_DIR}/../cpp")
|
|
7
|
+
endif()
|
|
8
|
+
set(BUILD_TESTING OFF CACHE BOOL "Tests are built separately" FORCE)
|
|
9
|
+
include("${_cpp}/conan/bootstrap.cmake")
|
|
10
|
+
project(tensoracle_python LANGUAGES CXX)
|
|
11
|
+
|
|
12
|
+
find_package(Python 3.12 REQUIRED COMPONENTS Interpreter Development.Module Development.SABIModule)
|
|
13
|
+
find_package(nanobind CONFIG REQUIRED)
|
|
14
|
+
find_package(TensorRT 11.2.1.2 EXACT CONFIG REQUIRED)
|
|
15
|
+
get_filename_component(_tensorrt_root "${TensorRT_INCLUDE_DIR}" DIRECTORY)
|
|
16
|
+
find_library(_stub_nvinfer NAMES nvinfer PATHS "${_tensorrt_root}/lib"
|
|
17
|
+
NO_DEFAULT_PATH REQUIRED NO_CACHE)
|
|
18
|
+
|
|
19
|
+
# CUDA headers come from the build environment; TensorRT comes from Conan.
|
|
20
|
+
execute_process(COMMAND "${Python_EXECUTABLE}" -c
|
|
21
|
+
"from importlib.metadata import distribution; print(distribution('nvidia-cuda-runtime').locate_file('nvidia/cu13'))"
|
|
22
|
+
OUTPUT_VARIABLE _cuda_root OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ERROR_IS_FATAL ANY)
|
|
23
|
+
set(CUDAToolkit_ROOT "${_cuda_root}" CACHE PATH "CUDA headers from the build wheel" FORCE)
|
|
24
|
+
set(TENSORACLE_INSTALL_ROOT "tensoracle/cpp" CACHE STRING "Wheel SDK prefix" FORCE)
|
|
25
|
+
set(TENSORACLE_INSTALL_RPATH "$ORIGIN/../../../tensorrt_libs" CACHE STRING "TensorRT wheel lookup" FORCE)
|
|
26
|
+
set(CMAKE_INSTALL_LIBDIR lib CACHE STRING "Wheel library directory" FORCE)
|
|
27
|
+
set(BUILD_TESTING OFF CACHE BOOL "Tests are built separately" FORCE)
|
|
28
|
+
set(TENSORACLE_BUILD_CUBIN_HELPER OFF CACHE BOOL "Ship the source-based helper" FORCE)
|
|
29
|
+
|
|
30
|
+
add_subdirectory("${_cpp}" cpp)
|
|
31
|
+
nanobind_add_module(_native STABLE_ABI bindings.cpp cubin_bindings.cpp)
|
|
32
|
+
target_link_libraries(_native PRIVATE tensoracle::tensoracle)
|
|
33
|
+
# The build tree keeps the module under tensoracle/ so the stub generator imports it by the
|
|
34
|
+
# package name that its exception classes record.
|
|
35
|
+
set_target_properties(_native PROPERTIES
|
|
36
|
+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tensoracle"
|
|
37
|
+
BUILD_RPATH_USE_ORIGIN YES INSTALL_RPATH "$ORIGIN/cpp/lib")
|
|
38
|
+
install(TARGETS _native LIBRARY DESTINATION tensoracle RUNTIME DESTINATION tensoracle)
|
|
39
|
+
# The build RPATH finds libtensoracle and the Conan TensorRT SDK during stub generation.
|
|
40
|
+
# Private names are kept because public signatures return _CacheResult.
|
|
41
|
+
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_native.pyi"
|
|
42
|
+
COMMAND "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/build_backend.py"
|
|
43
|
+
"${_stub_nvinfer}" "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/_native.pyi"
|
|
44
|
+
DEPENDS _native "${CMAKE_CURRENT_SOURCE_DIR}/build_backend.py" VERBATIM)
|
|
45
|
+
add_custom_target(_native_stub ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/_native.pyi")
|
|
46
|
+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/_native.pyi" DESTINATION tensoracle)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensoracle
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Build, save, reuse, and execute TensorRT engines from safetensors weights
|
|
5
5
|
Author-Email: minamik <mia@sync.dev>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,7 +19,7 @@ Project-URL: issues, https://github.com/sync-dev-org/tensoracle/issues
|
|
|
19
19
|
Requires-Python: <3.14,>=3.12
|
|
20
20
|
Requires-Dist: numpy>=2.0
|
|
21
21
|
Requires-Dist: safetensors>=0.4
|
|
22
|
-
Requires-Dist: tensorrt-cu13<12,>=11.
|
|
22
|
+
Requires-Dist: tensorrt-cu13<12,>=11.2
|
|
23
23
|
Provides-Extra: convert
|
|
24
24
|
Requires-Dist: torch>=2.6; extra == "convert"
|
|
25
25
|
Provides-Extra: producer
|
|
@@ -47,10 +47,10 @@ Read the [v2 user guide](https://sync-dev-org.github.io/tensoracle/) and [Migrat
|
|
|
47
47
|
| Role | Use | Additional requirements |
|
|
48
48
|
| --- | --- | --- |
|
|
49
49
|
| Inference application | Call the model package's inference binding. | NVIDIA GPU and driver; the model package manages CUDA buffers and streams. |
|
|
50
|
-
| Model package developer | Open and execute engines through tensoracle's C++ SDK, exposing inference through your own binding. | TensorRT 11 headers, CMake 3.26 or later, C++17 compiler, and a binding framework when needed. |
|
|
50
|
+
| Model package developer | Open and execute engines through tensoracle's C++ SDK, exposing inference through your own binding. | TensorRT 11.2 or later (below 12) headers, CMake 3.26 or later, C++17 compiler, and a binding framework when needed. |
|
|
51
51
|
| Cubin plugin developer | Compile CUDA C++ kernels and package a native plugin with the model. | `tensoracle[producer]`, PyPI CUDA headers and tools, TensorRT SDK, CMake, and a C++17 compiler. |
|
|
52
52
|
|
|
53
|
-
v2
|
|
53
|
+
v2 supplies a Linux x86_64 `manylinux_2_28`, `cp312-abi3` wheel, including WSL2. The package currently declares Python 3.12 and 3.13 support. Target GPUs are sm86, sm89, and sm120 with TensorRT 11.2 or later (below 12); fp8 requires sm89 or sm120. Windows x86_64 users must keep using tensoracle 1.x until a later v2 minor release adds a Windows wheel.
|
|
54
54
|
|
|
55
55
|
The wheel contains the C++ public headers, `libtensoracle`, CMake package configuration, and cubin plugin helper sources. TensorRT is resolved through a wheel dependency; the NVIDIA driver is not bundled. Public C++ interfaces and saved engine files remain compatible within a major version.
|
|
56
56
|
|
|
@@ -15,10 +15,10 @@ Read the [v2 user guide](https://sync-dev-org.github.io/tensoracle/) and [Migrat
|
|
|
15
15
|
| Role | Use | Additional requirements |
|
|
16
16
|
| --- | --- | --- |
|
|
17
17
|
| Inference application | Call the model package's inference binding. | NVIDIA GPU and driver; the model package manages CUDA buffers and streams. |
|
|
18
|
-
| Model package developer | Open and execute engines through tensoracle's C++ SDK, exposing inference through your own binding. | TensorRT 11 headers, CMake 3.26 or later, C++17 compiler, and a binding framework when needed. |
|
|
18
|
+
| Model package developer | Open and execute engines through tensoracle's C++ SDK, exposing inference through your own binding. | TensorRT 11.2 or later (below 12) headers, CMake 3.26 or later, C++17 compiler, and a binding framework when needed. |
|
|
19
19
|
| Cubin plugin developer | Compile CUDA C++ kernels and package a native plugin with the model. | `tensoracle[producer]`, PyPI CUDA headers and tools, TensorRT SDK, CMake, and a C++17 compiler. |
|
|
20
20
|
|
|
21
|
-
v2
|
|
21
|
+
v2 supplies a Linux x86_64 `manylinux_2_28`, `cp312-abi3` wheel, including WSL2. The package currently declares Python 3.12 and 3.13 support. Target GPUs are sm86, sm89, and sm120 with TensorRT 11.2 or later (below 12); fp8 requires sm89 or sm120. Windows x86_64 users must keep using tensoracle 1.x until a later v2 minor release adds a Windows wheel.
|
|
22
22
|
|
|
23
23
|
The wheel contains the C++ public headers, `libtensoracle`, CMake package configuration, and cubin plugin helper sources. TensorRT is resolved through a wheel dependency; the NVIDIA driver is not bundled. Public C++ interfaces and saved engine files remain compatible within a major version.
|
|
24
24
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"""Supply shared repository sources to scikit-build-core from the Python project."""
|
|
2
2
|
|
|
3
|
+
import ctypes
|
|
3
4
|
import json
|
|
4
5
|
import os
|
|
6
|
+
import runpy
|
|
5
7
|
import shutil
|
|
8
|
+
import sys
|
|
6
9
|
import tempfile
|
|
7
10
|
from contextlib import contextmanager
|
|
8
11
|
from pathlib import Path
|
|
@@ -130,3 +133,42 @@ def prepare_metadata_for_build_editable(metadata_directory, config_settings=None
|
|
|
130
133
|
return _call(
|
|
131
134
|
native_build.prepare_metadata_for_build_editable, metadata_directory, config_settings
|
|
132
135
|
)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def _generate_stubs(library, module_path, destination):
|
|
139
|
+
"""Keep stub generation on the same TensorRT binary used by the native build."""
|
|
140
|
+
import hashlib
|
|
141
|
+
import importlib
|
|
142
|
+
|
|
143
|
+
expected = Path(library).resolve()
|
|
144
|
+
# Load this SONAME before importing the extension, including when the caller
|
|
145
|
+
# has a different TensorRT on its ordinary library search path.
|
|
146
|
+
ctypes.CDLL(str(expected))
|
|
147
|
+
os.environ["NB_STUBGEN"] = "1"
|
|
148
|
+
sys.path.insert(0, module_path)
|
|
149
|
+
importlib.import_module("tensoracle._native")
|
|
150
|
+
loaded = {
|
|
151
|
+
Path(line.split()[-1]).resolve()
|
|
152
|
+
for line in Path("/proc/self/maps").read_text().splitlines()
|
|
153
|
+
if "/libnvinfer.so" in line
|
|
154
|
+
}
|
|
155
|
+
if loaded != {expected}:
|
|
156
|
+
raise RuntimeError(f"Stub generator expected TensorRT {expected}; loaded {loaded}")
|
|
157
|
+
with expected.open("rb") as file:
|
|
158
|
+
digest = hashlib.file_digest(file, "sha256").hexdigest()
|
|
159
|
+
print(
|
|
160
|
+
"TensorRT for stub generation: "
|
|
161
|
+
+ json.dumps(
|
|
162
|
+
{
|
|
163
|
+
"library": str(expected),
|
|
164
|
+
"sha256": digest,
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
flush=True,
|
|
168
|
+
)
|
|
169
|
+
sys.argv = ["nanobind.stubgen", "-m", "tensoracle._native", "-o", destination, "-P"]
|
|
170
|
+
runpy.run_module("nanobind.stubgen", run_name="__main__")
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
if __name__ == "__main__":
|
|
174
|
+
_generate_stubs(*sys.argv[1:])
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.26)
|
|
2
|
+
option(BUILD_TESTING "Build tensoracle tests" ON)
|
|
3
|
+
if(BUILD_TESTING)
|
|
4
|
+
set(TENSORACLE_CONAN_OFFLINE ON CACHE BOOL "Use prepared test dependencies")
|
|
5
|
+
endif()
|
|
6
|
+
include("${CMAKE_CURRENT_LIST_DIR}/conan/bootstrap.cmake")
|
|
2
7
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
|
|
3
8
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/tensoracle/tensoracle.h")
|
|
4
9
|
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/include/tensoracle/tensoracle.h" _tensoracle_header)
|
|
@@ -23,21 +28,13 @@ else()
|
|
|
23
28
|
/usr/local/cuda/include REQUIRED)
|
|
24
29
|
endif()
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
set(TENSORACLE_TENSORRT_LIBRARY "$ENV{TENSORACLE_TENSORRT_LIBRARY}" CACHE FILEPATH
|
|
28
|
-
"TensorRT 11 libnvinfer (may be supplied by the tensorrt_libs wheel)")
|
|
31
|
+
include(cmake/TensoracleDependencies.cmake)
|
|
29
32
|
find_path(TENSORACLE_TENSORRT_INCLUDE NvInfer.h
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
set(TENSORACLE_TENSORRT_LIBRARY "${_tensoracle_nvinfer}" CACHE FILEPATH "TensorRT 11 libnvinfer" FORCE)
|
|
35
|
-
endif()
|
|
36
|
-
if(NOT EXISTS "${TENSORACLE_TENSORRT_LIBRARY}")
|
|
37
|
-
message(FATAL_ERROR "TensorRT libnvinfer is missing: ${TENSORACLE_TENSORRT_LIBRARY}")
|
|
38
|
-
endif()
|
|
33
|
+
PATHS ${TensorRT_INCLUDE_DIRS} NO_DEFAULT_PATH REQUIRED NO_CACHE)
|
|
34
|
+
get_filename_component(_tensoracle_tensorrt_root "${TENSORACLE_TENSORRT_INCLUDE}" DIRECTORY)
|
|
35
|
+
set(TENSORACLE_TENSORRT_LIBRARY "${_tensoracle_tensorrt_root}/lib/libnvinfer.so.11")
|
|
36
|
+
message(STATUS "TensorRT SDK from Conan: ${TENSORACLE_TENSORRT_INCLUDE}; ${TENSORACLE_TENSORRT_LIBRARY}")
|
|
39
37
|
|
|
40
|
-
include(cmake/TensoracleDependencies.cmake)
|
|
41
38
|
add_library(tensoracle SHARED src/abi.cpp src/error.cpp src/bundle.cpp src/producer.cpp src/comparison.cpp)
|
|
42
39
|
target_sources(tensoracle PRIVATE src/engine.cpp src/cache.cpp src/plugins.cpp src/cache_open.cpp)
|
|
43
40
|
target_sources(tensoracle PRIVATE src/cache_management.cpp src/cache_management_internal.cpp)
|
|
@@ -95,9 +92,10 @@ install(TARGETS tensoracle EXPORT tensoracleTargets
|
|
|
95
92
|
RUNTIME DESTINATION "${_tensoracle_root}${CMAKE_INSTALL_BINDIR}"
|
|
96
93
|
ARCHIVE DESTINATION "${TENSORACLE_LIBRARY_DIR}")
|
|
97
94
|
install(DIRECTORY include/ DESTINATION "${TENSORACLE_INCLUDE_DIR}")
|
|
98
|
-
|
|
95
|
+
include("${CMAKE_BINARY_DIR}/conan/tensoracle_licenses.cmake")
|
|
96
|
+
install(FILES "${TENSORACLE_NLOHMANN_JSON_LICENSE}"
|
|
99
97
|
DESTINATION "${_tensoracle_root}licenses/nlohmann-json")
|
|
100
|
-
install(FILES "${
|
|
98
|
+
install(FILES "${TENSORACLE_MINIZ_LICENSE}"
|
|
101
99
|
DESTINATION "${_tensoracle_root}licenses/miniz")
|
|
102
100
|
install(FILES src/cubin_plugin.cpp src/sha256.hpp DESTINATION "${_tensoracle_root}src")
|
|
103
101
|
install(FILES cmake/TensoracleCuda.cmake cmake/TensoracleCubinPlugin.cmake
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Building tensoracle's C++ library
|
|
2
|
+
|
|
3
|
+
C++ builds require CMake 3.26 or later, Ninja, GCC 13 on Linux x86_64, the pinned
|
|
4
|
+
Conan dependencies, and CUDA headers and the driver link library. CUDA inputs
|
|
5
|
+
can come from the PyPI wheels described in the [SDK guide](../docs/tensorrt-sdk.md).
|
|
6
|
+
Python bindings are built separately through `python/`. The supported TensorRT
|
|
7
|
+
runtime is 11.2 or later (below 12); the build SDK is pinned to 11.2.1.2.
|
|
8
|
+
|
|
9
|
+
Install the Conan CLI at the exact version declared by `python/pyproject.toml`:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uv tool install "$(python3 -c 'import tomllib; from pathlib import Path; print(next(r for r in tomllib.loads(Path("python/pyproject.toml").read_text())["build-system"]["requires"] if r.startswith("conan==")))')"
|
|
13
|
+
cmake -P cpp/conan/prepare-tests.cmake
|
|
14
|
+
cmake -S cpp -B .nf/tmp/cpp -G Ninja \
|
|
15
|
+
-DCUDAToolkit_ROOT=/path/to/site-packages/nvidia/cu13
|
|
16
|
+
cmake --build .nf/tmp/cpp --parallel 8
|
|
17
|
+
ctest --test-dir .nf/tmp/cpp --output-on-failure
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Run these commands from the repository root. Test configuration uses prepared
|
|
21
|
+
recipes and binaries with no remotes, package builds, or recipe exports. Prepare
|
|
22
|
+
again after changing a recipe, profile, or lock. Without prepared dependencies,
|
|
23
|
+
configuration fails and prints the preparation command. To build only the library,
|
|
24
|
+
pass `-DBUILD_TESTING=OFF`; dependencies can then be obtained during configuration.
|
|
25
|
+
|
|
26
|
+
CTest needs a full TensorRT runtime, including its builder resources, separately
|
|
27
|
+
from the Conan SDK used for compilation and linking. By default, test configuration
|
|
28
|
+
looks for `tensorrt_libs` under `python/.venv/lib/python*/site-packages/`, as installed
|
|
29
|
+
by running `uv sync` from `python/`. To use a separate runtime without a Python
|
|
30
|
+
environment, add `-DTENSORACLE_TEST_TENSORRT_RUNTIME=/path/to/tensorrt/lib` to the
|
|
31
|
+
configure command. The directory must contain `libnvinfer.so.11` and the TensorRT
|
|
32
|
+
builder resource libraries. Configuration stops with this option in its diagnostic
|
|
33
|
+
if no full runtime is available. CTest supplies the selected directory through
|
|
34
|
+
`LD_LIBRARY_PATH` to the tests and their child processes; no manual environment
|
|
35
|
+
setting is needed. Library builds with `BUILD_TESTING=OFF` do not require a test
|
|
36
|
+
runtime.
|
|
37
|
+
|
|
38
|
+
A source build using `add_subdirectory(cpp)` includes `cpp/conan/bootstrap.cmake`
|
|
39
|
+
in its top-level `CMakeLists.txt` before the first `project()`, so the parent
|
|
40
|
+
project also uses the generated compiler settings and dependency search paths.
|
|
41
|
+
|
|
42
|
+
`cpp/conanfile.py` and `cpp/conan.lock` select nlohmann/json 3.11.3, miniz 3.0.2,
|
|
43
|
+
Catch2 3.16.1, and TensorRT SDK 11.2.1.2. The local recipes and verified input
|
|
44
|
+
information are in `cpp/conan/miniz/` and `cpp/conan/tensorrt/`. TensorRT headers
|
|
45
|
+
and the link library come from the same digest-verified recipe for standalone,
|
|
46
|
+
wheel, and test builds; no `TENSORACLE_SDK_ROOT` or `TENSORRT_ROOT` is required. The default profile is `linux-gcc13`; release builds select
|
|
47
|
+
`linux-gcc14` for the manylinux image's compiler. Each profile selects C++17,
|
|
48
|
+
`libstdc++11`, and at most eight build jobs. CMake is supplied by the build
|
|
49
|
+
environment, including isolated Python builds.
|
|
50
|
+
CMake's tool requirement is represented as `cmake/system` in Conan, so the lock
|
|
51
|
+
does not depend on the installed CMake version. Each CMake entry point checks
|
|
52
|
+
the minimum version. Conan does not download or build a CMake package.
|
|
53
|
+
|
|
54
|
+
Set `CONAN_HOME` to isolate Conan's metadata. To isolate its package storage, pass
|
|
55
|
+
`-DTENSORACLE_CONAN_CACHE=/absolute/package/directory` to both preparation and
|
|
56
|
+
configuration. The equivalent environment variable also applies to Python test
|
|
57
|
+
fixtures. Python's editable build accepts
|
|
58
|
+
`-Ccmake.define.TENSORACLE_CONAN_CACHE=/absolute/package/directory`.
|
|
59
|
+
Run Python tests after preparation with `TENSORACLE_CONAN_OFFLINE=ON`; native
|
|
60
|
+
fixtures always use this mode. Conan is a build dependency: installed CMake
|
|
61
|
+
consumers use the wheel's SDK without Conan or its targets.
|
|
62
|
+
|
|
63
|
+
nanobind stays in Python's build requirements, CUDA components stay in the PyPI
|
|
64
|
+
wheels, and the build uses the Conan TensorRT SDK. Installed Python wheels resolve
|
|
65
|
+
TensorRT through their existing runtime wheel dependency. Native applications
|
|
66
|
+
install TensorRT and its builder resources on their execution host.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
include_guard(GLOBAL)
|
|
2
|
+
find_package(nlohmann_json 3.11.3 EXACT CONFIG REQUIRED)
|
|
3
|
+
find_package(miniz 3.0.2 EXACT CONFIG REQUIRED)
|
|
4
|
+
find_package(TensorRT 11.2.1.2 EXACT CONFIG REQUIRED)
|
|
5
|
+
add_library(tensoracle_json ALIAS nlohmann_json::nlohmann_json)
|
|
6
|
+
add_library(tensoracle_miniz ALIAS miniz::miniz)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Every build entry point includes this before its first project().
|
|
2
|
+
include_guard(GLOBAL)
|
|
3
|
+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
4
|
+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build configuration" FORCE)
|
|
5
|
+
endif()
|
|
6
|
+
include("${CMAKE_CURRENT_LIST_DIR}/install.cmake")
|
|
7
|
+
tensoracle_conan_profile()
|
|
8
|
+
file(GLOB_RECURSE dependency_inputs LIST_DIRECTORIES FALSE "${CMAKE_CURRENT_LIST_DIR}/*")
|
|
9
|
+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dependency_inputs}
|
|
10
|
+
"${CMAKE_CURRENT_LIST_DIR}/../conanfile.py" "${CMAKE_CURRENT_LIST_DIR}/../conan.lock"
|
|
11
|
+
"${TENSORACLE_CONAN_PROFILE_PATH}")
|
|
12
|
+
tensoracle_install_dependencies("${TENSORACLE_CONAN_PROFILE_PATH}" "${CMAKE_BINARY_DIR}/conan")
|
|
13
|
+
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_BINARY_DIR}/conan/conan_toolchain.cmake" CACHE FILEPATH "Conan generated toolchain" FORCE)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
include_guard(GLOBAL)
|
|
2
|
+
|
|
3
|
+
function(tensoracle_install_dependencies profile output_folder)
|
|
4
|
+
# The build requirement is the sole definition of the CLI version.
|
|
5
|
+
if(EXISTS "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../pyproject.toml")
|
|
6
|
+
set(metadata "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../pyproject.toml")
|
|
7
|
+
else()
|
|
8
|
+
set(metadata "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../python/pyproject.toml")
|
|
9
|
+
endif()
|
|
10
|
+
file(READ "${metadata}" contents)
|
|
11
|
+
string(REGEX MATCH "conan==([0-9]+\\.[0-9]+\\.[0-9]+)" requirement "${contents}")
|
|
12
|
+
if(NOT requirement)
|
|
13
|
+
message(FATAL_ERROR "Missing exact conan==X.Y.Z build requirement in ${metadata}")
|
|
14
|
+
endif()
|
|
15
|
+
set(version "${CMAKE_MATCH_1}")
|
|
16
|
+
set(TENSORACLE_CONAN_EXECUTABLE "" CACHE FILEPATH "Optional explicit Conan CLI")
|
|
17
|
+
if(TENSORACLE_CONAN_EXECUTABLE)
|
|
18
|
+
set(cli "${TENSORACLE_CONAN_EXECUTABLE}")
|
|
19
|
+
else()
|
|
20
|
+
find_program(cli conan NO_CACHE)
|
|
21
|
+
endif()
|
|
22
|
+
if(cli)
|
|
23
|
+
execute_process(COMMAND "${cli}" --version RESULT_VARIABLE status
|
|
24
|
+
OUTPUT_VARIABLE observed OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
25
|
+
endif()
|
|
26
|
+
if(NOT cli OR NOT status STREQUAL "0" OR NOT observed STREQUAL "Conan version ${version}")
|
|
27
|
+
message(FATAL_ERROR "${metadata} requires ${requirement}; found '${observed}' (${cli}). Use uv tool install ${requirement}")
|
|
28
|
+
endif()
|
|
29
|
+
set(TENSORACLE_CONAN_CACHE "$ENV{TENSORACLE_CONAN_CACHE}" CACHE PATH "Conan package storage; empty uses the Conan default")
|
|
30
|
+
set(TENSORACLE_CONAN_ARGS "$ENV{TENSORACLE_CONAN_ARGS}" CACHE STRING "Additional Conan install arguments")
|
|
31
|
+
option(TENSORACLE_CONAN_OFFLINE "Use prepared recipes and binaries without exports, remotes or builds" "$ENV{TENSORACLE_CONAN_OFFLINE}")
|
|
32
|
+
set(cache_args)
|
|
33
|
+
if(TENSORACLE_CONAN_CACHE)
|
|
34
|
+
list(APPEND cache_args --core-conf "core.cache:storage_path=${TENSORACLE_CONAN_CACHE}")
|
|
35
|
+
endif()
|
|
36
|
+
# A release container may have no writable HOME.
|
|
37
|
+
if(UNIX AND NOT DEFINED ENV{CONAN_HOME})
|
|
38
|
+
execute_process(COMMAND test -w "$ENV{HOME}" RESULT_VARIABLE unwritable)
|
|
39
|
+
if(unwritable)
|
|
40
|
+
set(ENV{CONAN_HOME} "${output_folder}/home")
|
|
41
|
+
endif()
|
|
42
|
+
endif()
|
|
43
|
+
set(lockfile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../conan.lock")
|
|
44
|
+
file(READ "${lockfile}" lock)
|
|
45
|
+
if(NOT TENSORACLE_CONAN_OFFLINE)
|
|
46
|
+
# Export and verify the exact revision recorded in the lock.
|
|
47
|
+
string(JSON count LENGTH "${lock}" requires)
|
|
48
|
+
math(EXPR last "${count} - 1")
|
|
49
|
+
foreach(index RANGE 0 ${last})
|
|
50
|
+
string(JSON ref GET "${lock}" requires ${index})
|
|
51
|
+
if(ref MATCHES "^(miniz|tensorrt)/([^#]+)#[^%]+")
|
|
52
|
+
set(expected "${CMAKE_MATCH_0}")
|
|
53
|
+
set(recipe_name "${CMAKE_MATCH_1}")
|
|
54
|
+
set(recipe_version "${CMAKE_MATCH_2}")
|
|
55
|
+
execute_process(COMMAND "${cli}" export "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${recipe_name}"
|
|
56
|
+
--version "${recipe_version}" --format=json ${cache_args}
|
|
57
|
+
OUTPUT_VARIABLE exported RESULT_VARIABLE status)
|
|
58
|
+
if(NOT status EQUAL 0)
|
|
59
|
+
message(FATAL_ERROR "Conan export failed for ${expected}")
|
|
60
|
+
endif()
|
|
61
|
+
string(JSON actual GET "${exported}" reference)
|
|
62
|
+
if(NOT actual STREQUAL expected)
|
|
63
|
+
message(FATAL_ERROR "Local ${recipe_name} recipe ${actual} differs from locked ${expected}; update the lock with the recipe")
|
|
64
|
+
endif()
|
|
65
|
+
endif()
|
|
66
|
+
endforeach()
|
|
67
|
+
set(policies --build=missing --remote conancenter ${TENSORACLE_CONAN_ARGS})
|
|
68
|
+
else()
|
|
69
|
+
set(policies --no-remote --build=never)
|
|
70
|
+
endif()
|
|
71
|
+
execute_process(COMMAND "${cli}" install "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/.."
|
|
72
|
+
--lockfile "${lockfile}" --profile:host "${profile}" --profile:build "${profile}"
|
|
73
|
+
--output-folder "${output_folder}" ${policies} ${cache_args}
|
|
74
|
+
RESULT_VARIABLE status)
|
|
75
|
+
if(NOT status EQUAL 0)
|
|
76
|
+
message(FATAL_ERROR "Conan dependencies are unavailable. Prepare them with: cmake -DTENSORACLE_CONAN_PROFILE=${profile} -DTENSORACLE_CONAN_CACHE=${TENSORACLE_CONAN_CACHE} -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/prepare-tests.cmake (CONAN_HOME=$ENV{CONAN_HOME})")
|
|
77
|
+
endif()
|
|
78
|
+
endfunction()
|
|
79
|
+
|
|
80
|
+
function(tensoracle_conan_profile)
|
|
81
|
+
set(default_profile "$ENV{TENSORACLE_CONAN_PROFILE}")
|
|
82
|
+
if(NOT default_profile)
|
|
83
|
+
set(default_profile linux-gcc13)
|
|
84
|
+
endif()
|
|
85
|
+
set(TENSORACLE_CONAN_PROFILE "${default_profile}" CACHE STRING "Conan profile name or absolute path")
|
|
86
|
+
if(IS_ABSOLUTE "${TENSORACLE_CONAN_PROFILE}")
|
|
87
|
+
set(profile "${TENSORACLE_CONAN_PROFILE}")
|
|
88
|
+
else()
|
|
89
|
+
set(profile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/profiles/${TENSORACLE_CONAN_PROFILE}")
|
|
90
|
+
endif()
|
|
91
|
+
set(TENSORACLE_CONAN_PROFILE_PATH "${profile}" PARENT_SCOPE)
|
|
92
|
+
endfunction()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.26)
|
|
2
|
+
project(miniz LANGUAGES C)
|
|
3
|
+
set(source "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
4
|
+
add_library(miniz STATIC "${source}/miniz.c" "${source}/miniz_zip.c"
|
|
5
|
+
"${source}/miniz_tinfl.c" "${source}/miniz_tdef.c")
|
|
6
|
+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/miniz_export.h" "#pragma once\n#define MINIZ_EXPORT\n")
|
|
7
|
+
target_include_directories(miniz PRIVATE "${source}" "${CMAKE_CURRENT_BINARY_DIR}")
|
|
8
|
+
set_target_properties(miniz PROPERTIES C_VISIBILITY_PRESET hidden)
|
|
9
|
+
install(TARGETS miniz ARCHIVE DESTINATION lib)
|
|
10
|
+
install(DIRECTORY "${source}/" DESTINATION include FILES_MATCHING PATTERN "*.h")
|
|
11
|
+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/miniz_export.h" DESTINATION include)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright 2013-2014 RAD Game Tools and Valve Software
|
|
2
|
+
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
|
|
3
|
+
|
|
4
|
+
All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Package the miniz release used by tensoracle as a private static library."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from typing import ClassVar
|
|
5
|
+
|
|
6
|
+
from conan import ConanFile
|
|
7
|
+
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
|
|
8
|
+
from conan.tools.files import copy, get
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Miniz(ConanFile):
|
|
12
|
+
name = "miniz"
|
|
13
|
+
version = "3.0.2"
|
|
14
|
+
license = "MIT"
|
|
15
|
+
homepage = "https://github.com/richgel999/miniz"
|
|
16
|
+
description = "Deflate and ZIP compression library"
|
|
17
|
+
package_type = "static-library"
|
|
18
|
+
settings = "os", "arch", "compiler", "build_type"
|
|
19
|
+
options: ClassVar[dict] = {"fPIC": [True, False]}
|
|
20
|
+
default_options: ClassVar[dict] = {"fPIC": True}
|
|
21
|
+
exports_sources = "CMakeLists.txt"
|
|
22
|
+
|
|
23
|
+
def config_options(self):
|
|
24
|
+
if self.settings.os == "Windows":
|
|
25
|
+
self.options.rm_safe("fPIC")
|
|
26
|
+
|
|
27
|
+
def layout(self):
|
|
28
|
+
cmake_layout(self, src_folder="src")
|
|
29
|
+
|
|
30
|
+
def source(self):
|
|
31
|
+
get(
|
|
32
|
+
self,
|
|
33
|
+
**self.conan_data["sources"][self.version],
|
|
34
|
+
strip_root=True,
|
|
35
|
+
filename=f"miniz-{self.version}.tar.gz",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def generate(self):
|
|
39
|
+
CMakeToolchain(self).generate()
|
|
40
|
+
|
|
41
|
+
def build(self):
|
|
42
|
+
cmake = CMake(self)
|
|
43
|
+
cmake.configure(build_script_folder=self.export_sources_folder)
|
|
44
|
+
cmake.build()
|
|
45
|
+
|
|
46
|
+
def package(self):
|
|
47
|
+
copy(
|
|
48
|
+
self,
|
|
49
|
+
"LICENSE",
|
|
50
|
+
self.source_folder,
|
|
51
|
+
os.path.join(self.package_folder, "licenses"),
|
|
52
|
+
)
|
|
53
|
+
CMake(self).install()
|
|
54
|
+
|
|
55
|
+
def package_info(self):
|
|
56
|
+
self.cpp_info.libs = ["miniz"]
|
|
57
|
+
self.cpp_info.set_property("cmake_file_name", "miniz")
|
|
58
|
+
self.cpp_info.set_property("cmake_target_name", "miniz::miniz")
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Download and package the released tensoracle C and C++ SDK."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from conan import ConanFile
|
|
6
|
+
from conan.errors import ConanInvalidConfiguration
|
|
7
|
+
from conan.tools.files import copy, get
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TensoracleSDK(ConanFile):
|
|
11
|
+
name = "tensoracle"
|
|
12
|
+
description = "Prebuilt tensoracle C ABI, C++ headers, and CMake package"
|
|
13
|
+
homepage = "https://github.com/sync-dev-org/tensoracle"
|
|
14
|
+
license = "MIT"
|
|
15
|
+
package_type = "shared-library"
|
|
16
|
+
settings = "os", "arch"
|
|
17
|
+
options = {"shared": [True]} # noqa: RUF012
|
|
18
|
+
default_options = {"shared": True} # noqa: RUF012
|
|
19
|
+
exports = "recipes.txt", "LICENSE"
|
|
20
|
+
|
|
21
|
+
def set_version(self):
|
|
22
|
+
if not self.version:
|
|
23
|
+
self.version = next(iter(self.conan_data["sources"]))
|
|
24
|
+
|
|
25
|
+
def validate(self):
|
|
26
|
+
if self.settings.os != "Linux" or self.settings.arch != "x86_64":
|
|
27
|
+
raise ConanInvalidConfiguration("This tensoracle SDK supports Linux x86_64 only")
|
|
28
|
+
|
|
29
|
+
def requirements(self):
|
|
30
|
+
self.requires("tensorrt/11.2.1.2", transitive_headers=True, transitive_libs=True)
|
|
31
|
+
|
|
32
|
+
def build(self):
|
|
33
|
+
data = self.conan_data["sources"][str(self.version)][str(self.settings.os)][
|
|
34
|
+
str(self.settings.arch)
|
|
35
|
+
]
|
|
36
|
+
get(self, **data)
|
|
37
|
+
|
|
38
|
+
def package(self):
|
|
39
|
+
copy(
|
|
40
|
+
self,
|
|
41
|
+
"*",
|
|
42
|
+
os.path.join(self.build_folder, "tensoracle"),
|
|
43
|
+
os.path.join(self.package_folder, "tensoracle"),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def package_info(self):
|
|
47
|
+
self.cpp_info.includedirs = ["tensoracle/cpp/include"]
|
|
48
|
+
self.cpp_info.libdirs = ["tensoracle/cpp/lib"]
|
|
49
|
+
self.cpp_info.bindirs = []
|
|
50
|
+
self.cpp_info.libs = ["tensoracle"]
|
|
51
|
+
self.cpp_info.builddirs = ["tensoracle/cpp/lib/cmake/tensoracle"]
|
|
52
|
+
self.cpp_info.set_property("cmake_find_mode", "none")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tensorrt/11.2.1.2
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.26)
|
|
2
|
+
include("${CMAKE_CURRENT_LIST_DIR}/install.cmake")
|
|
3
|
+
tensoracle_conan_profile()
|
|
4
|
+
set(TENSORACLE_CONAN_OUTPUT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.nf/tmp/conan-tests" CACHE PATH "Test dependency generators")
|
|
5
|
+
# Preparation is the single writer of custom recipes before parallel tests.
|
|
6
|
+
set(TENSORACLE_CONAN_OFFLINE OFF)
|
|
7
|
+
tensoracle_install_dependencies("${TENSORACLE_CONAN_PROFILE_PATH}" "${TENSORACLE_CONAN_OUTPUT_DIR}")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[settings]
|
|
2
|
+
os=Linux
|
|
3
|
+
arch=x86_64
|
|
4
|
+
compiler=gcc
|
|
5
|
+
compiler.version=13
|
|
6
|
+
compiler.libcxx=libstdc++11
|
|
7
|
+
compiler.cppstd=17
|
|
8
|
+
build_type=Release
|
|
9
|
+
|
|
10
|
+
[conf]
|
|
11
|
+
tools.build:jobs=8
|
|
12
|
+
tools.cmake.cmaketoolchain:generator={{ os.getenv("CMAKE_GENERATOR", "Ninja") }}
|
|
13
|
+
tools.build:compiler_executables={"c": "gcc", "cpp": "g++"}
|
|
14
|
+
|
|
15
|
+
# The invoking CMake supplies the tool; its version is checked by CMakeLists.txt.
|
|
16
|
+
[replace_tool_requires]
|
|
17
|
+
cmake/*: cmake/system
|
|
18
|
+
|
|
19
|
+
[platform_tool_requires]
|
|
20
|
+
cmake/system
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% set cc = "/opt/rh/gcc-toolset-14/root/usr/bin/gcc" %}
|
|
2
|
+
{% set cxx = "/opt/rh/gcc-toolset-14/root/usr/bin/g++" %}
|
|
3
|
+
[settings]
|
|
4
|
+
os=Linux
|
|
5
|
+
arch=x86_64
|
|
6
|
+
compiler=gcc
|
|
7
|
+
compiler.version=14
|
|
8
|
+
compiler.libcxx=libstdc++11
|
|
9
|
+
compiler.cppstd=17
|
|
10
|
+
build_type=Release
|
|
11
|
+
|
|
12
|
+
[conf]
|
|
13
|
+
tools.build:jobs=8
|
|
14
|
+
tools.cmake.cmaketoolchain:generator={{ os.getenv("CMAKE_GENERATOR", "Unix Makefiles") }}
|
|
15
|
+
tools.build:compiler_executables={"c": "{{ cc }}", "cpp": "{{ cxx }}"}
|
|
16
|
+
|
|
17
|
+
[replace_tool_requires]
|
|
18
|
+
cmake/*: cmake/system
|
|
19
|
+
|
|
20
|
+
[platform_tool_requires]
|
|
21
|
+
cmake/system
|