Skip to content

[FEATURE] Extend GPU build acceleration to the scalar-quantized Seismic indexes #57

Closed

Description

@chishui

Problem

GPU build acceleration only applies to SeismicIndex / DiskSeismicIndex. The scalar-quantized variants silently fall back to CPU, because both offloads are gated on float (U32) weights while quantized indexes store uint8/uint16 codes:

  • nsparse/cluster/kmeans_utils.cpp:176 — assignment offload requires element_size == U32.
  • nsparse/cluster/inverted_list_clusters.cpp:133 — summarize_with_gpu_<T>() bails unless T is float.

All four types share build_clustered_lists(), so nothing else blocks it. No warning is emitted, so the build looks GPU-enabled but runs on CPU.

Proposal

  1. Support U8/U16 in the assignment kernel (convert codes to float on upload, or use an integer SpMM).
  2. Templatize the max-pool kernel over code width (atomicMax on unsigned int replaces the __float_as_int trick).
  3. Keep bit-identical CPU parity and CPU fallback; add U8/U16 parity tests.
  4. Meanwhile, warn once when a GPU build sees quantized weights.

For scale: the float path gives ~6x on base_full (483s → 75s, L4 vs 32-core).

Activity

  1. chishui commented on Sep 23, 2026

    @chishui
    CollaboratorAuthor

    resolved by #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions