tensoracle 2.2.1__tar.gz → 2.3.0__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 → tensoracle-2.3.0}/CMakeLists.txt +1 -5
- {tensoracle-2.2.1 → tensoracle-2.3.0}/PKG-INFO +2 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/README.md +1 -1
- {tensoracle-2.2.1 → tensoracle-2.3.0}/build_backend.py +15 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/CMakeLists.txt +33 -8
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/README.md +57 -10
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/cmake/TensoracleCuda.cmake +12 -12
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/cmake/TensoracleDependencies.cmake +1 -1
- tensoracle-2.3.0/cpp/cmake/tensoracleConfig.cmake.in +47 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/conan/install.cmake +7 -22
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/conan/profiles/linux-gcc14 +4 -0
- tensoracle-2.3.0/cpp/conan/recipes/cuda-toolkit/conanfile.py +125 -0
- tensoracle-2.3.0/cpp/conan/recipes/cuda-toolkit/redist.json +163 -0
- {tensoracle-2.2.1/cpp/conan → tensoracle-2.3.0/cpp/conan/recipes}/tensorrt/conanfile.py +31 -8
- tensoracle-2.3.0/cpp/conan/recipes.json +5 -0
- tensoracle-2.3.0/cpp/conan/recipes.py +190 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/conan.lock +3 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/conanfile.py +8 -1
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/tensoracle.h +5 -3
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/CMakeLists.txt +9 -2
- tensoracle-2.3.0/cpp/tests/installed.cmake +26 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/runtime.cmake +12 -0
- tensoracle-2.3.0/cpp/tests/static_consumer/CMakeLists.txt +20 -0
- tensoracle-2.3.0/cpp/tests/static_consumer/fixture.cpp +69 -0
- tensoracle-2.3.0/cpp/tests/static_consumer/fixture.h +24 -0
- tensoracle-2.3.0/cpp/tests/static_consumer/main.c +52 -0
- tensoracle-2.3.0/cpp/tests/static_consumer/main.cpp +39 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/cpp-python-repositories.md +3 -3
- tensoracle-2.3.0/docs/cpp-sdk.md +159 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/index.md +1 -1
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/tensorrt-sdk.md +38 -6
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/CMakeLists.txt +1 -6
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/README.md +2 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/pyproject.toml +0 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/wheel_consumer/CMakeLists.txt +1 -7
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/wheel_consumer/README.md +4 -3
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/wheel_consumer/pyproject.toml +0 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/pyproject.toml +0 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/_version.py +2 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/native_build.py +29 -9
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_build_distributions.py +104 -57
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_cmake_plugin.py +2 -2
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_conan.py +35 -1
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_cpp_test_runtime.py +26 -1
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_distribution.py +142 -5
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_example_plugin.py +4 -8
- tensoracle-2.3.0/tests/test_recipe_acquisition.py +238 -0
- tensoracle-2.3.0/tests/test_static_sdk.py +147 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_tensorrt_recipe.py +2 -2
- tensoracle-2.2.1/cpp/cmake/tensoracleConfig.cmake.in +0 -4
- tensoracle-2.2.1/cpp/conan/miniz/CMakeLists.txt +0 -11
- tensoracle-2.2.1/cpp/conan/miniz/LICENSE +0 -22
- tensoracle-2.2.1/cpp/conan/miniz/conandata.yml +0 -4
- tensoracle-2.2.1/cpp/conan/miniz/conanfile.py +0 -58
- tensoracle-2.2.1/cpp/conan/package/conanfile.py +0 -52
- tensoracle-2.2.1/cpp/conan/package/recipes.txt +0 -1
- tensoracle-2.2.1/cpp/tests/installed.cmake +0 -15
- tensoracle-2.2.1/docs/cpp-sdk.md +0 -88
- tensoracle-2.2.1/tests/test_sdk_recipe.py +0 -95
- {tensoracle-2.2.1 → tensoracle-2.3.0}/.gitignore +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/LICENSE +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/bindings.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/cmake/TensoracleCubinPlugin.cmake +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/conan/bootstrap.cmake +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/conan/prepare-tests.cmake +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/conan/profiles/linux-gcc13 +0 -0
- {tensoracle-2.2.1/cpp/conan → tensoracle-2.3.0/cpp/conan/recipes}/tensorrt/LICENSE.NVIDIA +0 -0
- {tensoracle-2.2.1/cpp/conan → tensoracle-2.3.0/cpp/conan/recipes}/tensorrt/LICENSE.OSS +0 -0
- {tensoracle-2.2.1/cpp/conan → tensoracle-2.3.0/cpp/conan/recipes}/tensorrt/conandata.yml +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/builder.h +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/builder.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/cache.h +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/cache.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/cubin.h +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/cubin.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/cubin_plugin.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/engine.h +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/engine.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/plugins.h +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/plugins.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/include/tensoracle/tensoracle.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/abi.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/builder.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/builder_internal.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/bundle.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/bundle_internal.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/cache.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/cache.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/cache_management.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/cache_management_internal.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/cache_management_internal.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/cache_open.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/comparison.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/cubin_plugin.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/engine.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/engine_internal.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/error.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/error.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/native_exports.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/plugins.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/producer.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/safetensors.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/safetensors.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/sha256.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/structure.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/src/tensoracle.map +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/abi.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/builder.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/builder_fixture.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/builder_probe.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/c_consumer.c +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/cache.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/cache_management.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/cache_probe.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/comparison.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/concurrent_builder.hpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/consumer/CMakeLists.txt +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/consumer/main.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/core.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/cubin.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/driver_failures.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/execution.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/native_exports.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/native_exports_fixture.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/plugin_fixture.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/plugins.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/precision.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/utilities.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cpp/tests/weights.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/cubin_bindings.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/api/bundle.md +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/api/index.md +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/api/producer.md +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/migration.md +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/optimization.md +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/docs/precision.md +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bindings.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/bundle.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/bundle.json +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm120/bias.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm120/dot.specialized.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm120/dot.tf32-control.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm120/dot.unspecialized.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm120/scale.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm86/bias.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm86/dot.specialized.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm86/dot.tf32-control.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm86/dot.unspecialized.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm86/scale.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm89/bias.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm89/dot.specialized.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm89/dot.tf32-control.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm89/dot.unspecialized.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/bundle/cubins/sm89/scale.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/example_cubin_plugin/__init__.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/example_cubin_plugin/weights.safetensors +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/kernels.cu +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/kernels.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/cubin_plugin/plugin.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/wheel_consumer/bindings.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/examples/wheel_consumer/src/tensoracle_consumer/__init__.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/mkdocs.yml +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/__init__.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/_cli.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/_comparison.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/bundle.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/convert.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/producer.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/src/tensoracle/py.typed +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/cubin_io/check.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/cubins/ptxas-12.9.86/sm120.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/cubins/ptxas-12.9.86/sm86.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/cubins/ptxas-12.9.86/sm89.cubin +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/native/CMakeLists.txt +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/native/cache/CMakeLists.txt +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/native/cache/writer.cpp +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/native/export.h +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_bundle.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_cache_cli.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_cmake_cuda.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_comparison.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_comparison_binding.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_convert.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_cpp_core.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_native.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_plugin_io.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_producer.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/tests/test_public_api.py +0 -0
- {tensoracle-2.2.1 → tensoracle-2.3.0}/uv.lock +0 -0
|
@@ -16,16 +16,12 @@ get_filename_component(_tensorrt_root "${TensorRT_INCLUDE_DIR}" DIRECTORY)
|
|
|
16
16
|
find_library(_stub_nvinfer NAMES nvinfer PATHS "${_tensorrt_root}/lib"
|
|
17
17
|
NO_DEFAULT_PATH REQUIRED NO_CACHE)
|
|
18
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
19
|
set(TENSORACLE_INSTALL_ROOT "tensoracle/cpp" CACHE STRING "Wheel SDK prefix" FORCE)
|
|
25
20
|
set(TENSORACLE_INSTALL_RPATH "$ORIGIN/../../../tensorrt_libs" CACHE STRING "TensorRT wheel lookup" FORCE)
|
|
26
21
|
set(CMAKE_INSTALL_LIBDIR lib CACHE STRING "Wheel library directory" FORCE)
|
|
27
22
|
set(BUILD_TESTING OFF CACHE BOOL "Tests are built separately" FORCE)
|
|
28
23
|
set(TENSORACLE_BUILD_CUBIN_HELPER OFF CACHE BOOL "Ship the source-based helper" FORCE)
|
|
24
|
+
set(BUILD_SHARED_LIBS ON CACHE BOOL "Wheels ship the shared library" FORCE)
|
|
29
25
|
|
|
30
26
|
add_subdirectory("${_cpp}" cpp)
|
|
31
27
|
nanobind_add_module(_native STABLE_ABI bindings.cpp cubin_bindings.cpp)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensoracle
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
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
|
|
@@ -48,7 +48,7 @@ Read the [v2 user guide](https://sync-dev-org.github.io/tensoracle/) and [Migrat
|
|
|
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
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
|
-
| Cubin plugin developer | Compile CUDA C++ kernels and package a native plugin with the model. | `tensoracle[producer]`,
|
|
51
|
+
| Cubin plugin developer | Compile CUDA C++ kernels and package a native plugin with the model. | `tensoracle[producer]`, Conan CUDA headers and TensorRT SDK, PyPI producer tools, CMake, and a C++17 compiler. |
|
|
52
52
|
|
|
53
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
|
|
|
@@ -16,7 +16,7 @@ Read the [v2 user guide](https://sync-dev-org.github.io/tensoracle/) and [Migrat
|
|
|
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
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
|
-
| Cubin plugin developer | Compile CUDA C++ kernels and package a native plugin with the model. | `tensoracle[producer]`,
|
|
19
|
+
| Cubin plugin developer | Compile CUDA C++ kernels and package a native plugin with the model. | `tensoracle[producer]`, Conan CUDA headers and TensorRT SDK, PyPI producer tools, CMake, and a C++17 compiler. |
|
|
20
20
|
|
|
21
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
|
|
|
@@ -19,7 +19,7 @@ get_requires_for_build_wheel = native_build.get_requires_for_build_wheel
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
@contextmanager
|
|
22
|
-
def _source_tree(*, editable=False):
|
|
22
|
+
def _source_tree(*, editable=False, include_recipes=False):
|
|
23
23
|
project = Path(__file__).resolve().parent
|
|
24
24
|
source_archive = (project / "PKG-INFO").is_file()
|
|
25
25
|
repository = project if source_archive else project.parent
|
|
@@ -70,6 +70,15 @@ def _source_tree(*, editable=False):
|
|
|
70
70
|
)
|
|
71
71
|
else:
|
|
72
72
|
shutil.copyfile(source, destination)
|
|
73
|
+
if include_recipes:
|
|
74
|
+
recipe_tools = runpy.run_path(str(repository / "cpp/conan/recipes.py"))
|
|
75
|
+
cache = os.environ.get("TENSORACLE_CONAN_CACHE")
|
|
76
|
+
cache_args = ["--core-conf", f"core.cache:storage_path={cache}"] if cache else []
|
|
77
|
+
recipe_tools["copy_recipes"](
|
|
78
|
+
repository / "cpp/conan",
|
|
79
|
+
staged / "cpp/conan/recipes",
|
|
80
|
+
cache_args=cache_args,
|
|
81
|
+
)
|
|
73
82
|
if editable:
|
|
74
83
|
# Source redirects must survive deletion of the staging directory.
|
|
75
84
|
settings = staged / "pyproject.toml"
|
|
@@ -101,7 +110,11 @@ def _source_tree(*, editable=False):
|
|
|
101
110
|
def _call(hook, directory, config_settings=None, metadata_directory=None, *, editable=False):
|
|
102
111
|
output = str(Path(directory).resolve())
|
|
103
112
|
metadata = str(Path(metadata_directory).resolve()) if metadata_directory else None
|
|
104
|
-
with _source_tree(
|
|
113
|
+
with _source_tree(
|
|
114
|
+
editable=editable,
|
|
115
|
+
include_recipes=hook
|
|
116
|
+
in (native_build.build_sdist, native_build.build_wheel, native_build.build_editable),
|
|
117
|
+
):
|
|
105
118
|
if hook in (native_build.build_wheel, native_build.build_editable):
|
|
106
119
|
return hook(output, config_settings, metadata)
|
|
107
120
|
return hook(output, config_settings)
|
|
@@ -16,16 +16,16 @@ project(tensoracle VERSION ${_tensoracle_MAJOR}.${_tensoracle_MINOR}.${_tensorac
|
|
|
16
16
|
include(GNUInstallDirs)
|
|
17
17
|
include(CMakePackageConfigHelpers)
|
|
18
18
|
include(cmake/TensoracleCuda.cmake)
|
|
19
|
+
option(BUILD_SHARED_LIBS "Build the shared tensoracle library" ON)
|
|
19
20
|
option(TENSORACLE_BUILD_CUBIN_HELPER "Build the standalone cubin helper archive" ON)
|
|
20
|
-
if(TENSORACLE_BUILD_CUBIN_HELPER)
|
|
21
|
+
if(TENSORACLE_BUILD_CUBIN_HELPER OR NOT BUILD_SHARED_LIBS)
|
|
21
22
|
# Preserve the existing helper's discovery and diagnostics for native builds.
|
|
22
23
|
_tensoracle_find_cuda()
|
|
23
24
|
get_target_property(TENSORACLE_CUDA_INCLUDE tensoracle_cuda_driver INTERFACE_INCLUDE_DIRECTORIES)
|
|
24
25
|
else()
|
|
25
|
-
# The
|
|
26
|
+
# The Conan toolchain supplies the same headers without linking the driver.
|
|
26
27
|
find_path(TENSORACLE_CUDA_INCLUDE cuda_runtime_api.h
|
|
27
|
-
|
|
28
|
-
/usr/local/cuda/include REQUIRED)
|
|
28
|
+
PATHS "${CUDAToolkit_ROOT}/include" NO_DEFAULT_PATH REQUIRED NO_CACHE)
|
|
29
29
|
endif()
|
|
30
30
|
|
|
31
31
|
include(cmake/TensoracleDependencies.cmake)
|
|
@@ -35,7 +35,7 @@ get_filename_component(_tensoracle_tensorrt_root "${TENSORACLE_TENSORRT_INCLUDE}
|
|
|
35
35
|
set(TENSORACLE_TENSORRT_LIBRARY "${_tensoracle_tensorrt_root}/lib/libnvinfer.so.11")
|
|
36
36
|
message(STATUS "TensorRT SDK from Conan: ${TENSORACLE_TENSORRT_INCLUDE}; ${TENSORACLE_TENSORRT_LIBRARY}")
|
|
37
37
|
|
|
38
|
-
add_library(tensoracle
|
|
38
|
+
add_library(tensoracle src/abi.cpp src/error.cpp src/bundle.cpp src/producer.cpp src/comparison.cpp)
|
|
39
39
|
target_sources(tensoracle PRIVATE src/engine.cpp src/cache.cpp src/plugins.cpp src/cache_open.cpp)
|
|
40
40
|
target_sources(tensoracle PRIVATE src/cache_management.cpp src/cache_management_internal.cpp)
|
|
41
41
|
target_sources(tensoracle PRIVATE src/builder.cpp src/safetensors.cpp)
|
|
@@ -45,18 +45,33 @@ if(NOT WIN32)
|
|
|
45
45
|
endif()
|
|
46
46
|
add_library(tensoracle::tensoracle ALIAS tensoracle)
|
|
47
47
|
target_compile_features(tensoracle PUBLIC cxx_std_17)
|
|
48
|
-
|
|
48
|
+
if(BUILD_SHARED_LIBS)
|
|
49
|
+
target_compile_definitions(tensoracle PRIVATE TENSORACLE_BUILDING_LIBRARY)
|
|
50
|
+
else()
|
|
51
|
+
target_compile_definitions(tensoracle PUBLIC TENSORACLE_STATIC_LIBRARY)
|
|
52
|
+
set_target_properties(tensoracle PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
53
|
+
endif()
|
|
49
54
|
target_include_directories(tensoracle PUBLIC
|
|
50
55
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
|
51
56
|
PRIVATE "${TENSORACLE_TENSORRT_INCLUDE}" "${TENSORACLE_CUDA_INCLUDE}")
|
|
52
|
-
|
|
57
|
+
if(BUILD_SHARED_LIBS)
|
|
58
|
+
target_link_libraries(tensoracle PRIVATE "${TENSORACLE_TENSORRT_LIBRARY}" tensoracle_json tensoracle_miniz ${CMAKE_DL_LIBS})
|
|
59
|
+
else()
|
|
60
|
+
# Keep third-party objects out of the archive and resolve their targets in
|
|
61
|
+
# the consumer's toolchain, without exporting this build's Conan paths.
|
|
62
|
+
target_link_libraries(tensoracle PRIVATE
|
|
63
|
+
"$<BUILD_INTERFACE:${TENSORACLE_TENSORRT_LIBRARY}>"
|
|
64
|
+
"$<BUILD_INTERFACE:tensoracle_json>" miniz::miniz
|
|
65
|
+
"$<BUILD_INTERFACE:tensoracle_internal_cuda_driver>"
|
|
66
|
+
"$<INSTALL_INTERFACE:tensoracle_cuda_driver>" ${CMAKE_DL_LIBS})
|
|
67
|
+
endif()
|
|
53
68
|
set(TENSORACLE_INSTALL_RPATH "$ORIGIN" CACHE STRING "Relative runtime lookup paths for the installed library")
|
|
54
69
|
set_target_properties(tensoracle PROPERTIES
|
|
55
70
|
VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}
|
|
56
71
|
CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN YES
|
|
57
72
|
BUILD_RPATH_USE_ORIGIN YES
|
|
58
73
|
INSTALL_RPATH "${TENSORACLE_INSTALL_RPATH}")
|
|
59
|
-
if(UNIX AND NOT APPLE)
|
|
74
|
+
if(BUILD_SHARED_LIBS AND UNIX AND NOT APPLE)
|
|
60
75
|
target_link_options(tensoracle PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/tensoracle.map")
|
|
61
76
|
set_property(TARGET tensoracle APPEND PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/tensoracle.map")
|
|
62
77
|
endif()
|
|
@@ -100,6 +115,16 @@ install(FILES "${TENSORACLE_MINIZ_LICENSE}"
|
|
|
100
115
|
install(FILES src/cubin_plugin.cpp src/sha256.hpp DESTINATION "${_tensoracle_root}src")
|
|
101
116
|
install(FILES cmake/TensoracleCuda.cmake cmake/TensoracleCubinPlugin.cmake
|
|
102
117
|
DESTINATION "${TENSORACLE_HELPER_DIR}")
|
|
118
|
+
set(TENSORACLE_STATIC_DEPENDENCIES "")
|
|
119
|
+
if(NOT BUILD_SHARED_LIBS)
|
|
120
|
+
set(TENSORACLE_STATIC_DEPENDENCIES [=[ include(CMakeFindDependencyMacro)
|
|
121
|
+
find_dependency(miniz 3.1.1 EXACT CONFIG)
|
|
122
|
+
if(NOT WIN32)
|
|
123
|
+
find_dependency(Threads)
|
|
124
|
+
endif()
|
|
125
|
+
_tensoracle_find_cuda()
|
|
126
|
+
]=])
|
|
127
|
+
endif()
|
|
103
128
|
configure_package_config_file(cmake/tensoracleConfig.cmake.in
|
|
104
129
|
"${CMAKE_CURRENT_BINARY_DIR}/tensoracleConfig.cmake"
|
|
105
130
|
INSTALL_DESTINATION "${TENSORACLE_PACKAGE_DIR}" PATH_VARS TENSORACLE_HELPER_DIR)
|
|
@@ -1,8 +1,47 @@
|
|
|
1
1
|
# Building tensoracle's C++ library
|
|
2
2
|
|
|
3
|
+
Applications can use the [prebuilt C and C++ SDK](../docs/cpp-sdk.md) from the public
|
|
4
|
+
GitHub Release: verify the archive's SHA256, extract it, and configure CMake with
|
|
5
|
+
`CMAKE_PREFIX_PATH` pointing to `tensoracle/cpp`. The tensoracle Conan package
|
|
6
|
+
recipe is maintained separately and is not included in this repository.
|
|
7
|
+
The following commands build tensoracle from source.
|
|
8
|
+
|
|
9
|
+
The default is a shared library (`BUILD_SHARED_LIBS=ON`). To embed tensoracle
|
|
10
|
+
statically, build from source with `-DBUILD_SHARED_LIBS=OFF` and install the result:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
cmake -S cpp -B build/static -G Ninja -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF
|
|
14
|
+
cmake --build build/static --parallel 8
|
|
15
|
+
cmake --install build/static --prefix /path/to/prefix
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Both forms provide the same headers and CMake target, `tensoracle::tensoracle`.
|
|
19
|
+
The static archive contains only tensoracle's objects. Its installed CMake
|
|
20
|
+
package resolves miniz, the CUDA driver link stub, TensorRT, and the platform
|
|
21
|
+
thread and dynamic-loader libraries in the consumer's build environment. Use
|
|
22
|
+
the prepared Conan toolchain for those dependencies, as described in the
|
|
23
|
+
[SDK guide](../docs/cpp-sdk.md#embed-tensoracle-from-source). The static target
|
|
24
|
+
supplies `TENSORACLE_STATIC_LIBRARY` so public declarations do not import or
|
|
25
|
+
export a DLL. The standalone `tensoracle_cubin` archive and source-based cubin
|
|
26
|
+
plugin helpers remain available in source builds.
|
|
27
|
+
|
|
28
|
+
Release SDK archives and Python wheels contain the shared library only; static
|
|
29
|
+
libraries are not distributed. A source-building Conan recipe selects static
|
|
30
|
+
embedding with `from_source=True` and `shared=False`. TensorRT stays a shared
|
|
31
|
+
library supplied by the execution host. The current library uses the CUDA
|
|
32
|
+
Driver API and does not require the CUDA runtime.
|
|
33
|
+
|
|
34
|
+
A process must contain one tensoracle implementation shared by all its code.
|
|
35
|
+
If an application or library embeds tensoracle, that artifact must be the only
|
|
36
|
+
owner in the process: do not load another artifact embedding tensoracle or a
|
|
37
|
+
tensoracle shared library there. Python processes use the wheel's shared
|
|
38
|
+
library. Relink an artifact that embeds tensoracle whenever its embedded
|
|
39
|
+
tensoracle version is updated.
|
|
40
|
+
|
|
3
41
|
C++ builds require CMake 3.26 or later, Ninja, GCC 13 on Linux x86_64, the pinned
|
|
4
|
-
Conan dependencies
|
|
5
|
-
|
|
42
|
+
Conan dependencies. CUDA headers and the driver link stub come from the locked
|
|
43
|
+
`cuda-toolkit/13.2.2` recipe (`compiler=False`), as described in the
|
|
44
|
+
[SDK guide](../docs/tensorrt-sdk.md).
|
|
6
45
|
Python bindings are built separately through `python/`. The supported TensorRT
|
|
7
46
|
runtime is 11.2 or later (below 12); the build SDK is pinned to 11.2.1.2.
|
|
8
47
|
|
|
@@ -11,8 +50,7 @@ Install the Conan CLI at the exact version declared by `python/pyproject.toml`:
|
|
|
11
50
|
```bash
|
|
12
51
|
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
52
|
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
|
|
53
|
+
cmake -S cpp -B .nf/tmp/cpp -G Ninja
|
|
16
54
|
cmake --build .nf/tmp/cpp --parallel 8
|
|
17
55
|
ctest --test-dir .nf/tmp/cpp --output-on-failure
|
|
18
56
|
```
|
|
@@ -35,13 +73,20 @@ if no full runtime is available. CTest supplies the selected directory through
|
|
|
35
73
|
setting is needed. Library builds with `BUILD_TESTING=OFF` do not require a test
|
|
36
74
|
runtime.
|
|
37
75
|
|
|
76
|
+
The C++ cubin producer test uses the CUDA compiler tools from `python/.venv`
|
|
77
|
+
when the producer extra is installed. Its compilation still uses the Conan
|
|
78
|
+
CUDA headers. Without those runtime tools, that optional test is skipped.
|
|
79
|
+
|
|
38
80
|
A source build using `add_subdirectory(cpp)` includes `cpp/conan/bootstrap.cmake`
|
|
39
81
|
in its top-level `CMakeLists.txt` before the first `project()`, so the parent
|
|
40
82
|
project also uses the generated compiler settings and dependency search paths.
|
|
41
83
|
|
|
42
|
-
`cpp/conanfile.py` and `cpp/conan.lock` select nlohmann/json 3.11.3, miniz 3.
|
|
43
|
-
Catch2 3.16.1,
|
|
44
|
-
|
|
84
|
+
`cpp/conanfile.py` and `cpp/conan.lock` select nlohmann/json 3.11.3, miniz 3.1.1,
|
|
85
|
+
Catch2 3.16.1, TensorRT SDK 11.2.1.2, and CUDA build inputs 13.2.2. Miniz, nlohmann/json, and Catch2
|
|
86
|
+
come from ConanCenter. Source distributions include the locked TensorRT recipe,
|
|
87
|
+
verified input manifest, and licenses in `cpp/conan/recipes/tensorrt/`, plus the
|
|
88
|
+
CUDA recipe and manifest in `cpp/conan/recipes/cuda-toolkit/`. The generated
|
|
89
|
+
toolchain supplies `CUDAToolkit_ROOT`; an explicit existing CUDA root is still accepted. TensorRT headers
|
|
45
90
|
and the link library come from the same digest-verified recipe for standalone,
|
|
46
91
|
wheel, and test builds; no `TENSORACLE_SDK_ROOT` or `TENSORRT_ROOT` is required. The default profile is `linux-gcc13`; release builds select
|
|
47
92
|
`linux-gcc14` for the manylinux image's compiler. Each profile selects C++17,
|
|
@@ -58,9 +103,11 @@ fixtures. Python's editable build accepts
|
|
|
58
103
|
`-Ccmake.define.TENSORACLE_CONAN_CACHE=/absolute/package/directory`.
|
|
59
104
|
Run Python tests after preparation with `TENSORACLE_CONAN_OFFLINE=ON`; native
|
|
60
105
|
fixtures always use this mode. Conan is a build dependency: installed CMake
|
|
61
|
-
consumers use the
|
|
106
|
+
consumers can use the prebuilt SDK archive without Conan or its targets.
|
|
62
107
|
|
|
63
|
-
nanobind stays in Python's build requirements
|
|
64
|
-
|
|
108
|
+
nanobind stays in Python's build requirements. C++ build inputs come from Conan;
|
|
109
|
+
the CUDA compiler and tools used at runtime by the cubin producer stay in PyPI
|
|
110
|
+
wheels. The release profile uses the CUDA toolkit in the manylinux image through
|
|
111
|
+
the same recipe's `system` mode; development uses verified NVIDIA redist archives. Installed Python wheels resolve
|
|
65
112
|
TensorRT through their existing runtime wheel dependency. Native applications
|
|
66
113
|
install TensorRT and its builder resources on their execution host.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
include_guard(GLOBAL)
|
|
2
2
|
|
|
3
|
-
# Only the Driver API is needed by the C++ helpers.
|
|
4
|
-
# the
|
|
3
|
+
# Only the Driver API is needed by the C++ helpers. Runtime-only Conan SDKs
|
|
4
|
+
# supply the headers and link stub without nvcc or an OS toolkit installation.
|
|
5
5
|
function(_tensoracle_find_cuda)
|
|
6
6
|
if(CUDAToolkit_ROOT)
|
|
7
7
|
set(_roots "${CUDAToolkit_ROOT}")
|
|
@@ -57,8 +57,8 @@ function(_tensoracle_find_cuda)
|
|
|
57
57
|
set(_root "${_selected_root}")
|
|
58
58
|
if(NOT _include)
|
|
59
59
|
message(FATAL_ERROR "CUDA header cuda.h was not found. Searched: ${_searched_includes}. "
|
|
60
|
-
"
|
|
61
|
-
"
|
|
60
|
+
"Prepare cuda-toolkit/13.2.2 with Conan and set CUDAToolkit_ROOT "
|
|
61
|
+
"to its user.cuda:root, or supply an existing CUDA SDK root.")
|
|
62
62
|
endif()
|
|
63
63
|
|
|
64
64
|
if(WIN32)
|
|
@@ -66,23 +66,23 @@ function(_tensoracle_find_cuda)
|
|
|
66
66
|
find_library(_tensoracle_cuda_driver_library NAMES cuda
|
|
67
67
|
PATHS ${_driver_paths} NO_DEFAULT_PATH)
|
|
68
68
|
else()
|
|
69
|
-
set(_driver_paths "
|
|
69
|
+
set(_driver_paths "${_root}/lib64/stubs" "${_root}/lib/stubs"
|
|
70
|
+
"${_root}/targets/x86_64-linux/lib/stubs" "${_root}/lib64" "${_root}/lib"
|
|
70
71
|
"${_root}/targets/x86_64-linux/lib")
|
|
71
|
-
find_library(_tensoracle_cuda_driver_library NAMES cuda
|
|
72
|
+
find_library(_tensoracle_cuda_driver_library NAMES cuda PATHS ${_driver_paths} NO_DEFAULT_PATH)
|
|
72
73
|
if(NOT _tensoracle_cuda_driver_library)
|
|
73
|
-
list(APPEND _driver_paths "
|
|
74
|
-
"${_root}/targets/x86_64-linux/lib/stubs")
|
|
74
|
+
list(APPEND _driver_paths "/usr/lib/wsl/lib")
|
|
75
75
|
find_library(_tensoracle_cuda_driver_library NAMES cuda
|
|
76
|
-
|
|
76
|
+
HINTS "/usr/lib/wsl/lib")
|
|
77
77
|
endif()
|
|
78
78
|
endif()
|
|
79
79
|
set(_driver "${_tensoracle_cuda_driver_library}")
|
|
80
80
|
unset(_tensoracle_cuda_driver_library CACHE)
|
|
81
81
|
if(NOT _driver)
|
|
82
82
|
message(FATAL_ERROR "CUDA driver link library was not found. Searched: ${_driver_paths} "
|
|
83
|
-
"and system library directories.
|
|
84
|
-
"
|
|
85
|
-
"
|
|
83
|
+
"and system library directories. Prepare cuda-toolkit/13.2.2 with Conan "
|
|
84
|
+
"and set CUDAToolkit_ROOT to its user.cuda:root. Existing CUDA SDK roots "
|
|
85
|
+
"and the installed NVIDIA driver on Linux remain supported.")
|
|
86
86
|
endif()
|
|
87
87
|
message(STATUS "tensoracle CUDA headers: ${_include}")
|
|
88
88
|
message(STATUS "tensoracle CUDA driver: ${_driver}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
include_guard(GLOBAL)
|
|
2
2
|
find_package(nlohmann_json 3.11.3 EXACT CONFIG REQUIRED)
|
|
3
|
-
find_package(miniz 3.
|
|
3
|
+
find_package(miniz 3.1.1 EXACT CONFIG REQUIRED)
|
|
4
4
|
find_package(TensorRT 11.2.1.2 EXACT CONFIG REQUIRED)
|
|
5
5
|
add_library(tensoracle_json ALIAS nlohmann_json::nlohmann_json)
|
|
6
6
|
add_library(tensoracle_miniz ALIAS miniz::miniz)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@PACKAGE_INIT@
|
|
2
|
+
include("@PACKAGE_TENSORACLE_HELPER_DIR@/TensoracleCubinPlugin.cmake")
|
|
3
|
+
if(NOT TARGET tensoracle::tensoracle)
|
|
4
|
+
@TENSORACLE_STATIC_DEPENDENCIES@ if(NOT TARGET TensorRT::nvinfer)
|
|
5
|
+
find_package(TensorRT QUIET CONFIG)
|
|
6
|
+
endif()
|
|
7
|
+
if(TARGET TensorRT::nvinfer)
|
|
8
|
+
set(_tensoracle_nvinfer TensorRT::nvinfer)
|
|
9
|
+
get_target_property(_tensoracle_nvinfer_type TensorRT::nvinfer TYPE)
|
|
10
|
+
if(_tensoracle_nvinfer_type STREQUAL "INTERFACE_LIBRARY")
|
|
11
|
+
# CMakeDeps exposes its per-configuration library directories here.
|
|
12
|
+
set(_tensoracle_nvinfer_dirs
|
|
13
|
+
"$<TARGET_GENEX_EVAL:TensorRT::nvinfer,$<TARGET_PROPERTY:TensorRT::nvinfer,INTERFACE_LINK_DIRECTORIES>>")
|
|
14
|
+
else()
|
|
15
|
+
set(_tensoracle_nvinfer_dirs "$<TARGET_FILE_DIR:TensorRT::nvinfer>")
|
|
16
|
+
endif()
|
|
17
|
+
else()
|
|
18
|
+
# Native SDKs use a host library. Wheels can use the separate TensorRT
|
|
19
|
+
# distribution beside tensoracle; no build-machine path is recorded here.
|
|
20
|
+
find_library(TENSORACLE_TENSORRT_LIBRARY NAMES nvinfer libnvinfer.so.11
|
|
21
|
+
HINTS "${TENSORRT_ROOT}" "$ENV{TENSORRT_ROOT}"
|
|
22
|
+
"${CMAKE_CURRENT_LIST_DIR}/../../../../../tensorrt_libs"
|
|
23
|
+
PATH_SUFFIXES lib lib64 lib/x86_64-linux-gnu)
|
|
24
|
+
if(NOT TENSORACLE_TENSORRT_LIBRARY OR NOT EXISTS "${TENSORACLE_TENSORRT_LIBRARY}")
|
|
25
|
+
set(tensoracle_FOUND FALSE)
|
|
26
|
+
set(tensoracle_NOT_FOUND_MESSAGE
|
|
27
|
+
"TensorRT 11 link library not found. Supply TensorRT::nvinfer through its CMake package, set TENSORRT_ROOT to its installation directory, or set TENSORACLE_TENSORRT_LIBRARY to the full library path.")
|
|
28
|
+
return()
|
|
29
|
+
endif()
|
|
30
|
+
set(_tensoracle_nvinfer "${TENSORACLE_TENSORRT_LIBRARY}")
|
|
31
|
+
get_filename_component(_tensoracle_nvinfer_dirs "${TENSORACLE_TENSORRT_LIBRARY}" DIRECTORY)
|
|
32
|
+
endif()
|
|
33
|
+
include("${CMAKE_CURRENT_LIST_DIR}/tensoracleTargets.cmake")
|
|
34
|
+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND @BUILD_SHARED_LIBS@)
|
|
35
|
+
# Resolve libtensoracle's DT_NEEDED at link time without adding a direct
|
|
36
|
+
# TensorRT dependency to consumers that already rely on its RUNPATH.
|
|
37
|
+
set_property(TARGET tensoracle::tensoracle APPEND PROPERTY
|
|
38
|
+
INTERFACE_LINK_OPTIONS "LINKER:-rpath-link,$<JOIN:${_tensoracle_nvinfer_dirs},:>")
|
|
39
|
+
else()
|
|
40
|
+
set_property(TARGET tensoracle::tensoracle APPEND PROPERTY
|
|
41
|
+
INTERFACE_LINK_LIBRARIES "${_tensoracle_nvinfer}")
|
|
42
|
+
endif()
|
|
43
|
+
unset(_tensoracle_nvinfer)
|
|
44
|
+
unset(_tensoracle_nvinfer_dirs)
|
|
45
|
+
unset(_tensoracle_nvinfer_type)
|
|
46
|
+
endif()
|
|
47
|
+
check_required_components(tensoracle)
|
|
@@ -41,29 +41,14 @@ function(tensoracle_install_dependencies profile output_folder)
|
|
|
41
41
|
endif()
|
|
42
42
|
endif()
|
|
43
43
|
set(lockfile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../conan.lock")
|
|
44
|
-
file(READ "${lockfile}" lock)
|
|
45
44
|
if(NOT TENSORACLE_CONAN_OFFLINE)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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()
|
|
45
|
+
find_program(recipe_python NAMES python3 python REQUIRED NO_CACHE)
|
|
46
|
+
execute_process(COMMAND "${recipe_python}" "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/recipes.py"
|
|
47
|
+
--conan "${cli}" ${cache_args}
|
|
48
|
+
RESULT_VARIABLE status OUTPUT_VARIABLE recipe_path ERROR_VARIABLE diagnostic)
|
|
49
|
+
if(NOT status EQUAL 0)
|
|
50
|
+
message(FATAL_ERROR "Locked SDK recipes are unavailable: ${diagnostic}")
|
|
51
|
+
endif()
|
|
67
52
|
set(policies --build=missing --remote conancenter ${TENSORACLE_CONAN_ARGS})
|
|
68
53
|
else()
|
|
69
54
|
set(policies --no-remote --build=never)
|
|
@@ -9,7 +9,11 @@ compiler.libcxx=libstdc++11
|
|
|
9
9
|
compiler.cppstd=17
|
|
10
10
|
build_type=Release
|
|
11
11
|
|
|
12
|
+
[options]
|
|
13
|
+
cuda-toolkit/*:mode=system
|
|
14
|
+
|
|
12
15
|
[conf]
|
|
16
|
+
user.cuda:root=/usr/local/cuda-13.2
|
|
13
17
|
tools.build:jobs=8
|
|
14
18
|
tools.cmake.cmaketoolchain:generator={{ os.getenv("CMAKE_GENERATOR", "Unix Makefiles") }}
|
|
15
19
|
tools.build:compiler_executables={"c": "{{ cc }}", "cpp": "{{ cxx }}"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""Acquire CUDA redist components, or describe an existing toolkit."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from conan import ConanFile
|
|
8
|
+
from conan.errors import ConanInvalidConfiguration
|
|
9
|
+
from conan.tools.files import check_sha256, copy, download, get
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CudaToolkit(ConanFile):
|
|
13
|
+
name = "cuda-toolkit"
|
|
14
|
+
package_type = "application"
|
|
15
|
+
license = "LicenseRef-NVIDIA-CUDA"
|
|
16
|
+
settings = "os", "arch"
|
|
17
|
+
options = {
|
|
18
|
+
"mode": ["redist", "system"],
|
|
19
|
+
"compiler": [True, False],
|
|
20
|
+
"nvrtc": [True, False],
|
|
21
|
+
"cuobjdump": [True, False],
|
|
22
|
+
}
|
|
23
|
+
default_options = {"mode": "redist", "compiler": True, "nvrtc": False, "cuobjdump": False}
|
|
24
|
+
exports_sources = "redist.json"
|
|
25
|
+
|
|
26
|
+
def validate(self):
|
|
27
|
+
if str(self.settings.os) not in ("Linux", "Windows") or self.settings.arch != "x86_64":
|
|
28
|
+
raise ConanInvalidConfiguration("The CUDA recipe supports Linux/Windows x86_64 only")
|
|
29
|
+
|
|
30
|
+
def _system_root(self):
|
|
31
|
+
root = self.conf.get("user.cuda:root", check_type=str)
|
|
32
|
+
if not root or not Path(root).is_absolute():
|
|
33
|
+
raise ConanInvalidConfiguration("Pass an absolute toolkit path as -c:b user.cuda:root=...")
|
|
34
|
+
return root
|
|
35
|
+
|
|
36
|
+
def _manifest(self):
|
|
37
|
+
return json.loads(Path(self.source_folder, "redist.json").read_text())
|
|
38
|
+
|
|
39
|
+
def _components(self):
|
|
40
|
+
components = ["cuda_cudart", "cuda_crt"]
|
|
41
|
+
if self.options.compiler:
|
|
42
|
+
components.extend(["cuda_cccl", "cuda_nvcc", "libnvvm"])
|
|
43
|
+
if self.options.nvrtc:
|
|
44
|
+
components.append("cuda_nvrtc")
|
|
45
|
+
if self.options.cuobjdump:
|
|
46
|
+
components.append("cuda_cuobjdump")
|
|
47
|
+
return components
|
|
48
|
+
|
|
49
|
+
def build(self):
|
|
50
|
+
if self.options.mode == "system":
|
|
51
|
+
root = Path(self._system_root())
|
|
52
|
+
windows = self.settings.os == "Windows"
|
|
53
|
+
nvcc = "bin/nvcc.exe" if windows else "bin/nvcc"
|
|
54
|
+
required = [
|
|
55
|
+
"include/cuda_runtime.h",
|
|
56
|
+
"include/crt/host_config.h",
|
|
57
|
+
"lib/x64/cudart_static.lib" if windows else "lib64/libcudart_static.a",
|
|
58
|
+
]
|
|
59
|
+
if self.options.compiler:
|
|
60
|
+
required.extend([nvcc, "nvvm/libdevice/libdevice.10.bc"])
|
|
61
|
+
if self.options.nvrtc:
|
|
62
|
+
required.extend([
|
|
63
|
+
"include/nvrtc.h",
|
|
64
|
+
"lib/x64/nvrtc.lib" if windows else "lib64/libnvrtc.so",
|
|
65
|
+
])
|
|
66
|
+
if self.options.cuobjdump:
|
|
67
|
+
required.append("bin/cuobjdump.exe" if windows else "bin/cuobjdump")
|
|
68
|
+
missing = [name for name in required if not (root / name).is_file()]
|
|
69
|
+
if missing:
|
|
70
|
+
raise ConanInvalidConfiguration(
|
|
71
|
+
f"The supplied toolkit root lacks required CUDA SDK files: {root}: {', '.join(missing)}"
|
|
72
|
+
)
|
|
73
|
+
if self.options.compiler:
|
|
74
|
+
self.run(f'"{root / nvcc}" --version')
|
|
75
|
+
return
|
|
76
|
+
manifest = self._manifest()
|
|
77
|
+
verified = Path(self.build_folder, manifest["manifest"])
|
|
78
|
+
download(self, manifest["base_url"] + manifest["manifest"], str(verified))
|
|
79
|
+
check_sha256(self, str(verified), manifest["manifest_sha256"])
|
|
80
|
+
upstream = json.loads(verified.read_text())
|
|
81
|
+
platform = "windows-x86_64" if self.settings.os == "Windows" else "linux-x86_64"
|
|
82
|
+
for name in self._components():
|
|
83
|
+
item = manifest["components"][name][platform]
|
|
84
|
+
if item != upstream.get(name, {}).get(platform):
|
|
85
|
+
raise ConanInvalidConfiguration(f"The pinned {name} entry differs from NVIDIA's verified manifest")
|
|
86
|
+
for name in self._components():
|
|
87
|
+
item = manifest["components"][name][platform]
|
|
88
|
+
folder = os.path.join(self.build_folder, name)
|
|
89
|
+
get(
|
|
90
|
+
self,
|
|
91
|
+
url=manifest["base_url"] + item["relative_path"],
|
|
92
|
+
sha256=item["sha256"],
|
|
93
|
+
destination=folder,
|
|
94
|
+
strip_root=True,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def package(self):
|
|
98
|
+
if self.options.mode == "system":
|
|
99
|
+
return
|
|
100
|
+
for name in self._components():
|
|
101
|
+
folder = os.path.join(self.build_folder, name)
|
|
102
|
+
copy(self, "*", src=folder, dst=self.package_folder, excludes=("LICENSE*",))
|
|
103
|
+
copy(self, "LICENSE*", src=folder, dst=os.path.join(self.package_folder, "licenses", name))
|
|
104
|
+
# The Linux nvcc profile searches lib64; component archives use lib.
|
|
105
|
+
if self.settings.os == "Linux":
|
|
106
|
+
Path(self.package_folder, "lib64").symlink_to("lib", target_is_directory=True)
|
|
107
|
+
# FindCUDAToolkit can identify a runtime-only SDK without invoking nvcc.
|
|
108
|
+
Path(self.package_folder, "version.json").write_text(
|
|
109
|
+
json.dumps({"cuda": {"version": self._manifest()["components"]["cuda_cudart"]["version"]}}) + "\n"
|
|
110
|
+
)
|
|
111
|
+
copy(self, "redist.json", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
|
|
112
|
+
|
|
113
|
+
def package_info(self):
|
|
114
|
+
root = self._system_root() if self.options.mode == "system" else self.package_folder
|
|
115
|
+
self.cpp_info.set_property("cmake_find_mode", "none")
|
|
116
|
+
self.conf_info.define("user.cuda:root", root.replace("\\", "/"))
|
|
117
|
+
if self.options.compiler or self.options.cuobjdump:
|
|
118
|
+
self.buildenv_info.prepend_path("PATH", os.path.join(root, "bin"))
|
|
119
|
+
else:
|
|
120
|
+
self.cpp_info.bindirs = []
|
|
121
|
+
if self.options.compiler:
|
|
122
|
+
self.buildenv_info.define_path(
|
|
123
|
+
"CUDACXX", os.path.join(root, "bin", "nvcc.exe" if self.settings.os == "Windows" else "nvcc")
|
|
124
|
+
)
|
|
125
|
+
self.buildenv_info.define_path("CUDAToolkit_ROOT", root)
|