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
33 changes: 20 additions & 13 deletions ci/test_wheel_integrations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ source rapids-init-pip

LIBCUML_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuml cuml --cuda "$RAPIDS_CUDA_VERSION")")
CUML_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_python cuml cuml --stable --cuda "$RAPIDS_CUDA_VERSION")")
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
mkdir -p "${RAPIDS_TESTS_DIR}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RAPIDS_TESTS_DIR isn't used anywhere in this script, it can be removed.


EXITCODE=0
trap "EXITCODE=1" ERR
Expand All @@ -20,16 +18,19 @@ set +e
#
rapids-logger "===== Testing BERTopic Integration ====="

# Step 1: Install cuML wheels first (two-step workaround for issue #7374)
rapids-logger "Installing cuML wheels"
rapids-logger "Generating testing dependencies"
rapids-dependency-file-generator \
--output requirements \
--file-key test_integration_bertopic \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" \
| tee ./requirements.txt

rapids-logger "Installing cuML, BERTopic, and dependencies"
rapids-pip-retry install \
--prefer-binary \
"${LIBCUML_WHEELHOUSE}"/libcuml*.whl \
"${CUML_WHEELHOUSE}"/cuml*.whl

# Step 2: Install BERTopic
rapids-logger "Installing BERTopic"
rapids-pip-retry install --prefer-binary bertopic
"${CUML_WHEELHOUSE}"/cuml*.whl \
-r ./requirements.txt

# Test 1: Verify imports
rapids-logger "Testing imports"
Expand All @@ -48,6 +49,9 @@ warnings.filterwarnings('ignore')
import random
from bertopic import BERTopic

from cuml.cluster import HDBSCAN
from cuml.manifold import UMAP

# Generate synthetic documents with topic-like word clusters
random.seed(42)
topics = [
Expand All @@ -62,11 +66,14 @@ for i in range(100):
doc = ' '.join(random.choices(topic_words, k=random.randint(10, 30)))
docs.append(doc)

# Initialize BERTopic with cuML UMAP backend
# BERTopic will automatically use cuML's UMAP if available
topic_model = BERTopic(verbose=False, calculate_probabilities=False)
hdbscan_model = HDBSCAN(min_samples=10, gen_min_span_tree=True, prediction_data=True)
umap_model = UMAP(n_components=5, n_neighbors=15, min_dist=0.0)

topic_model = BERTopic(verbose=False,
calculate_probabilities=False,
hdbscan_model=hdbscan_model,
umap_model=umap_model)

# Fit the model
topics, probs = topic_model.fit_transform(docs)

print(f'✓ BERTopic smoke test passed - processed {len(docs)} documents, found {len(set(topics))} topics')
Expand Down
27 changes: 27 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ files:
- depends_on_libnvforest
- test_libcuml
- test_cpp
test_integration_bertopic:
output: none
includes:
- test_bertopic
test_python:
output: none
includes:
Expand Down Expand Up @@ -547,6 +551,29 @@ dependencies:
- matrix:
packages:
- python>=3.11
test_bertopic:
common:
- output_types: requirements
packages:
- bertopic>=0.17.4
specific:
# The 'pytorch.org' indices referenced in --extra-index-url below host CPU-only variants too,
# so requirements like '>=' are not safe.
#
# Using '==' and a version with the CUDA specifier like '+cu132' is the most reliable way to ensure
# the packages we want are pulled (at the expense of needing to maintain this list).
- output_types: requirements
matrices:
- matrix:
cuda: "12.*"
packages:
- --extra-index-url=https://download.pytorch.org/whl/cu129
- torch==2.10.0+cu129
- matrix:
cuda: "13.*"
packages:
- --extra-index-url=https://download.pytorch.org/whl/cu132
- torch==2.12.1+cu132
Comment thread
coderabbitai[bot] marked this conversation as resolved.
test_libcuml:
common:
- output_types: conda
Expand Down
Loading