From 6609f706fe511db6c2cd11c8081cdfccc0f6f02b Mon Sep 17 00:00:00 2001 From: r1chardf1d0 Date: Mon, 17 May 2021 11:02:22 +0800 Subject: [PATCH] update akg && set random seed for stitch case --- akg | 2 +- model_zoo/official/nlp/bert/run_pretrain.py | 2 +- tests/st/ops/graph_kernel/test_dropoutgrad_reducesum_stitch.py | 1 + tests/st/ops/graph_kernel/test_layernorm_stitch.py | 1 + tests/st/ops/graph_kernel/test_softmax_stitch.py | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/akg b/akg index f1b98639da4..e869bb0010f 160000 --- a/akg +++ b/akg @@ -1 +1 @@ -Subproject commit f1b98639da49b0ff6a9aed61bc564f08c040fca4 +Subproject commit e869bb0010f9fc071a94f8def23655ce0acad2d2 diff --git a/model_zoo/official/nlp/bert/run_pretrain.py b/model_zoo/official/nlp/bert/run_pretrain.py index 1d762daf138..87564388c48 100644 --- a/model_zoo/official/nlp/bert/run_pretrain.py +++ b/model_zoo/official/nlp/bert/run_pretrain.py @@ -136,7 +136,7 @@ def _set_graph_kernel_context(device_target, enable_graph_kernel, is_auto_enable if enable_graph_kernel == "true" or is_auto_enable_graph_kernel: if device_target == 'GPU': context.set_context(enable_graph_kernel=True, - graph_kernel_flags="--enable_stitch_fusion=true --enable_parallel_fusion=true") + graph_kernel_flags="--enable_stitch_fusion=false --enable_parallel_fusion=true") else: logger.warning('Graph kernel only supports GPU back-end now, run with graph kernel off.') diff --git a/tests/st/ops/graph_kernel/test_dropoutgrad_reducesum_stitch.py b/tests/st/ops/graph_kernel/test_dropoutgrad_reducesum_stitch.py index 3dbc83bc5af..e879b14afb7 100644 --- a/tests/st/ops/graph_kernel/test_dropoutgrad_reducesum_stitch.py +++ b/tests/st/ops/graph_kernel/test_dropoutgrad_reducesum_stitch.py @@ -73,6 +73,7 @@ def get_dropoutgrad_reducesum_output(x, y, z, enable_stitch_fusion): def test_dropoutgrad_reducesum(shape, dtype): + np.random.seed(0) x = Tensor(np.random.normal(0, 1, shape).astype(dtype)) y = Tensor(np.random.normal(0, 1, shape).astype(dtype)) z = Tensor(np.random.normal(0, 1, shape).astype(dtype)) diff --git a/tests/st/ops/graph_kernel/test_layernorm_stitch.py b/tests/st/ops/graph_kernel/test_layernorm_stitch.py index 542b307a0fa..d0c842dc5cc 100644 --- a/tests/st/ops/graph_kernel/test_layernorm_stitch.py +++ b/tests/st/ops/graph_kernel/test_layernorm_stitch.py @@ -70,6 +70,7 @@ def get_layernorm_output(x, y, z, enable_stitch_fusion): def test_layernorm(shape1, shape2, dtype): + np.random.seed(0) x = Tensor(np.random.normal(0, 1, shape1).astype(dtype)) y = Tensor(np.random.normal(0, 1, shape1).astype(dtype)) z = Tensor(np.random.normal(0, 1, shape2).astype(dtype)) diff --git a/tests/st/ops/graph_kernel/test_softmax_stitch.py b/tests/st/ops/graph_kernel/test_softmax_stitch.py index 49994ca6e45..6c8d7fcd3e4 100644 --- a/tests/st/ops/graph_kernel/test_softmax_stitch.py +++ b/tests/st/ops/graph_kernel/test_softmax_stitch.py @@ -77,6 +77,7 @@ def get_softmax_output(x, y, enable_stitch_fusion): def test_softmax(shape, dtype): + np.random.seed(0) x = Tensor(np.random.normal(0, 1, shape).astype(dtype)) y = Tensor(np.random.normal(0, 1, shape).astype(dtype)) expect = get_softmax_output(x, y, False)