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

Disable GPU accelerated row-column transpose for Pascal GPUs: #5122

Merged
merged 3 commits into from
Apr 5, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package com.nvidia.spark.rapids
import scala.annotation.tailrec
import scala.collection.mutable.Queue

import ai.rapids.cudf.{HostColumnVector, NvtxColor, Table}
import ai.rapids.cudf.{Cuda, HostColumnVector, NvtxColor, Table}
import com.nvidia.spark.rapids.GpuColumnarToRowExecParent.makeIteratorFunc
import com.nvidia.spark.rapids.shims.ShimUnaryExecNode

Expand Down Expand Up @@ -343,6 +343,16 @@ object GpuColumnarToRowExecParent {
Option(Tuple2(arg.child, arg.exportColumnarRdd))
}

/**
* Helper to check if GPU accelerated row-column transpose is supported
*/
private lazy val isAcceleratedTransposeSupported: Boolean = {
// Check if the current CUDA device architecture exceeds Pascal.
// i.e. CUDA compute capability > 6.x.
// Reference: https://developer.nvidia.com/cuda-gpus
Cuda.getComputeCapabilityMajor > 6
}

def makeIteratorFunc(
output: Seq[Attribute],
numOutputRows: GpuMetric,
Expand All @@ -356,7 +366,9 @@ object GpuColumnarToRowExecParent {
// This number includes the 1-bit validity per column, but doesn't include padding.
// We are being conservative by only allowing 100M columns until we feel the need to
// increase this number
output.length <= 100000000) {
output.length <= 100000000 &&
// Check if the current CUDA device supports accelerated transpose.
mythrocks marked this conversation as resolved.
Show resolved Hide resolved
isAcceleratedTransposeSupported) {
(batches: Iterator[ColumnarBatch]) => {
// UnsafeProjection is not serializable so do it on the executor side
val toUnsafe = UnsafeProjection.create(output, output)
Expand Down