Skip to main content
# Scikit-Learn SIMD DistanceMetrics (SLSDM)

## Install from pip
Run `pip install slsdm`. Note that the premade wheels are only built with support for `SSE2, SSE3` instructions.

## Install From Source:

1. Create a new environment with `xsimd`: `conda create -n <env_name> -c conda-forge python~=3.10.0 compilers`
2. Activate the environment: `conda activate <env_name>`
3. Run `pip install -e .`

**Warning**: At this point, building from source only works with `gcc`. Support for `clang` and `MSVC` is in progress.

## Specify SIMD Target Architectures

By default, `slsdm` will be built with `{SSE3, SSE2}` support. The preferred architectures can be specified at build time using the `SLSDM_SIMD_ARCH` environment variable by passing a comma-separated list of architecture specification tokens. Currently, only `x86_64` CPU features are supported. Specifically, the following features are available:
```
Instruction Set | Specification Tokens
======================================
AVX512BW | avx512bw
AVX512DQ | avx512dq
AVX512CD | avx512cd
AVX512F | avx512f
FMA4 | fma4
FMA3 + AVX2 | fma3, avx2
AVX2 | avx2
FMA3 + AVX | fma3, avx
AVX | avx
FMA3 + SSE4.2 | fma3, sse4_2
SSE4.2 | sse4_2
SSE4.1 | sse4_1
SSSE3 | ssse3
SSE3 | sse3
SSE2 | sse2
```

For example, to build for `{SSE3, AVX, FMA 3 + AVX, AVX2}` one would specify `SLSDM_SIMD_ARCH="sse3, avx, fma3<xs::avx>, avx2"`.

You may also prefer to specify features *up to*, and optionally including, a certain instruction. For that, you may prepend a specification token with `<` (exclusive) or `<=` (inclusive). For example, to build for `{SSE2, SSE3, SSSE3, AVX2}` one would specify `SLSDM_SIMD_ARCH="<=ssse3, avx2"`.

You can also disable specific features that would otherwise be enabled by your specification by prepending the `~` symbol to the specification token. For example, to build for `{SSE4_2, SSE4_1, SSE3, SSE2}`, one would specify `SLSDM_SIMD_ARCH="<=sse4_2, !ssse3"`. Note that the specification will be resolved in a left-to-right order, so `SLSDM_SIMD_ARCH="!ssse3, <=sse4_2"` would not produce equivalent results, and indeed still generates `SSSE3` instructions.

To include `FMA3` combination instruction sets, include `fma3` in the `SLSDM_SIMD_ARCH` specification and any compatible instruction sets will automatically be enabled. For example, `SLSDM_SIMD_ARCH="fma3, <=avx"` will enable `{FMA3 + AVX, AVX, FMA3 + SSE4.2, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2}`.

**Warning**: Runtime dispatch is not yet correctly supported. When distributing to other machines, please build only with SIMD sets that all target machines support.

Metadata

Release files for slsdm 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slsdm 0.2.1
File Size Uploaded Provenance Actions
slsdm-0.2.1.tar.gz 14.4 kB Without provenance Details for slsdm-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for slsdm 0.2.1
File Actions
slsdm-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for slsdm-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
slsdm-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details for slsdm-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl
slsdm-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for slsdm-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
slsdm-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details for slsdm-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
slsdm-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for slsdm-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
slsdm-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details for slsdm-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
slsdm-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details for slsdm-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
slsdm-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details for slsdm-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl

Total release size: 9.4 MB

Release files / slsdm-0.2.1.tar.gz

Download URL slsdm-0.2.1.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3e8362f71ac85648230ab4786b0a13ce966daa0a0d027342fdbaf752027bdf17
BLAKE2b-256 checksum
How to use checksums
a1ddaccc6a992ef6f75904242fc579ebefb2bfb0e934b04a232b24780a94e21e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL slsdm-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8689398d2ab28f4adba0729f3fada71cf57045f9ef2ee3971f955661fa9455c7
BLAKE2b-256 checksum
How to use checksums
66d680d9cbebb533d57fa841359ef3445b609a0702da7f489e9d5180edf6ed19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl

Download URL slsdm-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl
Size 185.9 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c3a1bb067c37dfa7f5206dface0bc08c69aa2c6dcdbe275a7978c14e2b4c44c1
BLAKE2b-256 checksum
How to use checksums
da30f4457d29606785c2de088d5e5b30062f16416fb76366f5e6ae12209ea754
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL slsdm-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
c59f9d1667d91a2df9559d3a0352da432fea8f15871a280fcf44fd9fb2877048
BLAKE2b-256 checksum
How to use checksums
770db4546398cf3863b595a0986f8b7cac5dfb82fc88d54681742c62d8f8407d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl

Download URL slsdm-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
Size 185.1 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
afcef34b58440e5b6309a761bc152c1898c49c16fb7938701cc17ca593a24aaf
BLAKE2b-256 checksum
How to use checksums
58590c3183abe70e5b3b4c9bd4ebd6a9a2292dc8a746700380cb02e83d160dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL slsdm-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
35074e2db01b8eb54192aab4ac9e64b68b1dfd902077467cb2b6cd2a87c7509d
BLAKE2b-256 checksum
How to use checksums
565f2471777761bb16779f5841e4f85e3cc3e70c48891cc12879208a5250b320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL slsdm-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 186.1 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
03bb6f3a31d33fce10f226f047e3ca4fb5220df1ac270a7afab3324c6b23b298
BLAKE2b-256 checksum
How to use checksums
a603c444207bf662431fabb31e5c48b1baa91f67c1b317f7945762309cb551d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL slsdm-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.2 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
14b20fce8b222bf82675786c51cc50ab9ef545e01a9abe1ef10e7578be596e66
BLAKE2b-256 checksum
How to use checksums
2fdc616d82af73af115d37b049b0375edb9f2a1cafc88062e70e0668cc6262a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / slsdm-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL slsdm-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Size 184.6 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
0f746399586a1d116956778961e42e57a5aeea1a03d122aa6f232170f506c0a6
BLAKE2b-256 checksum
How to use checksums
e72182f718eaa998b1291a76d6e49e27d9ab9a2368019a9f516433ff8a64ad66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for slsdm 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page