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

Add reduction tutorial #3513

Open
wants to merge 7 commits into
base: docs/develop
Choose a base branch
from
Open

Add reduction tutorial #3513

wants to merge 7 commits into from

Conversation

neon60
Copy link
Contributor

@neon60 neon60 commented Jun 5, 2024

Add reduction tutorial

@neon60 neon60 changed the base branch from develop to docs/develop June 5, 2024 14:49
@neon60 neon60 requested review from lpaoletti and removed request for mangupta, gandryey and rakesroy June 7, 2024 05:24
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
Copy link

@SwRaw SwRaw left a comment

Choose a reason for hiding this comment

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

@neon60 I have responded to all your comments. Let me know if I missed something,

docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
docs/tutorial/reduction.rst Outdated Show resolved Hide resolved
Two-pass reduction
------------------

Alter kernel launch and input fetching such that no more blocks are launched than what a subsequent kernel launch's single block can conveniently reduce, while performing multiple passes of input reading from global and combining their results before engaging in the end game tree-like reduction.

Choose a reason for hiding this comment

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

Something is off in this sentence. I can't quite understand it. Difficult to comment.


This modification can only be executed on AMD hardware.

Perform the first step of the two-pass reduction, but in the end, instead of writing to global and reading it back in a subsequent kernel, write the partial results to the Global Data Share (GDS). This is an ``N+1`` th shared memory that is accessed by all multiprocessors and is also on-chip memory.

Choose a reason for hiding this comment

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

Suggested change
Perform the first step of the two-pass reduction, but in the end, instead of writing to global and reading it back in a subsequent kernel, write the partial results to the Global Data Share (GDS). This is an ``N+1`` th shared memory that is accessed by all multiprocessors and is also on-chip memory.
Perform the first step of the two-pass reduction, but in the end, instead of writing to global and reading it back in a subsequent kernel, write the partial results to the Global Data Share (GDS). This is an ``N+1`` **th** shared memory that is accessed by all multiprocessors and is also on-chip memory.

Choose a reason for hiding this comment

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

what is the th?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would not make it bold. The problem: https://www.reddit.com/r/math/comments/nw5lb1/n1st_or_n1th/

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it's better to show the numbers in the squares on the third row ? Instead of f(z, 5) it should be 5 and f(13, 8) should be 13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gandryey I will be able to check this tonight. If you have more comments, please share.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we show the numbers in the squares, since the full function is already written on the previous step? f(z,5) should be 5 and f(f(z,5),13) should be just 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants