Skip to content

Commit 935f5a5

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents b974a1c + da35cce commit 935f5a5

19 files changed

+884
-477
lines changed

onnxruntime/core/framework/transpose_helper.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typename std::enable_if<!has_mlas_transpose<T>::value, void>::type SimpleTranspo
2727
for (int64_t l = 0; l < num_loops; ++l) {
2828
T* output_for_first_writer = output_data;
2929

30-
for (auto wwpl = 0; wwpl < writes_per_writer_per_loop; ++wwpl) {
30+
for (int64_t wwpl = 0; wwpl < writes_per_writer_per_loop; ++wwpl) {
3131
T* output_for_current_writer = output_for_first_writer;
3232

3333
end = input_data + num_writers;
@@ -130,7 +130,7 @@ typename std::enable_if<!has_mlas_transpose<T>::value, void>::type SimpleTranspo
130130
for (int64_t l = 0; l < num_loops; ++l) {
131131
const T* input_for_first_reader = input_data;
132132

133-
for (auto rrpl = 0; rrpl < reads_per_reader_per_loop; ++rrpl) {
133+
for (int64_t rrpl = 0; rrpl < reads_per_reader_per_loop; ++rrpl) {
134134
const T* input_for_current_reader = input_for_first_reader;
135135

136136
end = output_data + num_readers;
@@ -210,7 +210,7 @@ void TransposeSingleAxisInwards(gsl::span<const size_t> permutations, const Tens
210210
for (int64_t l = 0; l < num_loops; ++l) {
211211
const uint8_t* input_for_first_reader = input_data;
212212

213-
for (auto rrpl = 0; rrpl < reads_per_reader_per_loop; ++rrpl) {
213+
for (int64_t rrpl = 0; rrpl < reads_per_reader_per_loop; ++rrpl) {
214214
const uint8_t* input_for_current_reader = input_for_first_reader;
215215

216216
for (int64_t r = 0; r < num_readers; ++r) {
@@ -309,4 +309,4 @@ bool IsTransposeMovingSingleAxis(gsl::span<const size_t> permutations, size_t& f
309309
return single_axis_moved;
310310
}
311311

312-
} // namespace onnxruntime
312+
} // namespace onnxruntime

onnxruntime/core/graph/contrib_ops/contrib_defs.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -2890,15 +2890,15 @@ void RegisterContribSchemas() {
28902890
if (ctx.getNumOutputs() > 1) {
28912891
auto saved_mean_shape = ctx.getOutputType(1)->mutable_tensor_type()->mutable_shape();
28922892
saved_mean_shape->CopyFrom(input_shape);
2893-
for (int d = static_cast<int>(axis); d < input_ndim; ++d)
2894-
saved_mean_shape->mutable_dim(d)->set_dim_value(1);
2893+
for (int64_t d = axis; d < input_ndim; ++d)
2894+
saved_mean_shape->mutable_dim(static_cast<int>(d))->set_dim_value(1);
28952895
}
28962896

28972897
if (ctx.getNumOutputs() > 2) {
28982898
auto saved_inv_std_dev_shape = ctx.getOutputType(2)->mutable_tensor_type()->mutable_shape();
28992899
saved_inv_std_dev_shape->CopyFrom(input_shape);
2900-
for (int d = static_cast<int>(axis); d < input_ndim; ++d)
2901-
saved_inv_std_dev_shape->mutable_dim(d)->set_dim_value(1);
2900+
for (int64_t d = axis; d < input_ndim; ++d)
2901+
saved_inv_std_dev_shape->mutable_dim(static_cast<int>(d))->set_dim_value(1);
29022902
}
29032903
})
29042904
.SetContextDependentFunctionBodyBuilder(

onnxruntime/core/graph/graph_utils.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -869,13 +869,13 @@ bool RemoveNodesWithOneOutputBottomUp(Graph& graph, const Node& start_node) {
869869
}
870870

871871
// push the parents of current node to the queue.
872-
for (unsigned int i = 0; i < cur_node.InputDefs().size(); ++i) {
873-
const std::string& input_name = GetNodeInputName(cur_node, i);
874-
if (IsInitializer(graph, input_name, true) || IsGraphInput(graph, cur_node.InputDefs()[i])) {
872+
for (size_t i = 0; i < cur_node.InputDefs().size(); ++i) {
873+
const std::string& input_name = GetNodeInputName(cur_node, static_cast<int>(i));
874+
if (IsInitializer(graph, input_name, true) || IsGraphInput(graph, cur_node.InputDefs()[static_cast<int>(i)])) {
875875
// skip initializers and graph inputs
876876
continue;
877877
}
878-
const Node* parent_node = GetInputNode(cur_node, i);
878+
const Node* parent_node = GetInputNode(cur_node, static_cast<int>(i));
879879
if (nullptr == parent_node) {
880880
continue;
881881
}

onnxruntime/core/optimizer/attention_fusion_helper.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ bool ValidateUnidirMask(std::vector<T> mask_data, int64_t w, bool& is_undirectio
281281
is_undirectional = true;
282282

283283
const T* p = mask_data.data();
284-
for (int i = 0; i < w; i++) {
285-
for (int j = 0; j < w; j++) {
284+
for (int64_t i = 0; i < w; i++) {
285+
for (int64_t j = 0; j < w; j++) {
286286
if (*p != static_cast<T>(1)) {
287287
is_one = false;
288288
}

onnxruntime/core/optimizer/graph_transformer_utils.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#ifdef MLAS_TARGET_AMD64_IX86
6464
#include "core/optimizer/qdq_transformer/avx2_weight_s8_to_u8.h"
6565
#endif
66-
#include "core/optimizer/qdq_transformer/bias_quantization.h"
66+
#include "core/optimizer/qdq_transformer/weight_bias_quantization.h"
6767
#include "core/optimizer/qdq_transformer/clip_quantizelinear.h"
6868
#include "core/optimizer/qdq_transformer/ensure_unique_dq_for_node_unit.h"
6969
#include "core/optimizer/qdq_transformer/qdq_propagation.h"
@@ -245,7 +245,7 @@ InlinedVector<std::unique_ptr<GraphTransformer>> GenerateTransformers(
245245

246246
if (!disable_quant_qdq) {
247247
transformers.emplace_back(std::make_unique<QDQPropagationTransformer>());
248-
transformers.emplace_back(std::make_unique<BiasQuantization>());
248+
transformers.emplace_back(std::make_unique<WeightBiasQuantization>());
249249

250250
// EnsureUniqueDQForNodeUnit is actually a required graph transformation. The unique DQ per QDQ node unit input
251251
// condition that it ensures is important for the partitioning that happens after Level1 optimizers are run.

onnxruntime/core/optimizer/qdq_transformer/bias_quantization.cc

-149
This file was deleted.

onnxruntime/core/optimizer/qdq_transformer/bias_quantization.h

-27
This file was deleted.

0 commit comments

Comments
 (0)