Skip to content

Implement GPU Acceleration & Performance Cues for UTCI Polynomial Calculation #382

@noamjgal

Description

@noamjgal

I'm working with large point clouds (30M+ vertices) running UTCI calculations. As someone new to both this codebase and open source contribution in general, I've experienced a performance progression that many users might encounter:

  1. Started with the base implementation (utci.py), using list comprehension which took ~10 minutes for my dataset
  2. Discovered and switched to the NumPy-vectorized version (map/utci.py), reducing runtime to ~10 seconds
  3. Now proposing a GPU-accelerated implementation that could potentially reduce this to ~1 second

Experiencing this learning curve is leading me to suggest both further performance improvements and better discoverability of optimized implementations.

Proposed approach

  • Add GPU acceleration as an optional feature supporting CUDA and MPS with CPU fallback
  • Vectorize polynomial evaluation using PyTorch
  • Preserve exact polynomial coefficients and calculation logic across implementations

Implementation strategy

The codebase would maintain all three implementations to support different use cases:

  1. Base Python: Simple, no dependencies, good for small datasets
  2. NumPy-vectorized: Excellent for large datasets
  3. GPU-accelerated: Optimal for very large datasets

Key considerations

  • Package dependencies: Adding PyTorch as an optional dependency
  • Performance thresholds: Document dataset sizes where each implementation becomes optimal
  • Memory overhead: Evaluate CPU-GPU transfer costs for different dataset sizes
  • Testing: Ensure numerical consistency across all implementations
  • Documentation: Clear guidance on choosing the appropriate implementation based on use case

As this is my first potential contribution, I would greatly appreciate guidance.

Metadata

Metadata

Labels

new developmentFor issues that require new codewishNew feature or request which is not critical to continued development at this point

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions