Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpTestPy] support opencl on elementwise_pow #8153

Merged
merged 4 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/performance/benchmark_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ adb shell "cd /data/local/tmp/benchmark;
--input_shape=1,3,224,224 \
--warmup=10 \
--repeats=20 \
--backend=opemncl,arm \
--backend=opencl,arm \
--opencl_cache_dir=/data/local/tmp \
--opencl_kernel_cache_file=MobileNetV1_kernel.bin \
--opencl_tuned_file=MobileNetV1_tuned.bin"
Expand Down
10 changes: 7 additions & 3 deletions lite/tests/unittest_py/op/test_elementwise_pow_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ def sample_program_configs(self, draw):
input_data_type = draw(st.sampled_from([np.float32]))

def gen_input_data(*args, **kwargs):
# The value is small because we do pow operation. The result will be very large if input data is large.
return np.random.randint(
1, 20, size=(kwargs['shape'])).astype(kwargs['dtype'])
1, 5, size=(kwargs['shape'])).astype(kwargs['dtype'])

elementwise_pow_op = OpConfig(
type="elementwise_pow",
Expand Down Expand Up @@ -134,11 +135,14 @@ def sample_predictor_configs(self):

def add_ignore_pass_case(self):
def teller1(program_config, predictor_config):
return True
input_data_shape = program_config.inputs["input_data_x"].shape
if len(input_data_shape) != 4:
return True
return False

self.add_ignore_check_case(
teller1, IgnoreReasons.ACCURACY_ERROR,
"The elementwise_pow op's result is different from paddle, because paddle has bug on this op, wait paddle fix!"
"The elementwise_pow op's result is different from paddle, we should fix it as soon as possible!"
)

def test(self, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion lite/tests/unittest_py/op/test_elementwise_sub_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def teller1(program_config, predictor_config):

self.add_ignore_check_case(
teller1, IgnoreReasons.PADDLELITE_NOT_SUPPORT,
"The elementwise_min op's result is different from paddle in some case, we should fix it as soon as possible!"
"The elementwise_sub op's result is different from paddle in some case, we should fix it as soon as possible!"
)

def test(self, *args, **kwargs):
Expand Down
3 changes: 3 additions & 0 deletions tools/ci_tools/ci_autoscan_arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ function run_test() {
for target in ${targets[@]}; do
auto_scan_test $target
done
}

function get_summary() {
cd $WORKSPACE/lite/tests/unittest_py/op/
python3.8 ../global_var_model.py
cd $WORKSPACE/lite/tests/unittest_py/pass/
Expand Down Expand Up @@ -151,6 +153,7 @@ function main() {
done

pipeline $TARGET_LIST
get_summary

echo "Success for targets:" $TARGET_LIST
}
Expand Down
3 changes: 3 additions & 0 deletions tools/ci_tools/ci_autoscan_x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ function run_test() {
for target in ${targets[@]}; do
auto_scan_test $target
done
}

function get_summary() {
cd $WORKSPACE/lite/tests/unittest_py/op/
python$PYTHON_VERSION ../global_var_model.py
cd $WORKSPACE/lite/tests/unittest_py/pass/
Expand Down Expand Up @@ -116,6 +118,7 @@ function main() {
done

pipeline
get_summary

echo "Success for targets: Host,X86"
}
Expand Down