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

Support CPU path for from_utc_timestamp function with timezone #9689

Merged
merged 8 commits into from
Nov 21, 2023

Conversation

winningsix
Copy link
Collaborator

PR includes:

  1. Support no-fallback for from_utc_timestamp using Spark existing implement (running in CPU)
  2. Fix null issue for previous TimezoneDB util

Note: this depends on GPU kernel implement from Spark-Rapids-JNI to make it really running on GPU.

@winningsix
Copy link
Collaborator Author

build

@winningsix
Copy link
Collaborator Author

build

@winningsix
Copy link
Collaborator Author

build

@winningsix
Copy link
Collaborator Author

Per discussed, introduced a configuration to hide CPU based kernel. @NVnavkumar please help take a look. Thanks!


if (timezone != utc) {
willNotWorkOnGpu("only timezones equivalent to UTC are supported")
if (TimeZoneDB.isSupportedTimezone(timezoneShortID)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The internal Spark config should actually be wired into here. The logic should be:

If the timezone is UTC -> Always stay on the GPU (no-op)
If the timezone is not UTC -> if the config is set to true, use the CPU POC as long as the timezone is supported, otherwise fallback to CPU

Copy link
Collaborator Author

@winningsix winningsix Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal Spark config (spark.rapids.test.CPU.timezone) was wired inside isSupportedTimezone method.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think it's better to wire the config directly here. I find that putting it in the logic of isSupportedTimezone a bit confusing to understand, even though it might make the migration process simpler in a way. It's not actually hard to remove the config when we migrate to GPU timezone DB. Plus I'm not sure depending on the review if that will make it in 23.12, so I think we should stay safe with this code path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Please take a further look.

@winningsix
Copy link
Collaborator Author

build

@winningsix
Copy link
Collaborator Author

build

@NVnavkumar NVnavkumar merged commit 2667941 into NVIDIA:branch-23.12 Nov 21, 2023
36 checks passed
@winningsix
Copy link
Collaborator Author

This closes #9804

@sameerz sameerz added the task Work required that improves the product but is not user facing label Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Work required that improves the product but is not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants