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

[SYCL][FPGA] Rename [[intel::disable_loop_pipelining]] attribute function metadata #11372

Merged
merged 6 commits into from
Oct 12, 2023

Conversation

smanna12
Copy link
Contributor

@smanna12 smanna12 commented Oct 2, 2023

Metadata emitted from front-end when an FPGA IPA kernel has the property pipelined is a function metadata of the form !disable_loop_pipelining !X, !X = !{i32 0|1}.

This is confusing as the user means to pipeline the kernel/not pipeline the kernel as opposed to enabling/disabling the pipelining of all loops in the kernel/function, and this name does not reflect that. This patch renames the function metadata to "!pipeline_kernel", and to flip the argument. We believe it may convey information better about what to do with the kernel when the property is absent.

This was likely caused by a miscommunication with the related loop metadata that's currently being attached when the loop attribute [[intel::disable_loop_pipelining]] is used: {!"llvm.loop.intel.pipelining.enable", i32 0}

…data

Metadata emitted from front-end when an FPGA IPA kernel has the property pipelined<N> is a function metadata of the form !disable_loop_pipelining !X, !X = !{i32 0|1}.

This is confusing as the user means to pipeline the kernel/not pipeline the kernel as opposed to enabling/disabling the pipelining of all loops in the kernel/function, and this name does not reflect that. This patch renames the functin metadata to !disable_kernel_pipelining.

This was likely caused by a miscommunication with the related loop metadata that's currently being attached when the loop attribute [[intel::disable_loop_pipelining]] is used: {!"llvm.loop.intel.pipelining.enable", i32 0}

This patch also changes the loop metadata to !llvm.loop.intel.pipelining.disable and invert the argument to reflet the correct attribute behavior and match with function metadata change.

Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12 smanna12 changed the title [SYCL][FPGA] Rename [[intel::disable_loop_pipelining]] attribute meta… [SYCL][FPGA] Rename [[intel::disable_loop_pipelining]] attribute metadata Oct 2, 2023
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12 smanna12 temporarily deployed to WindowsCILock October 2, 2023 03:30 — with GitHub Actions Inactive
@smanna12 smanna12 temporarily deployed to WindowsCILock October 2, 2023 04:01 — with GitHub Actions Inactive
@smanna12 smanna12 marked this pull request as ready for review October 2, 2023 13:13
@smanna12 smanna12 requested a review from a team as a code owner October 2, 2023 13:13
indicates that the kernel should be pipelined or not. Cannot be used on the
same loop or function, or in conjunction with ``speculated_iterations``,
``max_concurrency``, ``initiation_interval``, ``ivdep``,
``max_reinvocation_delay`` or ``enable_loop_pipelining`` attribute.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @bowenxue-intel for reviews. We added support for "enable_loop_pipeling" on #9263

@bowenxue-intel
Copy link
Contributor

@smanna12 Thanks for the response, I also just noticed that there is the enable_loop_pipelining attribute. In this case, I am double-checking whether it makes sense for the loop metadata emitted when [[intel::disable_loop_pipelining]] is used to be changed, or if it can remain as is, which would result in less work on the SPIR-V and our middle-end.

Other than that, LGTM

Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12 smanna12 changed the title [SYCL][FPGA] Rename [[intel::disable_loop_pipelining]] attribute metadata [SYCL][FPGA] Rename [[intel::disable_loop_pipelining]] attribute function metadata Oct 6, 2023
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12 smanna12 temporarily deployed to WindowsCILock October 6, 2023 13:59 — with GitHub Actions Inactive
@smanna12
Copy link
Contributor Author

smanna12 commented Oct 6, 2023

@bowenxue-intel, could you please review updated patch? Thank you

@smanna12 smanna12 temporarily deployed to WindowsCILock October 6, 2023 14:29 — with GitHub Actions Inactive
@smanna12
Copy link
Contributor Author

smanna12 commented Oct 6, 2023

Thank you @bowenxue-intel for reviews!

Related SPIRV PR: KhronosGroup/SPIRV-LLVM-Translator#2171

@intel/dpcpp-cfe-reviewers, please review. Thank you

MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 9, 2023
…or loops and functions (#2171)

Refactor SPIRVWriter to accept !disable_kernel_pipelining instead of !disable_loop_pipelining for function metadata, and !llvm.loop.intel.pipelining.disable instead of !llvm.loop.intel.pipelining.enable for loop metadata.

Refactor SPIRVReader to emit !disable_kernel_pipelining instead of !disable_loop_pipelining for function metadata, and !llvm.loop.intel.pipelining.disable instead of !llvm.loop.intel.pipelining.enable for loop metadata.

Relevant/Related intel/llvm PR: intel/llvm#11372
@smanna12
Copy link
Contributor Author

smanna12 commented Oct 9, 2023

@elizabethandrews / @premanandrao could you please review? Thank you
SPIRV change regarding new function metadata has already been merged KhronosGroup/SPIRV-LLVM-Translator@e68ddf7

clang/include/clang/Basic/AttrDocs.td Outdated Show resolved Hide resolved
jsji pushed a commit that referenced this pull request Oct 12, 2023
…or loops and functions (#2171)

Refactor SPIRVWriter to accept !disable_kernel_pipelining instead of !disable_loop_pipelining for function metadata, and !llvm.loop.intel.pipelining.disable instead of !llvm.loop.intel.pipelining.enable for loop metadata.

Refactor SPIRVReader to emit !disable_kernel_pipelining instead of !disable_loop_pipelining for function metadata, and !llvm.loop.intel.pipelining.disable instead of !llvm.loop.intel.pipelining.enable for loop metadata.

Relevant/Related intel/llvm PR: #11372

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@e68ddf7
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12 smanna12 temporarily deployed to WindowsCILock October 12, 2023 15:30 — with GitHub Actions Inactive
@smanna12 smanna12 temporarily deployed to WindowsCILock October 12, 2023 16:34 — with GitHub Actions Inactive
@smanna12
Copy link
Contributor Author

Latest commit 624a580 was just a small update in document.

@intel/llvm-gatekeepers, This PR is ready to be merged. Thank you

@aelovikov-intel aelovikov-intel merged commit ad0dd36 into intel:sycl Oct 12, 2023
10 checks passed
@smanna12 smanna12 deleted the RenameMetaData branch October 16, 2023 18:05
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.

4 participants