FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[SYCLomatic] Block Load headers core by abhilash1910 · Pull Request #1640 · oneapi-src/SYCLomatic · GitHub

[SYCLomatic] Block Load headers core - #1640

Merged
zhimingwang36 merged 76 commits into
oneapi-src:SYCLomaticfrom
abhilash1910:block_load_store_headers
May 9, 2024
Merged

[SYCLomatic] Block Load headers core#1640
zhimingwang36 merged 76 commits into
oneapi-src:SYCLomaticfrom
abhilash1910:block_load_store_headers

Conversation

Copy link
Copy Markdown
Contributor

In Progress PR for Load/Store header functions for Block API (related later to #1305 )
cc @yihanwg @danhoeflinger @mmichel11

abhilash1910 requested a review from a team as a code owner January 18, 2024 12:23
abhilash1910 marked this pull request as draft January 18, 2024 12:24
abhilash1910 changed the title [SYCLomatic] Block Load/Store headers core [SYCLomatic] Block Load headers core Jan 29, 2024
abhilash1910 marked this pull request as ready for review January 29, 2024 15:35
for (int ITEM = 0; ITEM < ITEMS_PER_THREAD; ITEM++) {
new (&items[ITEM])
InputT(block_itr[item.get_sub_group().get_local_range()[0] +
linear_tid + (ITEM * ITEMS_PER_THREAD)]);

mmichel11 Feb 1, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A similar comment to above with regards to the stride. In this case, I believe instead of ITEMS_PER_THREAD it should be the subgroup size.

mmichel11 commented Feb 2, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Thinking about the design in more depth, I do not think these APIs should be implemented as free functions. Rather, I think they should be implemented as classes which overload the function call operator or have a member function that invokes the load operation.

My reasoning for this is that certain applications during migration may need to pass a "load" object to a separate function
/ routine in a kernel. If they are implemented as classes, then an object can be passed to the function where it could then be used:

load_striped<...> obj;
my_func(obj);

However, if they are implemented as free functions, then they would need to be passed as function pointers:

auto func_obj = &load_striped<...>;
my_func(func_obj);

which is not supported in the SYCL programming model. To make this work, load_striped would have to be called directly from my_func which I think may be difficult from the migration perspective.

What I think we should do is have two classes work_group_load and sub_group_load and then have some enum type dictating the strategy (ex: striped, blocked, etc). We could then have have specializations of this class to implement each strategy and maybe have some helpers to reduce code duplication.

yihwang-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

mmichel11 commented Apr 30, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

This PR looks to be in good shape for me. However, I think the outstanding comments in oneapi-src/SYCLomatic-test#619 need to be addressed, so we can have confidence in the implementation's correctness.

}

template <size_t ITEMS_PER_WORK_ITEM, load_algorithm ALGORITHM, typename InputT,
typename InputIteratorT, typename Item>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

here are quite many item usage, ITEM/Item/iterms/ITERMS_PER_WORK_ITEM, maybe it should give a better name for "typename Item", it is a little confusing. or please add comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

thanks will add comments to clarify.

// InputT: typename parameter controlled at runtime from input sequence.
// InputIteratorT: typename parameter for iterator pointer controlled at
// runtime.
// Item : typename parameter resembling sycl::nd_item<3> .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

can we rename to nd_item? (what is the diff b/w Item and sycl::nd_item)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes it is same thing, but to maintain the same variable name across the file (similar for other apis), Item is used.

Copy link
Copy Markdown
Contributor Author

This PR is now tested with oneapi-src/SYCLomatic-test#619 and all tests are passing.
Tested on application side as well, working as expected.

danhoeflinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM,
There are some changes needed in the testing PR still, but with some local changes to those tests and passing runs, I'm confident enough in this PR now to approve.

mmichel11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

zhimingwang36 merged commit 01f2906 into oneapi-src:SYCLomatic May 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL