Scan your whole stack
Are you using emeans-rocm?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.2.8
emeans-rocm was last scanned on 27 Nov 2026 at version 0.2.8. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.2.8 LATEST | 27 Nov 2026 | No rules fired |
| 0.2.7 | 27 Nov 2026 | No rules fired |
| 0.2.6 | 26 Nov 2026 | No rules fired |
| 0.2.5 | 23 Nov 2026 | Not shown |
| 0.2.4 | 23 Nov 2026 | Not shown |
Findings for v0.2.8. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.2.8; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
AMD GPU (ROCm) support for e-means, the mini-batch k-means in
faiss contrib/e_means. The goal is that Emeans(d, k).train(x) runs on AMD GPUs through the
fast Triton kernels, as it does on NVIDIA, with NVIDIA results unchanged.
Status: v0.2.8 released (tag
e-means-rocm-v0.2.8) for RX 9000 (gfx1200), installable withpip install emeans-rocm; synced with upstream faissb14b3d69. MI300X follows in v0.3. On an RX 9060 XT (gfx1200, ROCm 10.1) the defaultEmeans(d, k).train(x)uses Triton, every data format trains (FP32, FP16, BF16; INT8/UINT8 and FP8 throughQuantizedEmeans), the whole e-means test suite passes, and the rewritten kernels match PyTorch bit for bit in the numerics tests. Triton is 2.3× to 15× faster than PyTorch for BF16; FP16 is the fastest format here at 200k rows and INT8 at 1M and 4M rows (INT8 trains at 0.89× to 1.50× of BF16's speed, FP8 at 0.96× to 1.24× since v0.2.8; see Results). MI300X (gfx942) is planned for v0.3; MI350 (gfx950) and RX 7000 (gfx11xx) are compile-checked only. NVIDIA has not been re-run on hardware (see Known limitations).
Install a ROCm build of PyTorch and Triton in a fresh virtual environment, then the package
emeans-rocm from PyPI. For an RX 9000 card (gfx1200) on ROCm 10.1:
python3 -m venv ~/venvs/emeans-rocm && source ~/venvs/emeans-rocm/bin/activate
python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ \
"torch[device-gfx1200]==2.14.0+rocm10.1.0" # brings triton 3.8.0+rocm10.1.0
python -m pip install emeans-rocm
The wheel extra is named after the GPU target (device-gfx1200 here; rocminfo shows yours).
Install torch first: the package does not list it as a dependency, because pip would then
install the CUDA build from PyPI. The package pulls in faiss-cpu and numpy (in a conda
environment with faiss-gpu, install it with --no-deps to keep pip's faiss-cpu out). For the code on
main instead of the last release, use python -m pip install "emeans-rocm @ git+https://github.com/ogaude/e-means-rocm", or python -m pip install . from a clone.
The package's import name is emeans_rocm. It holds the same code as contrib/e_means and
sits next to the installed faiss, whose own faiss.contrib.e_means (upstream's, older copy)
it leaves alone:
import torch
from emeans_rocm import Emeans
x = torch.randn(200_000, 64, device="cuda") # "cuda" also means AMD on ROCm
em = Emeans(64, 1024)
centroids, labels = em.train(x)
print(em.recipe["assignment_backend"]) # expected: "triton" on a supported AMD GPU
INT8 and FP8 data go through QuantizedEmeans with an Int8Quantizer or Fp8Quantizer; see
the e-means README, whose examples import
faiss.contrib.e_means (read emeans_rocm with the package).
The tests, benchmarks and tools import faiss.contrib.e_means, as upstream's do. To work on
them, clone the repository (git clone https://github.com/ogaude/e-means-rocm && cd e-means-rocm), install torch as above and python -m pip install faiss-cpu numpy; inside a
clone, tools/gpu_session/setup.sh does the install and the next step for the detected target.
The faiss-cpu wheel ships its own, older copy of faiss/contrib/e_means, which would shadow
this repository. From the repository root, replace it with a symlink to the working tree (the
wheel's copy is kept aside):
C=$(python -c "import faiss.contrib, os; print(os.path.dirname(faiss.contrib.__file__))")
mv "$C/e_means" "$C/e_means.pypi-orig"
ln -s "$PWD/contrib/e_means" "$C/e_means"
python -c "import os, faiss.contrib.e_means as m; print(os.path.realpath(m.__file__))" # this repo
The example above then runs with from faiss.contrib.e_means import Emeans. Remove the
symlink before reinstalling or uninstalling faiss-cpu: pip follows it and can delete or
overwrite files in the clone.
python -m pip install -e . does not work: the package maps contrib/e_means onto
emeans_rocm at build time, which an editable install cannot do, so the build stops with an
error. Reinstall with python -m pip install . after changes, or work through the symlink.
| Family | Architecture | Example GPUs | FP32 / FP16 / BF16 | INT8 | FP8 (E4M3) |
|---|---|---|---|---|---|
| CDNA 3 | gfx942 | MI300X, MI325X | compile-checked; run and tuning in v0.3 (cloud) | compile-checked | refused (no native E4M3) |
| CDNA 4 | gfx950 | MI350 series | compile-checked | compile-checked | compile-checked |
| RDNA 3 | gfx11xx | RX 7000 series, RDNA 3.5 APUs | compile-checked | compile-checked | refused (no native E4M3) |
| RDNA 4 | gfx120x | RX 9000 series | runs, tuned (v0.1) | runs, tuned (v0.2) | runs, tuned (v0.2) |
"Compile-checked" means that every kernel configuration the launcher can pick for that target
compiles within its shared-memory (LDS) budget, checked by GPU-free tests
(torch_test_e_means_launch_config.py, torch_test_e_means_int8_compile.py), and is selected
automatically, but has not been run. They use the NVIDIA-fitted tile settings, except that INT8
gets a pipeline depth that fits the family's LDS, and gfx950 a 64-row tile and one split-K stage
(see Known limitations). Sibling chips
(gfx1101, gfx1201, ...) are matched by family. Other AMD GPUs fall back to native FP32 through
PyTorch, which upstream already supports.
Measured on an RX 9060 XT (16 GB), ROCm 10.1, torch 2.14.0+rocm10.1.0, triton 3.8.0, on
2026-11-27 (v0.2.8: upstream faiss b14b3d69, with cost-based cluster revival as the
default; Triton rows best of three rounds, PyTorch rows one round). Times are warm train() runs of 3 epochs on random FP32 data, converted to each format:
BF16 and FP16 by the default path during training, INT8 and FP8 by a calibrated quantizer before
timing (encoding not timed, as when data is stored encoded). "PyTorch" is
assignment_backend="native". tools/bench_train.py reproduces these runs; speed-ups below are
computed from the unrounded times.
| Data format | 200k × 64, 1,024 centroids | 1M × 128, 4,096 centroids | 4M × 128, 16,384 centroids |
|---|---|---|---|
| BF16, Triton (the default for FP32 input) | 0.038 s | 0.137 s | 1.147 s |
| BF16, PyTorch | 0.089 s | 1.331 s | 17.209 s |
| FP16, Triton | 0.031 s | 0.118 s | 1.166 s |
| FP16, PyTorch | 0.090 s | 1.380 s | 16.841 s |
| Native FP32, Triton | 0.043 s | 0.555 s | 7.896 s |
| Native FP32, PyTorch | 0.092 s | 1.363 s | 15.710 s |
| INT8, Triton | 0.043 s | 0.092 s | 0.854 s |
| FP8, Triton | 0.040 s | 0.111 s | 0.946 s |
| Speed-up | 200k × 64 | 1M × 128 | 4M × 128 |
|---|---|---|---|
| Triton over PyTorch, BF16 | 2.3× | 9.7× | 15.0× |
| Triton over PyTorch, FP16 | 2.9× | 11.7× | 14.4× |
| Triton over PyTorch, FP32 | 2.1× | 2.5× | 2.0× |
| INT8 over BF16 (Triton) | 0.89× | 1.50× | 1.34× |
| FP8 over BF16 (Triton) | 0.96× | 1.24× | 1.21× |
Final losses: FP16 and FP32 within 0.01% of BF16, INT8 within 0.06%, FP8 within 0.08%.
v0.2.6 compared with v0.2.5 (v0.2.6's run of 2026-11-26 against v0.2.5's tables from 2026-11-20; a run of v0.2.5 on 2026-11-26 reproduced
them within 1.2% at 1M × 128): BF16 and FP16 trained 1.3× to 1.9× faster at the two larger shapes,
and 0.88× (BF16) and 0.95× (FP16) as fast at 200k × 64.
The gain comes from the revival path, which sums each batch in one fused Triton kernel; with
revival off (unused_threshold=0), BF16 at 1M × 128 takes 0.235 s, v0.2.5's time. INT8 and FP8 then trained
slower than BF16 (in v0.2.5 they were 1.0× to 1.4× faster), because revival also needs each
row's second-nearest distance and its decoded values. Right after the sync they were 2.2× to
2.6× slower than in v0.2.5 at 1M × 128; v0.2.6 brought that to 1.2× there (1.2× to 1.6×
across the three shapes, the most at 200k × 64) with fused revival statistics, codes decoded in
the kernel, and launch rules for the second-nearest output. At 1M × 128, unused_threshold=0
turns revival off and nearly gives back v0.2.5's INT8/FP8 times (v0.2.6: 0.200 s and 0.176 s against
0.193 s and 0.169 s), at a cost in quality: the training objective rose by about 0.9%.
v0.2.7, INT8. A stock Int8Quantizer now sums its integer codes, exactly, from label-sorted
rows, and decodes each batch once, instead of decoding every row and adding the rows with a float
scatter-add. INT8 trains 2.51× (1M × 128) and 1.58× (4M × 128) faster than v0.2.6 and 2.13× and
1.27× faster than v0.2.5 there (same-day runs of each version); at 200k × 64 it runs at 0.94× of
v0.2.6 and 0.65× of v0.2.5, where BF16 is at 0.79× of v0.2.5 (v0.2.7 runs). Runs now repeat bit
for bit (see Known limitations).
v0.2.8, FP8. A stock Fp8Quantizer's batch sums (E4M3 code units) are added from label-sorted
rows instead of with the atomic byte kernel, which took half of an FP8 fit's GPU time at
1M × 128. FP8 trains 1.91× (1M × 128) and 1.48× (4M × 128) faster than v0.2.7 and 1.56× and
1.20× faster than v0.2.5 there; at 200k × 64 it runs at 1.04× of v0.2.7 and 0.63× of v0.2.5.
Results are unchanged bit for bit (all Triton formats at the three shapes against v0.2.7).
Small shapes. At 200k × 64 every format stays slower than v0.2.5 (BF16 0.74×, INT8 0.65×,
FP8 0.63×) although its GPU kernel time is the same or lower: cost-based revival launches about
twice as many small kernels (3,700 to 4,100 per 3-epoch fit against 1,600 to 2,000), and at that
size the GPU waits on the host. (BF16 at 200k × 64 is noisy from round to round: 0.038 to 0.070 s
in this run, 0.036 s in v0.2.7's; its code did not change.) With revival off (unused_threshold=0) all three train
at v0.2.5's speed (25 to 26 ms against 25 to 28 ms for a 3-epoch fit).
Assignment kernel, tuned tables against the NVIDIA-fitted settings (tools/tune_assign.py --compare, d = 32 to 768 (FP8: 64 to 768), k = 1,024 to 16,384, re-measured 2026-11-20). INT8
results are identical; for the other formats the tool accepts a configuration when the labels
are the same or, where tie order differs, the distances agree within rtol 1e-5 / atol 1e-4.
| Format | 65,536-row batches | 2,048-row batches |
|---|---|---|
| BF16 / FP16 | 1.06× to 2.80× | 0.95× to 3.45× |
| Native FP32 | 1.16× to 1.40× | 1.04× to 1.34× |
| INT8 | 2.99× to 8.51× | 2.57× to 10.4× |
| FP8 | 1.22× to 2.74× | 0.99× to 2.75× |
Training, each format with its tables on against off (3 warm epochs, v0.2.6; INT8 v0.2.7; FP8 v0.2.8;
tools/bench_train.py --no-tables gives the "off" side, all AMD tables cleared, including the
second-output rules below):
| Format | 200k × 64 | 1M × 128 | 4M × 128 |
|---|---|---|---|
| BF16 | 0.97× | 1.42× | 2.05× |
| INT8 | 0.97× | 1.87× | 2.30× |
| FP8 | 1.04× | 1.85× | 2.37× |
The split-K choice (below) does not affect training, whose batches are large.
tools/tune_assign.py --second). Upstream computed the encoded rows' revival terms
with PyTorch scatter-adds (110 ms of GPU time in a 3-epoch INT8 run at 1M × 128, plus the
decoding); the fused kernels, which now also decode the codes, take 7.5 ms (INT8) and 8.9 ms
(FP8), of which 5.7 ms and 5.3 ms are the EMA update of the axes (_removal_update_kernel).tools/tune_split_k.py). The
cap passes up a 1.02× to 1.14× gain at 1,024 rows with d = 128.tensor.to(torch.float8_e4m3fn) (an opt-in test, EMEANS_EXHAUSTIVE_TESTS=1; the default run
samples), and so do the scaled and affine encodes through a quantizer.EMEANS_ROCM_GRAPH_REPLAY=1.torch.cuda.get_device_capability() returns gfx
numbers ((12, 0) here), so a bare >= (8, 0) check silently matches AMD;
multi_processor_count is 16 here because RDNA counts work-group processors (two CUs each);
and HIP_VISIBLE_DEVICES=-1 aborts ROCm 10.1 (use ROCR_VISIBLE_DEVICES= to hide the GPU).Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.