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

[Native-WebGPU] Add Concat #22225

Merged
merged 5 commits into from
Sep 27, 2024
Merged

Conversation

satyajandhyala
Copy link
Contributor

Description

Add Concat operator support

Motivation and Context

Required for WebGPU EP

@satyajandhyala satyajandhyala changed the title [native-WebGPU] Add Concat [Native-WebGPU] Add Concat Sep 25, 2024
@satyajandhyala satyajandhyala marked this pull request as ready for review September 25, 2024 23:10
@@ -101,6 +101,10 @@ class ShaderHelper final {
return *this;
}

const std::vector<std::unique_ptr<ShaderVariableHelper>>& GetInputVars() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason why I do not want to expose the input_vars_ directly, is because this getter exposed the internal implementation details and made the type as a part of public interface.

I would do it a little differently in concat.cc:

  std::vector<const ShaderVariableHelper *> input_vars;
  for (size_t i = 0; i < input_count_; ++i) {
    input_vars.push_back(&shader.AddInput("input_" + std::to_string(i), ShaderUsage::UseUniform | ShaderUsage::UseIndicesTypeAlias));
  }

Status Concat::ComputeInternal(ComputeContext& context) const {
auto input_count = context.InputCount();
InlinedTensorsVector input_tensors;
input_tensors.reserve(input_count);
Copy link
Contributor

Choose a reason for hiding this comment

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

add a TODO to deal with input_count + 1 /* output_count */ > max_allowed_buffer_per_shader

@fs-eire fs-eire merged commit 92a08e2 into fs-eire/webgpu-ep Sep 27, 2024
39 of 40 checks passed
@fs-eire fs-eire deleted the sajandhy/webgpu-ep-concat branch September 27, 2024 09:55
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.

2 participants