szcompressor / cuSZp

Other
19 stars 9 forks source link

Crashes #2

Closed catid closed 1 month ago

catid commented 3 months ago

Examples crash using Nivida 4090 GPU on Linux:

#5  0x00007fff46d0e114 in ?? () from /lib/x86_64-linux-gnu/libcuda.so.1
#6  0x00007fff46d10754 in ?? () from /lib/x86_64-linux-gnu/libcuda.so.1
#7  0x00007fff46ec04ce in ?? () from /lib/x86_64-linux-gnu/libcuda.so.1
#8  0x00007ffff6e44859 in ?? ()
   from /home/catid/mambaforge/envs/cfc/lib/python3.10/site-packages/torch/lib/../../nvidia/cuda_runtime/lib/libcudart.so.12
#9  0x00007ffff6e177a5 in ?? ()
   from /home/catid/mambaforge/envs/cfc/lib/python3.10/site-packages/torch/lib/../../nvidia/cuda_runtime/lib/libcudart.so.12
#10 0x00007ffff6e67091 in cudaMemcpy ()
   from /home/catid/mambaforge/envs/cfc/lib/python3.10/site-packages/torch/lib/../../nvidia/cuda_runtime/lib/libcudart.so.12
#11 0x00007fff42667e87 in SZp_compress_hostptr_f32 (oriData=oriData@entry=0x7ffefc600040, cmpBytes=0x7ffee9200040 "",
    nbEle=nbEle@entry=11689512, cmpSize=cmpSize@entry=0x7fffffffd270, errorBound=errorBound@entry=9.99999975e-05)
    at /home/catid/sources/cuda_float_compress/cuSZp/src/cuSZp_entry_f32.cu:18
#12 0x00007fff4265e9dc in cuszp_compress (input=..., errorBound=9.99999975e-05)
    at /home/catid/sources/cuda_float_compress/src/cuda_float_compress.cpp:36
--Type <RET> for more, q to quit, c to continue without paging--

Seems to be on this line: cudaMemcpy(d_oriData, oriData, sizeof(float)*pad_nbEle, cudaMemcpyHostToDevice);

catid commented 3 months ago

Ah the bug is because it should be sizeof(float)*nbEle here. I guess no one is really using this compressor yet.

hyfshishen commented 3 months ago

Thanks for pointing out. This line seems to be in the host pointer function (input on CPU and output on CPU, just use GPU for compression), which is not as well maintained as device pointer functions (input on GPU and output on GPU). I guess you can temporarily try these two device-pointer functions:

Then move data based on your requirements from GPU to CPU. Hope this can help to resolve this issue.

BTW, I am working on a major update to cuSZp, including the 2x~3x throughput and higher compression ratio (by a new lossless compression algorithm) [link]. The issue you mentioned will be updated by then. This will be done within July this year. Thanks again for your interest :)

catid commented 2 months ago

Thanks for your work! I've released my own compression project here you may find interesting: https://github.com/catid/cuda_float_compress