Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions ASSET_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,29 @@ with the rest of the project:
- `families/openfold3/tests/data/openfold3_features.npz`
- `families/openfold3/tests/data/openfold3_structure.json`

## HSTU native-provider license copies

The [HSTU third-party notice](families/hstu/third_party/NOTICE.txt) records
attribution for the optional native attention provider. Its accompanying
license files preserve the full upstream terms. The kernel sources are
obtained separately at build time and verified against
`native_attention_source.json`.

- `FBGEMM.LICENSE.txt` and `HSTU.LICENSE.txt`: verbatim BSD license files from
[FBGEMM revision 43791a0ade113a0ad5530c2a4948870dd0f7e417](https://github.com/pytorch/FBGEMM/tree/43791a0ade113a0ad5530c2a4948870dd0f7e417).
- `CUTLASS.LICENSE.txt`: verbatim license from its pinned
[CUTLASS revision 571edeb2d0ac872a8392fc49285b156b07884b4e](https://github.com/jwfromm/cutlass/tree/571edeb2d0ac872a8392fc49285b156b07884b4e).
The compiled C++ headers use BSD-3-Clause; the separate Python CuTeDSL
exception in this license does not apply to those headers.
- `CCCL.LICENSE.txt`: verbatim [CCCL 3.3.3 license](https://github.com/NVIDIA/cccl/blob/v3.3.3/LICENSE),
including CUB's BSD terms and Thrust/libcu++ notices. These headers come from
the installed CUDA development toolkit.
- `NOTICE.txt`: source attribution and dependency boundaries. The builder
combines this text with the full licenses into `attention_native.NOTICE`
whenever it embeds the native attention library in a model bundle.

This source distribution contains no third-party HSTU model weights or
prebuilt native provider libraries. Users supply their own model checkpoints
and the separately licensed CUDA, TensorRT and cuBLAS runtime dependencies.

<!-- Collaborative review anchor: batch 2. -->
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ set(TRTMC_CUDA_INCLUDE_DIR ${CUDAToolkit_INCLUDE_DIRS})
set(TRTMC_CUDART_LIBRARY CUDA::cudart)

add_library(trtmc_core SHARED
core/runtime/cache/history_cache.cpp
core/runtime/bundle/bundle_format.cpp
core/runtime/primitives/cuda_common.cpp
core/runtime/primitives/device_tensor.cpp
Expand Down Expand Up @@ -455,6 +456,12 @@ if(TRTMC_BUILD_EXAMPLES)
endif()

if(TRTMC_BUILD_TESTS)
add_executable(test_history_cache core/runtime/tests/test_history_cache.cpp)
target_link_libraries(test_history_cache PRIVATE trtmc_core)
target_compile_options(test_history_cache PRIVATE -Wall -Wextra -Wpedantic)
add_test(NAME history_cache COMMAND test_history_cache)
set_tests_properties(history_cache PROPERTIES LABELS cpu)

add_executable(test_bundle_format_v1 core/runtime/tests/test_bundle_format_v1.cpp)
target_include_directories(test_bundle_format_v1 PRIVATE ${PROJECT_SOURCE_DIR}/core)
target_link_libraries(test_bundle_format_v1 PRIVATE trtmc_core)
Expand Down Expand Up @@ -552,6 +559,17 @@ if(TRTMC_BUILD_TESTS)
LIBRARY_OUTPUT_DIRECTORY "${_trtmc_test_runtime_root}"
)

add_library(trtmc_test_backend_fake_trt SHARED core/runtime/tests/fake_backend.cpp)
target_include_directories(trtmc_test_backend_fake_trt PRIVATE
${PROJECT_SOURCE_DIR}/core/runtime/include
)
target_link_libraries(trtmc_test_backend_fake_trt PRIVATE CUDA::cudart)
target_compile_definitions(trtmc_test_backend_fake_trt PRIVATE TRTMC_FAKE_BACKEND_NAME="trt")
set_target_properties(trtmc_test_backend_fake_trt PROPERTIES
OUTPUT_NAME trtmc_backend_trt
LIBRARY_OUTPUT_DIRECTORY "${_trtmc_test_runtime_root}"
)

add_library(trtmc_test_family_fake SHARED core/runtime/tests/fake_family.cpp)
target_include_directories(trtmc_test_family_fake PRIVATE ${PROJECT_SOURCE_DIR}/core/runtime/include)
target_link_libraries(trtmc_test_family_fake PRIVATE trtmc_core)
Expand All @@ -571,6 +589,7 @@ if(TRTMC_BUILD_TESTS)
add_dependencies(test_family_loader
trtmc_test_backend_fake
trtmc_test_backend_fake_rtx
trtmc_test_backend_fake_trt
trtmc_test_family_fake
)
add_custom_command(TARGET test_family_loader POST_BUILD
Expand Down
1 change: 1 addition & 0 deletions apps/task_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ inline bool uses_existing_task_runtime(std::string_view primary_task) noexcept {
ISpeechToolSessionProvider::kTask,
IEmbedding::kTask,
IEncoding::kTask,
IRecommendation::kTask,
IReranking::kTask,
ISegmentation::kTask,
IPointPromptedSegmentation::kTask,
Expand Down
34 changes: 31 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import json
import os
import shutil
import stat
import subprocess
from pathlib import Path
Expand Down Expand Up @@ -44,6 +45,34 @@ def _make_executable(path: Path) -> None:
path.chmod(path.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)


def _package_native_commands(build: Path, destinations: tuple[Path, ...]) -> None:
"""Ship root-level native commands, including family-owned trtmc-* binaries."""
commands = [build / "trtmc"]
commands.extend(
path for path in sorted(build.glob("trtmc-*")) if not path.suffix and not path.is_dir()
)
for command in commands:
try:
mode = command.lstat().st_mode
if not stat.S_ISREG(mode) or not mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH):
raise ConanException(f"native command is not a regular executable: {command}")
with command.open("rb") as source:
if source.read(4) != b"\x7fELF":
raise ConanException(f"native command is not an ELF executable: {command}")
for directory in destinations:
directory.mkdir(parents=True, exist_ok=True)
target = directory / command.name
if target.exists() or target.is_symlink():
raise ConanException(f"duplicate native command destination: {target}")
# Copy this exact build output; recursive basename matching can
# otherwise replace it with a nested target of the same name.
shutil.copy2(command, target)
_make_executable(target)
_set_runpath(target, "$ORIGIN")
except OSError as error:
raise ConanException(f"cannot package native command {command}: {error}") from error


class TensorRTModelConnectConan(ConanFile):
name = "tensorrt-model-connect"
version = "0.1.0"
Expand Down Expand Up @@ -91,8 +120,7 @@ def package(self) -> None:
],
check=True,
)
copy(self, "trtmc", src=str(build), dst=str(module_bin), keep_path=False)
copy(self, "trtmc-server", src=str(build), dst=str(module_bin), keep_path=False)
_package_native_commands(build, (module_bin,))
for library in ("libtrtmc_core.so", "libtrtmc_runtime.so"):
copy(self, library, src=str(build), dst=str(module_bin), keep_path=False)
copy(
Expand Down Expand Up @@ -196,7 +224,7 @@ def package(self) -> None:
):
raise ConanException("native runtime package is incomplete")

for executable in (native, native_server, benchmark_worker, dataset_benchmark):
for executable in (benchmark_worker, dataset_benchmark):
_make_executable(executable)
_set_runpath(executable, "$ORIGIN")
for library in shared_runtime:
Expand Down
Loading
Loading