Skip to content

Commit

Permalink
Suppress maybe used uninitialized warning as being false alert (#20886)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

It breaks the python package pipeline.
A new run:

https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=477415&view=logs&s=d66927fc-650e-5e6f-874c-ae9229c1e7e4

---------

Co-authored-by: Your Name <[email protected]>
  • Loading branch information
wangyems and Your Name authored Jun 1, 2024
1 parent 4e18344 commit ad769f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions onnxruntime/contrib_ops/cuda/quantization/moe_quantization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ Status QMoE::ComputeInternal(OpKernelContext* context) const {
const Tensor* fc3_scales_optional = context->Input<Tensor>(9);
const Tensor* fc3_experts_bias_optional = context->Input<Tensor>(10);

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Mute "maybe used uninitialized" warning for MoEParameters.
#endif

MoEParameters moe_params;
MoEQuantType quant_type = MoEQuantType::UINT4;
ORT_RETURN_IF_ERROR(CheckInputs(moe_params, quant_type, input, router_probs, fc1_experts_weights,
Expand Down Expand Up @@ -135,6 +140,10 @@ Status QMoE::ComputeInternal(OpKernelContext* context) const {
reinterpret_cast<int*>(expert_for_source_row.get()), static_cast<int>(moe_params.num_rows),
static_cast<int>(moe_params.hidden_size), static_cast<int>(k_), Stream(context));

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

return Status::OK();
}

Expand Down

0 comments on commit ad769f1

Please sign in to comment.