Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/branch-24.04' into pandas_2.0_…
Browse files Browse the repository at this point in the history
…feature_branch
  • Loading branch information
galipremsagar committed Jan 29, 2024
2 parents fc790ab + 1422a4b commit 2a2c9c8
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ dependencies:
- ptxcompiler
- pyarrow==14.0.1.*
- pydata-sphinx-theme!=0.14.2
- pytest
- pytest-benchmark
- pytest-cases>=3.8.2
- pytest-cov
- pytest-xdist
- pytest<8
- python-confluent-kafka>=1.9.0,<1.10.0a0
- python-snappy>=0.6.0
- python>=3.9,<3.11
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ dependencies:
- pyarrow==14.0.1.*
- pydata-sphinx-theme!=0.14.2
- pynvjitlink
- pytest
- pytest-benchmark
- pytest-cases>=3.8.2
- pytest-cov
- pytest-xdist
- pytest<8
- python-confluent-kafka>=1.9.0,<1.10.0a0
- python-snappy>=0.6.0
- python>=3.9,<3.11
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/detail/aggregation/aggregation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,12 +1234,12 @@ constexpr bool is_sum_product_agg(aggregation::Kind k)
(k == aggregation::SUM_OF_SQUARES);
}

// Summing/Multiplying integers of any type, always use uint64_t for unsigned and int64_t for signed
// Summing/Multiplying integers of any type, always use int64_t accumulator
template <typename Source, aggregation::Kind k>
struct target_type_impl<Source,
k,
std::enable_if_t<std::is_integral_v<Source> && is_sum_product_agg(k)>> {
using type = std::conditional_t<std::is_unsigned_v<Source>, uint64_t, int64_t>;
using type = int64_t;
};

// Summing fixed_point numbers
Expand Down
35 changes: 19 additions & 16 deletions cpp/src/strings/copying/copying.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

#include <cudf/column/column_factories.hpp>
#include <cudf/detail/copy.hpp>
#include <cudf/detail/get_value.cuh>
#include <cudf/detail/null_mask.hpp>
#include <cudf/detail/offsets_iterator_factory.cuh>
#include <cudf/strings/detail/copying.hpp>
#include <cudf/strings/detail/utilities.hpp>
#include <cudf/strings/strings_column_view.hpp>

#include <rmm/cuda_stream_view.hpp>
Expand All @@ -33,47 +34,49 @@ namespace cudf {
namespace strings {
namespace detail {

std::unique_ptr<cudf::column> copy_slice(strings_column_view const& strings,
std::unique_ptr<cudf::column> copy_slice(strings_column_view const& input,
size_type start,
size_type end,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr)
{
if (strings.is_empty()) return make_empty_column(type_id::STRING);
if (end < 0 || end > strings.size()) end = strings.size();
if (input.is_empty()) { return make_empty_column(type_id::STRING); }
CUDF_EXPECTS(((start >= 0) && (start < end)), "Invalid start parameter value.");
auto const strings_count = end - start;
auto const offsets_offset = start + strings.offset();
auto const offsets_offset = start + input.offset();

// slice the offsets child column
auto offsets_column = std::make_unique<cudf::column>(
cudf::detail::slice(
strings.offsets(), {offsets_offset, offsets_offset + strings_count + 1}, stream)
input.offsets(), {offsets_offset, offsets_offset + strings_count + 1}, stream)
.front(),
stream,
mr);
auto const chars_offset =
offsets_offset == 0 ? 0 : cudf::detail::get_value<int32_t>(offsets_column->view(), 0, stream);
offsets_offset == 0 ? 0L : get_offset_value(offsets_column->view(), 0, stream);
if (chars_offset > 0) {
// adjust the individual offset values only if needed
auto d_offsets = offsets_column->mutable_view();
auto d_offsets =
cudf::detail::offsetalator_factory::make_output_iterator(offsets_column->mutable_view());
auto input_offsets =
cudf::detail::offsetalator_factory::make_input_iterator(input.offsets(), offsets_offset);
thrust::transform(rmm::exec_policy(stream),
d_offsets.begin<int32_t>(),
d_offsets.end<int32_t>(),
d_offsets.begin<int32_t>(),
cuda::proclaim_return_type<int32_t>(
input_offsets,
input_offsets + offsets_column->size(),
d_offsets,
cuda::proclaim_return_type<int64_t>(
[chars_offset] __device__(auto offset) { return offset - chars_offset; }));
}

// slice the chars child column
auto const data_size = static_cast<std::size_t>(
cudf::detail::get_value<int32_t>(offsets_column->view(), strings_count, stream));
auto const data_size =
static_cast<std::size_t>(get_offset_value(offsets_column->view(), strings_count, stream));
auto chars_buffer =
rmm::device_buffer{strings.chars_begin(stream) + chars_offset, data_size, stream, mr};
rmm::device_buffer{input.chars_begin(stream) + chars_offset, data_size, stream, mr};

// slice the null mask
auto null_mask = cudf::detail::copy_bitmask(
strings.null_mask(), offsets_offset, offsets_offset + strings_count, stream, mr);
input.null_mask(), offsets_offset, offsets_offset + strings_count, stream, mr);

auto null_count = cudf::detail::null_count(
static_cast<bitmask_type const*>(null_mask.data()), 0, strings_count, stream);
Expand Down
11 changes: 4 additions & 7 deletions cpp/tests/groupby/sum_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ using namespace cudf::test::iterators;
template <typename V>
struct groupby_sum_test : public cudf::test::BaseFixture {};

using K = int32_t;
using supported_types = cudf::test::Concat<
cudf::test::Types<int8_t, int16_t, int32_t, int64_t, float, double, uint16_t, uint64_t>,
cudf::test::DurationTypes>;
using K = int32_t;
using supported_types =
cudf::test::Concat<cudf::test::Types<int8_t, int16_t, int32_t, int64_t, float, double>,
cudf::test::DurationTypes>;

TYPED_TEST_SUITE(groupby_sum_test, supported_types);

Expand All @@ -40,9 +40,6 @@ TYPED_TEST(groupby_sum_test, basic)
using V = TypeParam;
using R = cudf::detail::target_type_t<V, cudf::aggregation::SUM>;

static_assert(std::is_signed_v<R> == std::is_signed_v<V>,
"Both Result type and Source type must have same signedness");

cudf::test::fixed_width_column_wrapper<K> keys{1, 2, 3, 1, 2, 2, 1, 3, 3, 2};
cudf::test::fixed_width_column_wrapper<V> vals{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ dependencies:
common:
- output_types: [conda, requirements, pyproject]
packages:
- pytest
- pytest<8
- pytest-cov
- pytest-xdist
test_python_cudf:
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ test = [
"fastavro>=0.22.9",
"hypothesis",
"msgpack",
"pytest",
"pytest-benchmark",
"pytest-cases>=3.8.2",
"pytest-cov",
"pytest-xdist",
"pytest<8",
"python-snappy>=0.6.0",
"scipy",
"tokenizers==0.13.1",
Expand Down
2 changes: 1 addition & 1 deletion python/cudf_kafka/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ dependencies = [

[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"pytest-xdist",
"pytest<8",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion python/custreamz/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ classifiers = [

[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"pytest-xdist",
"pytest<8",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion python/dask_cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ cudf = "dask_cudf.backends:CudfBackendEntrypoint"
test = [
"dask-cuda==24.4.*",
"numba>=0.57",
"pytest",
"pytest-cov",
"pytest-xdist",
"pytest<8",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

[project.urls]
Expand Down

0 comments on commit 2a2c9c8

Please sign in to comment.