forked from huawei/mindspore2022
add st case for dynamic data-sink on gpu
This commit is contained in:
parent
9a6c79f069
commit
c6354d06ea
|
|
@ -18,7 +18,6 @@ from mindspore import nn, context
|
|||
from mindspore import ops as P
|
||||
from mindspore.train import DatasetHelper, connect_network_with_dataset
|
||||
import mindspore.dataset as ds
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend")
|
||||
|
||||
|
||||
def _exec_preprocess(network, is_train, dataset, dataset_sink_mode, sink_size=1, epoch_num=1, dataset_helper=None):
|
||||
|
|
@ -77,7 +76,13 @@ class Net(nn.Cell):
|
|||
@pytest.mark.platform_arm_ascend_training
|
||||
@pytest.mark.platform_x86_ascend_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_getnext_dynamic_pipeline():
|
||||
def test_getnext_dynamic_pipeline_ascend():
|
||||
"""
|
||||
Feature: sink one step of dynamic data sink.
|
||||
Description: datasets with dynamic shape as input.
|
||||
Expectation: success without assert exception.
|
||||
"""
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend")
|
||||
network = Net()
|
||||
dataset = ds.GeneratorDataset(
|
||||
dataset_generator, ["data1", "data2", "data3", "data4", "data5"])
|
||||
|
|
@ -86,10 +91,6 @@ def test_getnext_dynamic_pipeline():
|
|||
_eval_dataset_sink_process(network, dataset)
|
||||
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.platform_arm_ascend_training
|
||||
@pytest.mark.platform_x86_ascend_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_getnext_sink_size_dynamic_pipeline():
|
||||
"""
|
||||
Feature: arbitrary sink size of dynamic data sink.
|
||||
|
|
@ -110,3 +111,29 @@ def test_getnext_sink_size_dynamic_pipeline():
|
|||
last_inputs = data_item.items()
|
||||
for output, (_, last_input) in zip(outputs, last_inputs):
|
||||
assert output.shape == last_input.shape
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.platform_arm_ascend_training
|
||||
@pytest.mark.platform_x86_ascend_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_getnext_sink_size_dynamic_pipeline_ascend():
|
||||
"""
|
||||
Feature: arbitrary sink size of dynamic data sink.
|
||||
Description: datasets with dynamic shape as input.
|
||||
Expectation: success without assert exception.
|
||||
"""
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend")
|
||||
test_getnext_sink_size_dynamic_pipeline()
|
||||
|
||||
@pytest.mark.level0
|
||||
@pytest.mark.platform_x86_gpu_training
|
||||
@pytest.mark.env_onecard
|
||||
def test_getnext_sink_size_dynamic_pipeline_gpu():
|
||||
"""
|
||||
Feature: arbitrary sink size of dynamic data sink.
|
||||
Description: datasets with dynamic shape as input.
|
||||
Expectation: success without assert exception.
|
||||
"""
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
|
||||
test_getnext_sink_size_dynamic_pipeline()
|
||||
|
||||
Loading…
Reference in New Issue