Skip to content
Draft
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
48eb244
Add PyTest-base testing infra for generic platform
Victor-Jung Dec 16, 2025
f918ca2
Remove nvidia-pyindex install (not needed anymore)
Victor-Jung Dec 16, 2025
77b3230
Add nvidia channel to the pip config instead of via nvidia-pyindex (d…
Victor-Jung Dec 16, 2025
d245a37
Update banshee.patch
Victor-Jung Dec 16, 2025
05c020a
Fix patch
Victor-Jung Dec 16, 2025
ec5efd5
Update banshee patch
Victor-Jung Dec 16, 2025
3760ced
Update CI docker
Victor-Jung Dec 17, 2025
b051153
Update generic platform CI to use PyTest
Victor-Jung Dec 17, 2025
eb6e31e
Lint and format
Victor-Jung Dec 17, 2025
42c9cd7
Cleanup pytest.ini
Victor-Jung Dec 17, 2025
89efc39
Apply Calin's comments
Victor-Jung Dec 18, 2025
1929253
Refactor to better support multiple platforms and add cortexm to pyte…
Victor-Jung Dec 18, 2025
393dd9d
Add PyTest suite for Siracusa and Siracusa Tiled
Victor-Jung Dec 18, 2025
54f3e9c
Alpha version of CI suite using PyTest for Siracusa and Siracusa Tiled
Victor-Jung Dec 19, 2025
b2014b2
Add L2_DOUBLEBUFFER_MODELS to the pytest suite, add -s to debug slow …
Victor-Jung Dec 19, 2025
5e1e63b
Fix typo
Victor-Jung Dec 19, 2025
b3789db
Make test use common build folder among a worker to improve compilati…
Victor-Jung Dec 19, 2025
f49f319
Cleanup unused runners and increase timeout for L3 models
Victor-Jung Dec 19, 2025
262a64b
format and lint
Victor-Jung Dec 19, 2025
70f1a19
Migrate Mempool tests to PyTest
Victor-Jung Jan 5, 2026
694f4f9
Migrate Snitch, Chimera, and SoftHier tests to PyTest
Victor-Jung Jan 5, 2026
432bfdf
Format and Lint
Victor-Jung Jan 5, 2026
ad13dcf
Migrate Snitch tiled tests to PyTest
Victor-Jung Jan 5, 2026
9dc75df
Use the pytest suite in CI for CortexM platform
Victor-Jung Jan 5, 2026
d3f73d4
Add Siracusa Tiled with Neureka to the pytest suite
Victor-Jung Jan 6, 2026
0f9b404
Format and lint
Victor-Jung Jan 6, 2026
50d0010
Fix SoftHier test runner call
Victor-Jung Jan 6, 2026
3f071a0
Format and lint
Victor-Jung Jan 6, 2026
e644108
Remove useless comments and add README for PyTest suite
Victor-Jung Jan 6, 2026
91284fe
Cleanup GitHub action for siracusa with neureka
Victor-Jung Jan 6, 2026
2ba9e44
Simplify siracusa tiled platform GitHub CI
Victor-Jung Jan 6, 2026
03820f8
Remove unused testRunner
Victor-Jung Jan 6, 2026
597a8a2
Update ccache generation to use PyTest suite
Victor-Jung Jan 6, 2026
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
10 changes: 2 additions & 8 deletions .github/workflows/_runner-generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: _runner-generic
docker-image:
required: true
type: string
test-names:
pytest-marker:
required: true
type: string

Expand All @@ -38,14 +38,8 @@ jobs:
key: ccache-ci
- name: Run Test
run: |
testNames="${{ inputs.test-names }}"
cd DeeployTest
mkdir -p /app/.ccache
export CCACHE_DIR=/app/.ccache
echo "$testNames" | while IFS= read -r testName; do
if [[ -n "$testName" ]]; then
echo "Running test: $testName"
python testRunner_generic.py -t Tests/$testName
fi
done
pytest test_generic.py -v -n 4 -m "${{ inputs.pytest-marker }}"
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/_select-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
elif [[ "${{ github.ref_name }}" == "main" ]]; then
IMAGE="ghcr.io/pulp-platform/deeploy:main"
else
IMAGE="ghcr.io/pulp-platform/deeploy:devel"
IMAGE="ghcr.io/victor-jung/deeploy:pytest-migration"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only draft, but don't forget this hard-coded path :)

fi
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"

Expand Down
61 changes: 2 additions & 59 deletions .github/workflows/ci-platform-generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,69 +35,12 @@ jobs:
with:
runner: ${{ needs.select-env.outputs.runner }}
docker-image: ${{ needs.select-env.outputs.image }}
test-names: |
Adder
MultIO
test1DConvolution
test2DConvolution
test1DDWConvolution
test2DDWConvolution
test1DPad
test2DPad
testGEMM
testMatMul
testMatMulAdd
testMaxPool
testRQConv
testRQMatMul
testReduceSum
testReduceMean
testSlice
testRequantizedDWConv
test2DRequantizedConv
iSoftmax
testFloatAdder
testFloatGEMM
testFloat2DConvolution
testFloat2DConvolutionBias
testFloat2DConvolutionZeroBias
testFloatLayerNorm
testFloatDiv
testFloat2DDWConvolution
testFloat2DDWConvolutionBias
testFloat2DDWConvolutionZeroBias
testFloatRelu
testFloatMaxPool
testFloatMatmul
testFloatReshapeWithSkipConnection
testFloatSoftmax
testFloatTranspose
testFloatMul
testFloatPowScalar
testFloatPowVector
testFloatSqrt
testFloatRMSNorm
Quant
Dequant
QuantizedLinear
pytest-marker: "kernels"

generic-models:
needs: select-env
uses: ./.github/workflows/_runner-generic.yml
with:
runner: ${{ needs.select-env.outputs.runner }}
docker-image: ${{ needs.select-env.outputs.image }}
test-names: |
simpleRegression
WaveFormer
simpleCNN
ICCT
ICCT_ITA
ICCT_8
ICCT_ITA_8
miniMobileNet
miniMobileNetv2
CCT/CCT_1_16_16_8
CCT/CCT_2_32_32_128_Opset20
testFloatDemoTinyViT
Autoencoder1D
pytest-marker: "models"
4 changes: 3 additions & 1 deletion Container/Dockerfile.deeploy
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ WORKDIR /app

COPY pyproject.toml ./

# Add nvidia channel to the pip configuration
RUN mkdir -p /etc && printf "[global]\nextra-index-url = https://pypi.ngc.nvidia.com\n" > /etc/pip.conf

# Install dependencies
RUN mkdir -p /root/.cargo/bin/ && \
apt-get update && \
Expand All @@ -103,7 +106,6 @@ RUN mkdir -p /root/.cargo/bin/ && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py && \
rm get-pip.py && \
pip install nvidia-pyindex && \
pip install toml-to-requirements && \
toml-to-req --toml-file pyproject.toml && \
pip install -r requirements.txt
Expand Down
119 changes: 119 additions & 0 deletions DeeployTest/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
#
# SPDX-License-Identifier: Apache-2.0

import os
from pathlib import Path

import coloredlogs
import pytest

from Deeploy.Logging import DEFAULT_FMT
from Deeploy.Logging import DEFAULT_LOGGER as log


def pytest_addoption(parser: pytest.Parser) -> None:
"""Native PyTest hook: add custom command-line options for Deeploy tests."""
parser.addoption(
"--skipgen",
action = "store_true",
default = False,
help = "Skip network generation step",
)
parser.addoption(
"--skipsim",
action = "store_true",
default = False,
help = "Skip simulation step (only generate and build)",
)
parser.addoption(
"--toolchain",
action = "store",
default = "LLVM",
help = "Compiler toolchain to use (LLVM or GCC)",
)
parser.addoption(
"--toolchain-install-dir",
action = "store",
default = os.environ.get("LLVM_INSTALL_DIR"),
help = "Path to toolchain installation directory",
)
parser.addoption(
"--cmake-args",
action = "append",
default = [],
help = "Additional CMake arguments (can be used multiple times)",
)


def pytest_configure(config: pytest.Config) -> None:
"""Native PyTest hook: configure pytest for Deeploy tests."""
# Register custom markers
config.addinivalue_line("markers", "generic: mark test as a Generic platform test")
config.addinivalue_line("markers", "kernels: mark test as a kernel test (individual operators)")
config.addinivalue_line("markers", "models: mark test as a model test (full networks)")
config.addinivalue_line("markers", "slow: mark test as slow running")

# Configure logging based on verbosity
verbosity = config.option.verbose
if verbosity >= 3:
coloredlogs.install(level = 'DEBUG', logger = log, fmt = DEFAULT_FMT)
elif verbosity >= 2:
coloredlogs.install(level = 'INFO', logger = log, fmt = DEFAULT_FMT)
else:
coloredlogs.install(level = 'WARNING', logger = log, fmt = DEFAULT_FMT)


@pytest.fixture(scope = "session")
def deeploy_test_dir():
"""Return the DeeployTest directory path."""
return Path(__file__).parent


@pytest.fixture(scope = "session")
def tests_dir(deeploy_test_dir):
"""Return the Tests directory path."""
return deeploy_test_dir / "Tests"


@pytest.fixture(scope = "session")
def toolchain_dir(request):
"""Return the toolchain installation directory."""
toolchain_install = request.config.getoption("--toolchain-install-dir")
if toolchain_install is None:
pytest.skip(reason = "LLVM_INSTALL_DIR not set")
return toolchain_install


@pytest.fixture(scope = "session")
def ccache_dir():
"""Setup and return ccache directory."""
ccache_path = Path("/app/.ccache")
if ccache_path.exists():
os.environ["CCACHE_DIR"] = str(ccache_path)
return ccache_path
return None


@pytest.fixture
def skipgen(request):
"""Return whether to skip network generation."""
return request.config.getoption("--skipgen")


@pytest.fixture
def skipsim(request):
"""Return whether to skip simulation."""
return request.config.getoption("--skipsim")


@pytest.fixture
def toolchain(request):
"""Return the toolchain to use."""
return request.config.getoption("--toolchain")


@pytest.fixture
def cmake_args(request):
"""Return additional CMake arguments."""
return request.config.getoption("--cmake-args")
38 changes: 38 additions & 0 deletions DeeployTest/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
#
# SPDX-License-Identifier: Apache-2.0

[pytest]
# Pytest configuration for Deeploy tests

# Test discovery patterns
python_files = test_*.py
python_classes = Test*
python_functions = test_*

# Minimum version
minversion = 6.0

# Add current directory to Python path
pythonpath = .

# Default options
addopts =
-ra
--strict-markers
--strict-config
--showlocals

# Test output
console_output_style = progress

# Logging
log_cli = false
log_cli_level = INFO
log_cli_format = %(levelname)s %(message)s

# Warnings
filterwarnings =
error
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
Loading
Loading