|
|
|
@@ -57,8 +57,7 @@ y = np.array([[7, 8, 9], [10, 11, 12]]).astype(np.float32) |
|
|
|
@security_off_wrap |
|
|
|
def test_async_dump(): |
|
|
|
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") |
|
|
|
pwd = os.getcwd() |
|
|
|
with tempfile.TemporaryDirectory(dir=pwd) as tmp_dir: |
|
|
|
with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: |
|
|
|
dump_path = os.path.join(tmp_dir, 'async_dump') |
|
|
|
dump_config_path = os.path.join(tmp_dir, 'async_dump.json') |
|
|
|
generate_dump_json(dump_path, dump_config_path, 'test_async_dump') |
|
|
|
@@ -79,8 +78,7 @@ def test_async_dump(): |
|
|
|
def run_e2e_dump(): |
|
|
|
if sys.platform != 'linux': |
|
|
|
return |
|
|
|
pwd = os.getcwd() |
|
|
|
with tempfile.TemporaryDirectory(dir=pwd) as tmp_dir: |
|
|
|
with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: |
|
|
|
dump_path = os.path.join(tmp_dir, 'e2e_dump') |
|
|
|
dump_config_path = os.path.join(tmp_dir, 'e2e_dump.json') |
|
|
|
generate_dump_json(dump_path, dump_config_path, 'test_e2e_dump') |
|
|
|
@@ -202,8 +200,7 @@ class ReluReduceMeanDenseRelu(Cell): |
|
|
|
@security_off_wrap |
|
|
|
def test_async_dump_net_multi_layer_mode1(): |
|
|
|
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") |
|
|
|
pwd = os.getcwd() |
|
|
|
with tempfile.TemporaryDirectory(dir=pwd) as tmp_dir: |
|
|
|
with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: |
|
|
|
dump_path = os.path.join(tmp_dir, 'async_dump_net_multi_layer_mode1') |
|
|
|
json_file_path = os.path.join(tmp_dir, "test_async_dump_net_multi_layer_mode1.json") |
|
|
|
generate_dump_json(dump_path, json_file_path, 'test_async_dump_net_multi_layer_mode1') |
|
|
|
@@ -251,8 +248,7 @@ def test_dump_with_diagnostic_path(): |
|
|
|
Data is expected to be dumped into MS_DIAGNOSTIC_DATA_PATH/debug_dump. |
|
|
|
""" |
|
|
|
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") |
|
|
|
pwd = os.getcwd() |
|
|
|
with tempfile.TemporaryDirectory(dir=pwd) as tmp_dir: |
|
|
|
with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: |
|
|
|
dump_config_path = os.path.join(tmp_dir, 'e2e_dump.json') |
|
|
|
generate_dump_json('', dump_config_path, 'test_e2e_dump') |
|
|
|
os.environ['MINDSPORE_DUMP_CONFIG'] = dump_config_path |
|
|
|
@@ -272,8 +268,7 @@ def run_e2e_dump_execution_graph(): |
|
|
|
"""Run e2e dump and check execution order.""" |
|
|
|
if sys.platform != 'linux': |
|
|
|
return |
|
|
|
pwd = os.getcwd() |
|
|
|
with tempfile.TemporaryDirectory(dir=pwd) as tmp_dir: |
|
|
|
with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: |
|
|
|
dump_path = os.path.join(tmp_dir, 'e2e_dump_exe_graph') |
|
|
|
dump_config_path = os.path.join(tmp_dir, 'e2e_dump.json') |
|
|
|
generate_dump_json(dump_path, dump_config_path, 'test_e2e_dump') |
|
|
|
@@ -301,9 +296,8 @@ def run_overflow_dump(): |
|
|
|
"""Run async dump and generate overflow""" |
|
|
|
if sys.platform != 'linux': |
|
|
|
return |
|
|
|
pwd = os.getcwd() |
|
|
|
overflow_x = np.array([60000, 60000]).astype(np.float16) |
|
|
|
with tempfile.TemporaryDirectory(dir=pwd) as tmp_dir: |
|
|
|
with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: |
|
|
|
dump_path = os.path.join(tmp_dir, 'overflow_dump') |
|
|
|
dump_config_path = os.path.join(tmp_dir, 'overflow_dump.json') |
|
|
|
generate_dump_json_with_overflow(dump_path, dump_config_path, 'test_async_dump', 3) |
|
|
|
@@ -354,10 +348,9 @@ def run_not_overflow_dump(): |
|
|
|
"""Run async dump and not generate overflow""" |
|
|
|
if sys.platform != 'linux': |
|
|
|
return |
|
|
|
pwd = os.getcwd() |
|
|
|
overflow_x = np.array([60000, 60000]).astype(np.float16) |
|
|
|
overflow_y = np.array([2, 2]).astype(np.float16) |
|
|
|
with tempfile.TemporaryDirectory(dir=pwd) as tmp_dir: |
|
|
|
with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: |
|
|
|
dump_path = os.path.join(tmp_dir, 'overflow_dump') |
|
|
|
dump_config_path = os.path.join(tmp_dir, 'overflow_dump.json') |
|
|
|
generate_dump_json_with_overflow(dump_path, dump_config_path, 'test_async_dump', 3) |
|
|
|
|