Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
86c25b5
test: add API baseline and characterization tests (requires hardware)
kalcohol Mar 22, 2026
58833a8
feat(logging): add unified logging infrastructure
kalcohol Mar 22, 2026
157e981
test: setup pytest framework with hardware markers
kalcohol Mar 22, 2026
df46fdd
ci: add comprehensive CI workflow and dev tools
kalcohol Mar 22, 2026
a0dfbe9
feat: add type annotations to public API
kalcohol Mar 22, 2026
dac45fe
refactor: improve code quality with logging, types, docs, and context…
kalcohol Mar 23, 2026
a4bfda3
test: add comprehensive test suite and CI configuration
kalcohol Mar 23, 2026
1e1f57b
chore: add gitignore and manual test scripts
kalcohol Mar 23, 2026
de098f7
chore: remove .sisyphus files from git tracking
kalcohol Mar 23, 2026
5ddbf34
style: fix ruff lint errors
kalcohol Mar 23, 2026
bfa8801
fix: resolve mypy type errors for Python 3.8 compatibility
kalcohol Mar 23, 2026
1aef832
fix: organize imports and remove unused/duplicate imports
kalcohol Mar 23, 2026
f17953e
fix: add type ignore comments for CFFI dynamic attributes
kalcohol Mar 23, 2026
f857b37
fix: use List from typing for Python 3.8 compatibility
kalcohol Mar 23, 2026
a369118
ci: install types-cffi for mypy type checking
kalcohol Mar 23, 2026
09b12a7
fix: add type ignore for np.frombuffer dtype argument
kalcohol Mar 23, 2026
1d025b1
fix: allow import without hardware, skip hardware tests in CI
kalcohol Mar 23, 2026
9746cc5
ci: update Python version to 3.10
kalcohol Mar 23, 2026
60be058
build: upgrade minimum Python version to 3.10
kalcohol Mar 23, 2026
51b455f
fix: restore ImportError for missing providers with CI detection
kalcohol Mar 23, 2026
682cf8d
refactor: update _axe_capi.py to Python 3.10+ type syntax
kalcohol Mar 23, 2026
f93de47
refactor: update _node.py to Python 3.10+ type syntax
kalcohol Mar 23, 2026
fbd2df9
refactor: update _providers.py to Python 3.10+ type syntax
kalcohol Mar 23, 2026
6a05e06
refactor: update _axclrt_capi.py to Python 3.10+ type syntax
kalcohol Mar 23, 2026
98fc620
refactor: update _base_session.py types and add docstrings
kalcohol Mar 23, 2026
b4f46b3
refactor: update _axclrt.py types and add docstrings
kalcohol Mar 23, 2026
69c0996
refactor: update _axe.py types and add docstrings
kalcohol Mar 23, 2026
7341b6e
docs: add manual hardware testing guide in Chinese
kalcohol Mar 23, 2026
a922568
refactor: update _session.py types, add docstrings, remove redundant …
kalcohol Mar 23, 2026
19fa812
fix: avoid loading axcl_rt when only using AxEngineExecutionProvider
Mar 23, 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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
pip install types-cffi

- name: Lint with ruff
run: ruff check .

- name: Type check with mypy
run: mypy axengine

- name: Test with pytest
run: pytest -m "not hardware" --cov=axengine --cov-report=term-missing
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.sisyphus/
__pycache__/
.coverage
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args: [--python-version=3.8]
41 changes: 32 additions & 9 deletions axengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,38 @@
# thanks to community contributors list below:
# zylo117: https://github.com/zylo117, first implementation of the axclrt backend

from ._providers import axengine_provider_name, axclrt_provider_name
from ._providers import get_all_providers, get_available_providers
import os

from ._logging import get_logger
from ._node import NodeArg as NodeArg
from ._providers import (
axclrt_provider_name as axclrt_provider_name,
)
from ._providers import (
axengine_provider_name as axengine_provider_name,
)
from ._providers import (
get_all_providers as get_all_providers,
)
from ._providers import (
get_available_providers,
)
from ._session import InferenceSession as InferenceSession
from ._session import SessionOptions as SessionOptions

logger = get_logger(__name__)

# check if axclrt is installed, or is a supported chip(e.g. AX650, AX620E etc.)
_available_providers = get_available_providers()
if not _available_providers:
raise ImportError(
f"No providers found. Please make sure you have installed one of the following: {get_all_providers()}")
print("[INFO] Available providers: ", _available_providers)
_is_test_or_ci = bool(os.getenv("CI") or os.getenv("PYTEST_CURRENT_TEST"))

from ._node import NodeArg
from ._session import SessionOptions, InferenceSession
if not _available_providers:
_provider_error_message = (
"No execution providers available. Install the required hardware libraries "
"(ax_engine or axcl_rt) and check that the target hardware/driver is available."
)
if _is_test_or_ci:
logger.warning(_provider_error_message)
else:
raise ImportError(_provider_error_message)
else:
logger.info("Available providers: %s", _available_providers)
Loading
Loading