diff --git a/examples/a2a3/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.py b/examples/a2a3/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention_manual_scope.py similarity index 100% rename from examples/a2a3/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.py rename to examples/a2a3/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention_manual_scope.py diff --git a/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py b/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll_manual_scope.py similarity index 100% rename from examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py rename to examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll_manual_scope.py diff --git a/examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/kernels/aiv/kernel_add.cpp b/examples/a2a3/tensormap_and_ringbuffer/scalar_data/kernels/aiv/kernel_add.cpp similarity index 100% rename from examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/kernels/aiv/kernel_add.cpp rename to examples/a2a3/tensormap_and_ringbuffer/scalar_data/kernels/aiv/kernel_add.cpp diff --git a/examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/kernels/aiv/kernel_noop.cpp b/examples/a2a3/tensormap_and_ringbuffer/scalar_data/kernels/aiv/kernel_noop.cpp similarity index 100% rename from examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/kernels/aiv/kernel_noop.cpp rename to examples/a2a3/tensormap_and_ringbuffer/scalar_data/kernels/aiv/kernel_noop.cpp diff --git a/examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/kernels/orchestration/scalar_data_orch.cpp b/examples/a2a3/tensormap_and_ringbuffer/scalar_data/kernels/orchestration/scalar_data_orch.cpp similarity index 100% rename from examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/kernels/orchestration/scalar_data_orch.cpp rename to examples/a2a3/tensormap_and_ringbuffer/scalar_data/kernels/orchestration/scalar_data_orch.cpp diff --git a/examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/test_scalar_data.py b/examples/a2a3/tensormap_and_ringbuffer/scalar_data/test_scalar_data.py similarity index 100% rename from examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/test_scalar_data.py rename to examples/a2a3/tensormap_and_ringbuffer/scalar_data/test_scalar_data.py diff --git a/examples/a5/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.py b/examples/a5/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention_manual_scope.py similarity index 100% rename from examples/a5/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.py rename to examples/a5/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention_manual_scope.py diff --git a/examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py b/examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll_manual_scope.py similarity index 100% rename from examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py rename to examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll_manual_scope.py diff --git a/examples/workers/l3/allreduce/__init__.py b/examples/workers/l3/allreduce/__init__.py new file mode 100644 index 0000000000..25708baecc --- /dev/null +++ b/examples/workers/l3/allreduce/__init__.py @@ -0,0 +1,9 @@ +# Copyright (c) PyPTO Contributors. +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of +# CANN Open Software License Agreement Version 2.0 (the "License"). +# Please refer to the License for details. You may not use this file except in compliance with the License. +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. +# See LICENSE in the root of the software repository for the full text of the License. +# ----------------------------------------------------------------------------------------------------------- +"""Package marker so ``test_*.py`` can do ``from .main import run``.""" diff --git a/examples/workers/l3/allreduce/test_allreduce.py b/examples/workers/l3/allreduce/test_allreduce.py new file mode 100644 index 0000000000..02172dd75b --- /dev/null +++ b/examples/workers/l3/allreduce/test_allreduce.py @@ -0,0 +1,31 @@ +# Copyright (c) PyPTO Contributors. +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of +# CANN Open Software License Agreement Version 2.0 (the "License"). +# Please refer to the License for details. You may not use this file except in compliance with the License. +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. +# See LICENSE in the root of the software repository for the full text of the License. +# ----------------------------------------------------------------------------------------------------------- +"""Hardware ST for examples/workers/l3/allreduce. + +Covers the demo only. The allreduce *algorithm* corpus — ring, twophase, ibing +and bidirectional-ring — lives in tests/st/worker/collectives/allreduce. +""" + +import pytest + +from .main import run + + +# a2a3 only, which is what this demo's own README and CLI default document. +# The algorithm itself runs on a5 — tests/st/worker/collectives/allreduce +# declares all four platforms — so widening this is likely safe, but nobody has +# exercised *this* demo there yet. +@pytest.mark.platforms(["a2a3sim", "a2a3"]) +@pytest.mark.runtime("tensormap_and_ringbuffer") +@pytest.mark.device_count(2) +def test_allreduce(st_platform, st_device_ids): + # run() takes (device_ids, platform) — the reverse of the single-device + # demos in this tree, which take (platform, device_id). + rc = run([int(d) for d in st_device_ids], platform=st_platform) + assert rc == 0 diff --git a/examples/workers/l3/ffn_tp_parallel/__init__.py b/examples/workers/l3/ffn_tp_parallel/__init__.py new file mode 100644 index 0000000000..25708baecc --- /dev/null +++ b/examples/workers/l3/ffn_tp_parallel/__init__.py @@ -0,0 +1,9 @@ +# Copyright (c) PyPTO Contributors. +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of +# CANN Open Software License Agreement Version 2.0 (the "License"). +# Please refer to the License for details. You may not use this file except in compliance with the License. +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. +# See LICENSE in the root of the software repository for the full text of the License. +# ----------------------------------------------------------------------------------------------------------- +"""Package marker so ``test_*.py`` can do ``from .main import run``.""" diff --git a/examples/workers/l3/l3_l2_message_queue/__init__.py b/examples/workers/l3/l3_l2_message_queue/__init__.py new file mode 100644 index 0000000000..25708baecc --- /dev/null +++ b/examples/workers/l3/l3_l2_message_queue/__init__.py @@ -0,0 +1,9 @@ +# Copyright (c) PyPTO Contributors. +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of +# CANN Open Software License Agreement Version 2.0 (the "License"). +# Please refer to the License for details. You may not use this file except in compliance with the License. +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. +# See LICENSE in the root of the software repository for the full text of the License. +# ----------------------------------------------------------------------------------------------------------- +"""Package marker so ``test_*.py`` can do ``from .main import run``.""" diff --git a/examples/workers/l3/l3_l2_orch_comm_stream/__init__.py b/examples/workers/l3/l3_l2_orch_comm_stream/__init__.py new file mode 100644 index 0000000000..25708baecc --- /dev/null +++ b/examples/workers/l3/l3_l2_orch_comm_stream/__init__.py @@ -0,0 +1,9 @@ +# Copyright (c) PyPTO Contributors. +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of +# CANN Open Software License Agreement Version 2.0 (the "License"). +# Please refer to the License for details. You may not use this file except in compliance with the License. +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. +# See LICENSE in the root of the software repository for the full text of the License. +# ----------------------------------------------------------------------------------------------------------- +"""Package marker so ``test_*.py`` can do ``from .main import run``."""