-
Notifications
You must be signed in to change notification settings - Fork 238
Support for decoder pipeline based multimodel #1775
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
base: main
Are you sure you want to change the base?
Support for decoder pipeline based multimodel #1775
Conversation
|
@microsoft-github-policy-service agree company="Qualcomm" |
| state_.outputs_[index_] = other.state_.inputs_[other.index_]; | ||
| } | ||
|
|
||
| WindowedEmbeddings::WindowedEmbeddings(State& state, Embeddings::Mode mode, const std::string& name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be reduced to just the following because it's so similar to the parent class constructor:
WindowedEmbeddings::WindowedEmbeddings(State& state, Embeddings::Mode mode, const std::string& name)
: Embeddings(state, mode, name) {
window_size_ = model_.config_->model.decoder.sliding_window->window_size;
}| const uint16_t* full_data = full_embeddings->GetTensorData<uint16_t>(); | ||
|
|
||
| if (window_index_ == 0) { | ||
| num_windows_ = (sequence_length + window_size_ - 1) / window_size_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first two conditions here share a decent amount of initialization? could we combine these two conditions and remove some duplicate code?
| void Update(Embeddings& embeddings); | ||
|
|
||
| private: | ||
| State& state_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could in theory update the parent class variables to be protected and then these don't need to be redeclared in the child class
| config_session_options.provider_options, is_primary_session_options, | ||
| disable_graph_capture, *config_); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: whitespace
|
|
||
| namespace Generators { | ||
|
|
||
| struct MultiModalPipelineLanguageModel : Model { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would suggest trying to align the name of the class here and the name of the file
|
|
||
| namespace { | ||
|
|
||
| int64_t GetNumImageTokens(const std::vector<ExtraInput>& extra_inputs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only usage of this function in file is commented out
| return 0; | ||
| } | ||
|
|
||
| int64_t GetNumAudioTokens(const std::vector<ExtraInput>& extra_inputs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice if we could move these to another file where they can both be accessed by this file and the multi_modal.cpp file
|
|
||
| } // namespace | ||
|
|
||
| MultiModalPipelineLanguageModel::MultiModalPipelineLanguageModel(std::unique_ptr<Config> config, OrtEnv& ort_env, bool vision, bool speech) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like with the rest of this file there is a big opportunity for code reuse with multi_modal.cpp if we organize the classes a little better
bed9e8a to
78dc399
Compare
No description provided.