Fix GenerationConfig initialization in qnn_multimodal_runner#19621
Conversation
Summary: ...changes. - Replace fragile positional initialization with explicit field assignments - Improves code clarity by making field names explicit - Makes the code robust to future changes in GenerationConfig struct Differential Revision: D105377713
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19621
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ⏳ No Failures, 2 PendingAs of commit 7f53170 with merge base e6bf149 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@kirklandsign has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105377713. |
There was a problem hiding this comment.
Pull request overview
Switches the GenerationConfig aggregate-initializer in the QNN multimodal runner from positional to designated initializers so the call site is self-documenting and resilient to future field additions/reorderings in extension/llm/runner/irunner.h.
Changes:
- Replace positional braced initializer of
GenerationConfigwith C++20 designated initializers naming each field.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GCC and Clang: These compilers have supported designated initializers as a "C extension" in C++ mode long before C++20. If you are using g++ or clang++ with -std=c++17, it will likely compile, though it might trigger a warning (e.g., -Wpedantic) saying "designated initializers are a C++20 extension." MSVC (Visual Studio): Standard support started with MSVC 2019 v16.8. Earlier versions strictly following the C++17 standard will fail. |
Summary:
...changes.
Differential Revision: D105377713