Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] cuspatial.interpolate.CubicSpline produces an erroneous interpolation #423

Closed
dioph opened this issue Jun 18, 2021 · 12 comments
Closed
Labels
bug Something isn't working

Comments

@dioph
Copy link

dioph commented Jun 18, 2021

Describe the bug
cuspatial.interpolate.CubicSpline produces a (very) different result from scipy.interpolate.CubicSpline

Steps/Code to reproduce bug

import cudf
import cupy as cp
import cuspatial
import numpy as np
from scipy import interpolate

t = cudf.Series(cp.array([0, 1, 2, 3, 4])).astype("float32")
x = cudf.Series(cp.array([3, 2, 3, 4, 3])).astype("float32")
g = cuspatial.interpolate.CubicSpline(t, x)
h = interpolate.CubicSpline(t.to_pandas().values, x.to_pandas().values)

t0_gpu = cudf.Series(cp.array([0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4])).astype("float32")
t0_cpu = np.array([0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4])

# alternatively to printing, it's also possible to compare both curves by plotting them
print(g(t0_gpu))
print(h(t0_cpu))

Expected behavior
cuspatial interpolation should give the same result. In particular, it should give the same input values at the control points, which it doesn't.

Environment details:
conda install, rapids v0.19, cupy v8.6

Additional context
Sometimes the above code can also raise cudaErrorIllegalAddress (similar to #319), especially if I initialize the cudf.Series objects with numpy arrays instead of cupy

@dioph dioph added Needs Triage Need team to review and classify bug Something isn't working labels Jun 18, 2021
@thomcom
Copy link
Contributor

thomcom commented Jun 18, 2021

Thanks @dioph ! I have also discovered this and have been at work on it the last couple of days. A new PR is coming up shortly to correct some surprising bugs I found.

@dioph
Copy link
Author

dioph commented Jul 5, 2021

Thanks for the heads-up! I'll be sure to keep an eye out for future updates. On a side note, I realized that I was using a slightly outdated version, so I gave the latest nightly release a go, but the issue still persists. The cudaErrorIllegalAddress is also more prevalent, and I can hardly run the same snippet without raising a RuntimeError.

@thomcom
Copy link
Contributor

thomcom commented Jul 23, 2021

Hey it has been a bit. Just letting you know I'm investigating a bug in another component of the system that appears to be causing this one.

@dioph
Copy link
Author

dioph commented Oct 2, 2021

Hi, just as an update in case anyone else with the same problem follows this thread, I recently tried updating rapids to 21.10, with the same results.

@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

@harrism
Copy link
Member

harrism commented Feb 22, 2022

@thomcom did you make any progress on this issue last year? Can you update with your findings so they do not get forgotten?

@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@thomcom
Copy link
Contributor

thomcom commented Mar 29, 2022

Thanks for asking Mark. There is a bug in cuSparse that is filed, I think they're planning on addressing it in the next version.

@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

@harrism
Copy link
Member

harrism commented Feb 28, 2023

We dropped cubic spline interpolation from cuspatial in #959. It was buggy and unused. If you feel it is still important to support, we can investigate re-adding support. Closing this.

@harrism harrism closed this as completed Feb 28, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in cuSpatial Feb 28, 2023
@jarmak-nv jarmak-nv removed the Needs Triage Need team to review and classify label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

4 participants