Skip to content

Commit

Permalink
Merge branch 'develop' into onnx-split-tests2
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 authored Dec 19, 2023
2 parents 78abaa2 + 80dde3e commit 3f0d4bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/.sphinx/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ requests==2.28.2
# via
# pygithub
# sphinx
rocm-docs-core==0.30.1
rocm-docs-core==0.30.2
# via -r requirements.in
smmap==5.0.0
# via gitdb
Expand Down
10 changes: 5 additions & 5 deletions src/onnx/parse_dynamicquantizelinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ struct parse_dynamicquantizelinear : op_parser<parse_dynamicquantizelinear>

// 1. Computing y_scale
// Note: currently, DynamicQuantizeLinear only has uint8 quantization:
const auto Q_MAX = std::numeric_limits<uint8_t>::max();
const auto Q_MIN = std::numeric_limits<uint8_t>::min();
const auto x_max = std::numeric_limits<uint8_t>::max();
const auto x_min = std::numeric_limits<uint8_t>::min();

auto q_range =
info.add_literal(migraphx::literal{migraphx::shape{x_type}, {Q_MAX - Q_MIN}});
info.add_literal(migraphx::literal{migraphx::shape{x_type}, {x_max - x_min}});

// maximum(0, max(x))
auto max_x =
Expand All @@ -129,8 +129,8 @@ struct parse_dynamicquantizelinear : op_parser<parse_dynamicquantizelinear>

// 2. Computing y_zero_point
// intermediate_zero_point = qmin - min(x) / y_scale
auto q_min = info.add_literal(migraphx::literal{migraphx::shape{x_type}, {Q_MIN}});
auto q_max = info.add_literal(migraphx::literal{migraphx::shape{x_type}, {Q_MAX}});
auto q_min = info.add_literal(migraphx::literal{migraphx::shape{x_type}, {x_min}});
auto q_max = info.add_literal(migraphx::literal{migraphx::shape{x_type}, {x_max}});
auto sub1 = info.add_common_op("sub", q_min, min_x);
auto interm_zp = info.add_common_op("div", sub1, y_scale);
// y_zero_point = cast(round(saturate(itermediate_zero_point)))
Expand Down
2 changes: 1 addition & 1 deletion test/onnx/.onnxrt-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
44b58437402b207c8216f3be8c75accb7409be1c
81ad1e6ac3149b928ccdaed9f76195a303613804

0 comments on commit 3f0d4bb

Please sign in to comment.