Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ shared float shared_sum_sq[LOCAL_WORK_GROUP_SIZE];
* N is the number of elements in the tensor buffer; each thread computes one
* output element.
*
* Local work group size: {1, float, 1}
* float should be a power of 2, recommended 64 or 128 threads. This allows
* efficient tree-based reduction in shared memory. Each local group will
* cooperate to compute the output element.
* Local work group size: {1, 1, 64}
* This allows efficient tree-based reduction in shared memory. Each local
* group cooperates to compute one output element.
*
* Each shader invocation will compute the mean and standard deviation for one
* channel group in the input, and write out the corresponding result.
*/
void group_norm_reduce_C_packed() {
const int global_idx = int(gl_GlobalInvocationID.x);
const int local_idx = int(gl_LocalInvocationID.y);
const int local_idx = int(gl_LocalInvocationID.z);

// Calculate group dimensions
const int D = in_sizes.z / group; // channels per group
Expand Down
4 changes: 3 additions & 1 deletion backends/vulkan/runtime/graph/ops/impl/GroupNorm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ utils::uvec3 group_norm_local_wg_size(
(void)args;
(void)resize_args;

return {1, 64, 1};
return {1u, 1u, 64u};
}

void resize_group_norm_texture_node(
ComputeGraph* graph,
const std::vector<ArgGroup>& args,
const std::vector<ValueRef>& resize_args) {
VK_CHECK_COND(graph != nullptr);

// Extract tensor references from args
const ValueRef out = args.at(0).refs.at(0);
const ValueRef in = args.at(1).refs.at(0);
Expand Down
Loading