holoviz / datashader

Quickly and accurately render even the largest data.
http://datashader.org
BSD 3-Clause "New" or "Revised" License
3.32k stars 365 forks source link

Cupy implementation of eq_hist #1129

Closed ianthomas23 closed 2 years ago

ianthomas23 commented 2 years ago

Fixes #1128.

Solution is to replace all numpy calls in eq_hist() with equivalent cupy calls so that the data remains on the GPU.

There are already tests that cover this but they do not occur in github CI so I have tested them locally. One cupy test produces slightly different results (red component changed by 1) than numpy due to different numerics in cupy.

After this, the following passes locally:

$ DATASHADER_TEST_GPU=1 pytest datashader/tests/test_transfer_functions.py
codecov[bot] commented 2 years ago

Codecov Report

Merging #1129 (2df3e34) into master (a1de2d5) will decrease coverage by 0.00%. The diff coverage is 90.00%.

@@            Coverage Diff             @@
##           master    #1129      +/-   ##
==========================================
- Coverage   85.00%   84.99%   -0.01%     
==========================================
  Files          33       33              
  Lines        7515     7517       +2     
==========================================
+ Hits         6388     6389       +1     
- Misses       1127     1128       +1     
Impacted Files Coverage Δ
datashader/transfer_functions/__init__.py 86.76% <90.00%> (-0.14%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

ianthomas23 commented 2 years ago

Codecov failures will be common for changes like this as the CI does not touch GPU-specific code.