Skip to content

[vulkan] Support multiple dispatch from one dispatch region - #1816

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_308522336
May 19, 2020
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_308522336

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

[vulkan] Support multiple dispatch from one dispatch region

This commit extends the Vulkan backend to support launching
multiple kernels originated from the same dispatch region
in sequence.

The SPIR-V CodeGen pipeline incorporates the pass to split
kernels if there are multiple Linalg ops. If multiple kernels
are created, a special attribute spv.entry_point_schedule,
is attached to the module to indicate the scheduling of entry
points. Then the Vulkan backend queries this attribute and
dispatches entry points as scheduled.

This commit also updates various HLO to Linalg on buffers
conversion to emit a linalg.fill op to zero the output buffers
ahead of performing the real computation.


/// Attribute on a module op to denote the scheduling order of entry points.
/// The attribute value is expected to be an array of entry point name strings.
inline llvm::StringRef getEntryPointScheduleAttrName() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I thought there was a decision not to do this and just use strings?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You mean not have this helper function but just directly embedding the string at call sites? I don't think there was a decision made on that? But I might miss something. This attribute name is used across a wide range so having a symbol that compilers can check is better imo.

@copybara-service
copybara-service Bot force-pushed the test_308522336 branch 3 times, most recently from 994fa90 to 9933050 Compare May 19, 2020 12:57
This commit extends the Vulkan backend to support launching
multiple kernels originated from the same dispatch region
in sequence.

The SPIR-V CodeGen pipeline incorporates the pass to split
kernels if there are multiple Linalg ops. If multiple kernels
are created, a special attribute `spv.entry_point_schedule`,
is attached to the module to indicate the scheduling of entry
points. Then the Vulkan backend queries this attribute and
dispatches entry points as scheduled.

This commit also updates various HLO to Linalg on buffers
conversion to emit a linalg.fill op to zero the output buffers
ahead of performing the real computation.

PiperOrigin-RevId: 312264954
@copybara-service copybara-service Bot closed this May 19, 2020
@copybara-service
copybara-service Bot deleted the test_308522336 branch May 19, 2020 13:12
@copybara-service
copybara-service Bot merged commit 6f30e72 into master May 19, 2020
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.

3 participants