Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
/cubPublic archive

Port adjacent difference into CUB#331

Conversation

gevtushenko
Copy link
Collaborator

The PR contains:

  1. a port ofthrust::adjacent_difference algorithm;
  2. deprecation ofFlagHeads andFlagTails methods fromBlockAdjacentDifference structure;
  3. fixed API forBlockAdjacentDifference along with documentation and tests.

Note that the PR is based on some of the features introduced inMergeSort porting.

@gevtushenkogevtushenkoforce-pushed themain-feature/github/cub_adjacent_difference branch from10db20a to891c10cCompareJune 29, 2021 15:26
Copy link
Collaborator

@alliepiperalliepiper left a comment

Choose a reason for hiding this comment

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

This is a great first pass 👍 Let me know when you're ready for a re-review.

@alliepiperalliepiper added this to the1.14.0 milestoneJul 22, 2021
@alliepiperalliepiper modified the milestones:1.14.0,1.15.0Aug 17, 2021
@alliepiperalliepiper added the P1: should haveNecessary, but not critical. labelAug 17, 2021
@gevtushenkogevtushenkoforce-pushed themain-feature/github/cub_adjacent_difference branch 2 times, most recently from3c13360 to53ffc37CompareAugust 23, 2021 09:27
@gevtushenkogevtushenkoforce-pushed themain-feature/github/cub_adjacent_difference branch 2 times, most recently from370bee7 to88a4ae8CompareAugust 27, 2021 15:27
@alliepiperalliepiper added type: enhancementNew feature or request. P2: nice to haveDesired, but not necessary. and removed P1: should haveNecessary, but not critical. labelsOct 14, 2021
@alliepiperalliepiper modified the milestones:1.15.0,1.16.0Oct 14, 2021
Copy link
Collaborator

@alliepiperalliepiper left a comment

Choose a reason for hiding this comment

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

LGTM -- just some comments on documentation, otherwise this is ready to start testing 👍

* `{ ...3], [4,2,1,1], [1,1,1,1], [2,3,3,3], [3,4,1,4] }`.
* and that `valid_items` is `507`. The corresponding output `result` in
* those threads will be
* `{ ..., [-1,2,1,0], [0,0,0,-1], [-1,0,3,3], [3,4,1,4] }`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

(continuing from#331 (comment))

Gotcha, so the last 5 values are unchanged random values that are ignored by the algorithm.

There's another convention that uses- to stand in for such values, e.g.

* float* d_samples; // e.g., [2.2, 6.1, 7.1, 2.9, 3.5, -, -,
* // 0.3, 2.9, 2.1, 6.1, 999.5, -, -]

I think it's a little easier to parse with the non-numeric characters, since it's immediately clear that theycan't be involved in the calculation. If you agree, let's change this to

* `{ ...3], [4,2,1,1], [1,1,1,1], [2,3,3,-], [-,-,-,-] }`.* `{ ..., [-1,2,1,0], [0,0,0,-1], [-1,0,3,-], [-,-,-,-] }`.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Gotcha, so the last 5 values are unchanged random values that are ignored by the algorithm.

These values aren't ignored by the algorithm:

As the documentation states, the input value is copied without modifications if the neighbour value is out of bounds.

Ifinput andoutput parameters point to different memory locations, these values will be copied without modification. I'm afraid that non-numeric characters would mean that the output values are unchanged at all, for example:

input { 1, 2, 3 };output { 4, 5, 6 };valid_items = 0;adjacent_difference(input, output, valid_items);// output should be { 1, 2, 3 } and not { 4, 5, 6 }

The same withstd::adjacent_differencedocumentation. The output for:

std::vector v {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};

is

2 2 2 2 2 2 2 2 2 2

rather than:

- 2 2 2 2 2 2 2 2 2

Do you think it'll be clear from the- notation that the values are copied?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's a good point -- I'm fine leaving this as-is.

* __global__ void ExampleKernel(...)
* {
* // Specialize BlockAdjacentDifference for a 1D block of
* // 128 threads on type int
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/on/of/

(this is repeated in a few other docstrings)

gevtushenko reacted with heart emoji
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

There are quite a few places with this typo:

rg "threads on type" | wc -l33

I'll fix this in theblock_scan,block_discontinuity andblock_reduce documentation as well.

@gevtushenkogevtushenkoforce-pushed themain-feature/github/cub_adjacent_difference branch from28c79e4 toa64d24aCompareNovember 30, 2021 21:05
@gevtushenkogevtushenkoforce-pushed themain-feature/github/cub_adjacent_difference branch fromf83d279 to6d052dbCompareDecember 11, 2021 11:13
@gevtushenkogevtushenko added testing: gpuCI in progressStarted gpuCI testing. testing: internal ci in progressCurrently testing on internal NVIDIA CI (DVS). labelsDec 11, 2021
@gevtushenko
Copy link
CollaboratorAuthor

gpuCI:NVIDIA/thrust/pull/1577
DVS: 30766806

@gevtushenkogevtushenko removed the testing: gpuCI in progressStarted gpuCI testing. labelDec 12, 2021
@gevtushenkogevtushenko added testing: gpuCI passedPassed gpuCI testing. testing: internal ci passedPassed internal NVIDIA CI (DVS). release: breaking changeInclude in "Breaking Changes" section of release notes. and removed testing: internal ci in progressCurrently testing on internal NVIDIA CI (DVS). labelsDec 12, 2021
@gevtushenkogevtushenko merged commit722e3ca intoNVIDIA:mainDec 14, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@alliepiperalliepiperalliepiper approved these changes

Assignees

@gevtushenkogevtushenko

Labels
P2: nice to haveDesired, but not necessary.release: breaking changeInclude in "Breaking Changes" section of release notes.testing: gpuCI passedPassed gpuCI testing.testing: internal ci passedPassed internal NVIDIA CI (DVS).type: enhancementNew feature or request.
Projects
None yet
Milestone
1.16.0
Development

Successfully merging this pull request may close these issues.

2 participants
@gevtushenko@alliepiper

[8]ページ先頭

©2009-2025 Movatter.jp