Skip to content

Version 4.1.0 Release

Choose a tag to compare

@DavidMChan DavidMChan released this 25 Nov 22:03
· 5 commits to main since this release
dab96a9

4.1.0 adds a HIP build for AMD GPUs and fixes a crash on small clusters. The wheels now carry native code for current NVIDIA GPUs.

New

  • AMD GPUs via HIP (#145, thanks @jeffdaily). Build from source with -DUSE_HIP=ON against a ROCm build of FAISS; see Building for AMD GPUs. The contributor ran the test suite on an MI250X (gfx90a), a Radeon gfx1201 and a Radeon 8060S (gfx1151, Windows 11). The HIP build also works on Windows with the ROCm SDK. There are no prebuilt ROCm wheels or conda packages yet.
  • Tests. GPU unit tests build with -DBUILD_TESTS=ON and run with ctest. Embedding-quality checks are in tsnecuda/test and need scikit-learn and pytest.

Fixes

  • fit_transform crashed with an illegal memory access, or returned NaN, when a cluster had fewer points than num_neighbors, for example num_neighbors=1024 on a small clustered dataset (#143, fixed in #146).
  • ReduceMean along axis 1 divided by the wrong dimension. It doesn't affect t-SNE results (#144, fixed in #147).
  • A plain cmake .. build compiled only for sm_52 (sm_75 with CUDA 13), because CMake filled in nvcc's default architecture before tsne-cuda's own list could apply. The 4.0.x wheels were built this way, so every GPU compiled the kernels from PTX on first load. Builds now use the list unless CMAKE_CUDA_ARCHITECTURES is set (#148).

Install

conda install -c conda-forge tsnecuda (Linux, CUDA 12.9 and 13.x) installs FAISS and the CUDA libraries for you.

The wheels below are py3-none-any and work with any Python 3. They don't include FAISS or the CUDA libraries, and each one must be paired with the FAISS version it was built against, because FAISS's C++ ABI changes between releases. The 4.0.1 notes said to run conda install -c conda-forge libfaiss; that now installs FAISS 1.14.3, which the cu118 to cu129 wheels can't load. Use the pins below.

Wheel Native code for Runtime libraries from conda-forge
tsnecuda-4.1.0+cu118 sm_52 to sm_86 (Maxwell to Ampere) "libfaiss=1.9.0=*cuda118*"
tsnecuda-4.1.0+cu124 sm_70 to sm_90 (Volta to Hopper) "libfaiss=1.9.0=*cuda126*" libcufft libcusparse
tsnecuda-4.1.0+cu126 sm_70 to sm_90 (Volta to Hopper) "libfaiss=1.9.0=*cuda126*" libcufft libcusparse
tsnecuda-4.1.0+cu129 sm_70 to sm_120 (Volta to Blackwell) "libfaiss=1.9.0=*cuda126*" libcufft libcusparse
tsnecuda-4.1.0+cu130 sm_75 to sm_120 (Turing to Blackwell) "libfaiss=1.14.3=*cuda130*" libcufft libcusparse

Each wheel also carries PTX (compute_80 in cu118, compute_90 in cu124 and cu126, compute_120 in cu129 and cu130), so newer GPUs compile the kernels on first use. The CUDA 12 and 13 wheels don't support Maxwell or Pascal; use the cu118 wheel or a source build for those GPUs.

conda create -n tsnecuda -c conda-forge python=3.12 "libfaiss=1.9.0=*cuda126*" libcufft libcusparse
conda activate tsnecuda
pip install https://github.com/CannyLab/tsne-cuda/releases/download/4.1.0/tsnecuda-4.1.0+cu129-py3-none-any.whl
conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib
conda activate tsnecuda

The library finds FAISS and the CUDA libraries through LD_LIBRARY_PATH, which the conda env config vars line sets at activation. The wheels are also on the pip index: pip install tsnecuda==4.1.0+cu129 -f https://tsnecuda.isx.ai/tsnecuda_stable.html.

Validation

I installed each wheel into a clean conda environment that held only the runtime libraries in its row above, then ran it on an RTX 4090 (sm_89). tsnecuda.test() and the pytest suite (9 tests) passed for all five wheels. The conda-forge package (CUDA 12.9, FAISS 1.14.3) passed the same suite.

The HIP build compiles and links for gfx90a, gfx942, gfx1100, gfx1151 and gfx1201 with ROCm 7.2.4. It wasn't run on AMD hardware here; the contributor's results are in #145.

File SHA-256
tsnecuda-4.1.0+cu118-py3-none-any.whl c1d64644f913a6078edf0378f34396ae3597d00227da227b54c4df84568ae770
tsnecuda-4.1.0+cu124-py3-none-any.whl 86aa6a879c926700c2d851ef85ae02e6ae33b3dd9e2865bc5a11e9ba588c9ccf
tsnecuda-4.1.0+cu126-py3-none-any.whl 4f01e72d6c56dd34bba4aa53b222942d121f81aac6d646526cfd5c2ec9fd6d41
tsnecuda-4.1.0+cu129-py3-none-any.whl 9e28706012f266c7cbcc38fde8b172b8e0157c87869d0f83ff18d1a93acb20b4
tsnecuda-4.1.0+cu130-py3-none-any.whl 3cf8f1e0b639f5cf6e7b704cee6709e3d8ea75eccc5befc8d4dc6695434111d6