Skip to content

[ET-VK] Allow overwriting local workgroup size #4046

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backends/vulkan/runtime/graph/ComputeGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ api::utils::uvec3 ComputeGraph::create_global_wg_size(const ValueRef idx) {
}

api::utils::uvec3 ComputeGraph::create_local_wg_size(const ValueRef idx) {
if (config_.enable_local_wg_size_override) {
return config_.local_wg_size_override;
}

if (is_buffer_storage(idx)) {
return {64u, 1u, 1u};
}
Expand Down
9 changes: 9 additions & 0 deletions backends/vulkan/runtime/graph/GraphConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ GraphConfig::GraphConfig() {
// QueryPool objects are used to measure execution times of individual shader
// dispatches. By default, this functionality is disabled.
enable_querypool = false;

enable_local_wg_size_override = false;
local_wg_size_override = {};
}

void GraphConfig::set_storage_type_override(api::StorageType storage_type) {
Expand All @@ -73,4 +76,10 @@ void GraphConfig::set_memory_layout_override(
memory_layout_override = memory_layout;
}

void GraphConfig::set_local_wg_size_override(
const api::utils::uvec3& local_wg_size) {
enable_local_wg_size_override = true;
local_wg_size_override = local_wg_size;
}

} // namespace vkcompute
4 changes: 4 additions & 0 deletions backends/vulkan/runtime/graph/GraphConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ struct GraphConfig final {

bool enable_querypool;

bool enable_local_wg_size_override;
api::utils::uvec3 local_wg_size_override;

// Generate a default graph config with pre-configured settings
explicit GraphConfig();

void set_storage_type_override(api::StorageType storage_type);
void set_memory_layout_override(api::GPUMemoryLayout memory_layout);
void set_local_wg_size_override(const api::utils::uvec3& local_wg_size);
};

} // namespace vkcompute
Loading