Skip to content
Merged
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ else()
# - Prepare rapids-cmake -----------------------------------------------------
set(rapids-cmake-version 26.08)
file(DOWNLOAD
https://raw.githubusercontent.com/rapidsai/rapids-cmake/691ccac03770627311b271e9dc5820f6ea2b6346/RAPIDS.cmake
https://raw.githubusercontent.com/rapidsai/rapids-cmake/refs/tags/v26.08.00/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(rapids-cmake)
Expand Down
2 changes: 1 addition & 1 deletion cmake/thirdparty/get_cuml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ endfunction()
# CPM_raft_SOURCE=/path/to/local/raft
find_and_configure_cuml(VERSION 26.08
FORK rapidsai
PINNED_TAG 91d972563e5f7994c3fa57d1cd7d5d6e4caefd4f
PINNED_TAG 265b9da6a0e75dbef071a3168398b993a5ff6f0e
USE_TREELITE_STATIC ${TRITON_FIL_USE_TREELITE_STATIC}
)
3 changes: 2 additions & 1 deletion cmake/thirdparty/get_nvforest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function(find_and_configure_nvforest)
GIT_REPOSITORY https://github.com/${PKG_FORK}/nvforest.git
GIT_TAG ${PKG_PINNED_TAG}
SOURCE_SUBDIR cpp
PATCHES "./patches/nvforest.patch"
OPTIONS
"BUILD_NVFOREST_TESTS OFF"
"BUILD_SHARED_LIBS ON"
Expand All @@ -42,7 +43,7 @@ endfunction()

find_and_configure_nvforest(VERSION 26.08
FORK rapidsai
PINNED_TAG dd49f1a906654f59f20023849b2f1cae820f601f
PINNED_TAG cef3a50da0f74b0015876b9d6d424c86141898dc
USE_TREELITE_STATIC ${TRITON_FIL_USE_TREELITE_STATIC}
ENABLE_GPU ${TRITON_ENABLE_GPU}
)
40 changes: 40 additions & 0 deletions cmake/thirdparty/patches/nvforest.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 60c8df5adef69291d4978b4631d58b2ab9ac6429 Mon Sep 17 00:00:00 2001
From: Hyunsu Cho <phcho@nvidia.com>
Date: Tue, 4 Aug 2026 03:06:43 -0700
Subject: [PATCH] Check raft_handle_ for nullptr

---
cpp/include/nvforest/handle.hpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/cpp/include/nvforest/handle.hpp b/cpp/include/nvforest/handle.hpp
index fd1f3bb..42066c8 100644
--- a/cpp/include/nvforest/handle.hpp
+++ b/cpp/include/nvforest/handle.hpp
@@ -18,14 +18,20 @@ struct handle_t {
handle_t(raft::handle_t const& raft_handle) : raft_handle_{&raft_handle} {}
auto get_next_usable_stream() const
{
+ if (!raft_handle_) { return cuda_stream{}; }
return cuda_stream{raft_handle_->get_next_usable_stream().value()};
}
- auto get_stream_pool_size() const { return raft_handle_->get_stream_pool_size(); }
+ auto get_stream_pool_size() const {
+ if (!raft_handle_) { return std::size_t{}; }
+ return raft_handle_->get_stream_pool_size();
+ }
auto get_usable_stream_count() const { return std::max(get_stream_pool_size(), std::size_t{1}); }
void synchronize() const
{
- raft_handle_->sync_stream_pool();
- raft_handle_->sync_stream();
+ if (raft_handle_) {
+ raft_handle_->sync_stream_pool();
+ raft_handle_->sync_stream();
+ }
}

private:
--
2.43.0

6 changes: 3 additions & 3 deletions conda/environments/triton_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ channels:
- nvidia
- rapidsai
dependencies:
- cuda-version=12.8
- cudf=26.06
- cuda-version=13.3
- cuda-python=13.3
- cudf=26.08
- libcusolver
- libcusparse
- matplotlib
Expand All @@ -15,4 +16,3 @@ dependencies:
- pip:
- tritonclient[all]
- protobuf
- git+https://github.com/rapidsai/rapids-triton.git@branch-25.08#subdirectory=python
9 changes: 5 additions & 4 deletions conda/environments/triton_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ channels:
dependencies:
- aws-sdk-cpp
- clang-tools=19.1.7
- cuda-version=12.8
- cudf=26.06
- cuml=26.06
- cuda-version=13.3
- cuda-python=13.3
- cudf=26.08
- cuml=26.08
- nvforest=26.08
- flake8
- hypothesis
- lightgbm
Expand All @@ -23,4 +25,3 @@ dependencies:
- pip:
- tritonclient[all]
- protobuf
- git+https://github.com/rapidsai/rapids-triton.git@branch-25.08#subdirectory=python
8 changes: 5 additions & 3 deletions conda/environments/triton_test_no_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ channels:
dependencies:
- aws-sdk-cpp
- clang-tools=19.1.7
- cuda-version=12.8
- cudf=26.06
- cuml=26.06
- cuda-version=13.3
- cuda-python=13.3
- cudf=26.08
- cuml=26.08
- nvforest=26.08
- flake8
- hypothesis
- lightgbm
Expand Down
17 changes: 9 additions & 8 deletions ops/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Arguments for controlling build details
###########################################################################################
# Version of Triton to use
ARG TRITON_VERSION=26.06
ARG TRITON_VERSION=26.07
# Base container image
ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-py3
# Whether or not to enable GPU build
Expand Down Expand Up @@ -64,8 +64,9 @@ RUN conda run --no-capture-output -n triton_test \
&& rm -r /sdk_install

FROM wheel-install-${USE_CLIENT_WHEEL} as conda-test
COPY ./rapids_triton_python /workspace/rapids_triton_python
RUN conda run --no-capture-output -n triton_test \
pip install git+https://github.com/rapidsai/rapids-triton.git@v26.06.00#subdirectory=python
pip install /workspace/rapids_triton_python
RUN conda-pack --ignore-missing-files -n triton_test -o /tmp/env.tar \
&& mkdir /conda/test/ \
&& cd /conda/test/ \
Expand Down Expand Up @@ -100,16 +101,16 @@ RUN apt-get update \
# Stage immediately before building; useful for build iteration
FROM base as build-prep

RUN mkdir -p /rapids_triton/build /rapids_triton/install
RUN mkdir -p /workspace/build /workspace/install

COPY ./src /rapids_triton/src
COPY ./CMakeLists.txt /rapids_triton
COPY ./cmake /rapids_triton/cmake
COPY ./src /workspace/src
COPY ./CMakeLists.txt /workspace
COPY ./cmake /workspace/cmake

ARG BACKEND_NAME=fil
ENV BACKEND_NAME=$BACKEND_NAME

WORKDIR /rapids_triton/build
WORKDIR /workspace/build

# Remove potentially stale build artifacts
RUN if [ -d /opt/tritonserver/backends/${BACKEND_NAME} ]; \
Expand Down Expand Up @@ -172,7 +173,7 @@ RUN source /conda/dev/bin/activate \
-DTRITON_ENABLE_STATS="${TRITON_ENABLE_STATS}" \
-DRAPIDS_DEPENDENCIES_VERSION="${RAPIDS_DEPENDENCIES_VERSION}" \
-DTRITON_FIL_USE_TREELITE_STATIC="${TRITON_FIL_USE_TREELITE_STATIC}" \
-DCMAKE_INSTALL_PREFIX=/rapids_triton/install \
-DCMAKE_INSTALL_PREFIX=/workspace/install \
..;

ENV CCACHE_DIR=/ccache
Expand Down
20 changes: 14 additions & 6 deletions qa/L0_e2e/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@
from functools import lru_cache

try:
import cuml
import nvforest
except Exception:
cuml = None
nvforest = None
try:
from cupy import asnumpy
except Exception:

def asnumpy(x):
return x


import numpy as np
import pytest
import treelite
Expand Down Expand Up @@ -199,20 +207,20 @@ def __init__(
with open(model_path, "rb") as pkl_file:
self._base_model = pickle.load(pkl_file)
else:
self._base_model = cuml.ForestInference.load(
model_path, is_classifier=is_classifier, model_type=model_format
self._base_model = nvforest.load_model(
model_file=model_path, model_type=model_format
)

def predict(self, inputs):
if self.predict_proba:
result = self._base_model.predict_proba(inputs["input__0"])
result = asnumpy(self._base_model.predict_proba(inputs["input__0"]))
if len(result.shape) == 1 or (
len(result.shape) == 2 and result.shape[1] == 1
):
result = result.reshape((-1, 1))
result = np.concatenate((1 - result, result), axis=1)
else:
result = self._base_model.predict(inputs["input__0"])
result = asnumpy(self._base_model.predict(inputs["input__0"]))
output = {"output__0": result.squeeze()}
if self._run_treeshap:
treeshap_result = self._xgb_model.predict(
Expand Down
3 changes: 3 additions & 0 deletions rapids_triton_python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
16 changes: 16 additions & 0 deletions rapids_triton_python/rapids_triton/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from rapids_triton.client import Client
from rapids_triton.logging import logger
Loading
Loading