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

Approx Percentile #3301

Merged
merged 60 commits into from
Sep 28, 2021
Merged

Approx Percentile #3301

merged 60 commits into from
Sep 28, 2021

Conversation

andygrove
Copy link
Contributor

@andygrove andygrove commented Aug 25, 2021

Signed-off-by: Andy Grove andygrove@nvidia.com

Depends on rapidsai/cudf#9094

Status:

  • Get one test working end to end (even if results are not 100% correct)
  • Add casts so final percentiles are in same data type as input
  • GpuOverride type checking
  • Add config to enable feature
  • GpuOverride fall back to CPU if used as a reduction
  • PySpark integration tests
  • Decide on translation (if any) from Spark delta to cuDF delta
  • Documentation

@sameerz sameerz added the feature request New feature or request label Aug 25, 2021
Signed-off-by: Andy Grove <andygrove@nvidia.com>
override def aggBufferAttributes: Seq[AttributeReference] = outputBuf :: Nil

// Mark as lazy to avoid being initialized when creating a GpuApproximatePercentile.
override lazy val initialValues: Seq[GpuExpression] = throw new UnsupportedOperationException
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is needed in cases where we get no data to a given task, or in some cases it might be a reduction where no data showed up at all. Then the initialValues ends up being what is returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I will work on writing a test case to trigger this exception and then implement something here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Any update on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like this is only invoked in reduction use cases when there are empty batches. We don't support reduction yet for this operator so I have updated the exception to indicate that.

@andygrove andygrove added the cudf_dependency An issue or PR with this label depends on a new feature in cudf label Sep 2, 2021
@andygrove andygrove self-assigned this Sep 9, 2021
@andygrove andygrove added this to the Aug 30 - Sept 10 milestone Sep 9, 2021

// The result type is the same as the input type.
private lazy val internalDataType: DataType = {
if (returnPercentileArray) ArrayType(child.dataType,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, indentation seems a little odd in this if statement.

override def columnarEval(batch: ColumnarBatch): Any = {
val expr = child.asInstanceOf[GpuExpression]
withResource(expr.columnarEval(batch).asInstanceOf[GpuColumnVector]) { cv =>

Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, extra line.

@andygrove andygrove marked this pull request as ready for review September 27, 2021 15:15
@andygrove andygrove changed the title WIP: Approx Percentile Approx Percentile Sep 27, 2021
@andygrove
Copy link
Contributor Author

build

@andygrove
Copy link
Contributor Author

build

@andygrove
Copy link
Contributor Author

build failed with connection error, will try again

@andygrove
Copy link
Contributor Author

build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf_dependency An issue or PR with this label depends on a new feature in cudf feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Percentile support
5 participants