Skip to content

Commit

Permalink
[pota-quantization-value-test] Set right mode (Samsung#12634)
Browse files Browse the repository at this point in the history
This commit fixes the bug where the mode was not set properly.

ONE-DCO-1.0-Signed-off-by: seongwoo <[email protected]>
  • Loading branch information
mhs4670go authored Feb 15, 2024
1 parent 7dea6ca commit 6a1be91
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions compiler/pota-quantization-value-test/compare_tensors_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
source_dir = args.source_dir
mode = args.mode

if mode in ['mixed_fake_quantization', 'parallel_record_minmax', 'mixed_quantization']:
source_dir += '_config'

log_format = '%(levelname)s: %(message)s'
formatter = logging.Formatter(log_format)
streamer = StringIO()
Expand Down Expand Up @@ -167,13 +170,13 @@ def chunks(lst, n):
expect_dir = f'{source_dir}/expected_outputs/{model_name}/{granularity}/{dtype}/{modes_to_expected_folder[mode]}'
if os.path.isfile(expect_dir + "/" + tensor_name + ".json"):
test_result = False
if mode == "fake_quantization":
if mode in ["fake_quantization", "mixed_fake_quantization"]:
test_result = compare_fake_quantization(input[tensor_name],
tensor_name, expect_dir)
elif mode == "record_minmax":
elif mode in ["record_minmax", "parallel_record_minmax"]:
test_result = compare_record_minmax(input[tensor_name], tensor_name,
expect_dir)
elif mode == "quantization":
elif mode in ["quantization", "mixed_quantization"]:
test_result = compare_quantization(input[tensor_name], tensor_name,
expect_dir)
elif mode == "weights_only_quantization":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ popd
--test_param "${TEST_PARAMS}" \
--bin_dir ${BIN_PATH} \
--source_dir ${SOURCE_PATH} \
--mode fake_quantization
--mode mixed_fake_quantization

if [[ $? -ne 0 ]]; then
exit 255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ popd
--test_param "${TEST_PARAMS}" \
--bin_dir ${BIN_PATH} \
--source_dir ${SOURCE_PATH} \
--mode record_minmax
--mode parallel_record_minmax

if [[ $? -ne 0 ]]; then
exit 255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ popd
--test_param "${TEST_PARAMS}" \
--bin_dir ${BIN_PATH} \
--source_dir ${SOURCE_PATH} \
--mode quantization
--mode mixed_quantization

if [[ $? -ne 0 ]]; then
exit 255
Expand Down

0 comments on commit 6a1be91

Please sign in to comment.