Skip to content

Repository files navigation

simpler — Simple Runtime

Make writing runtime simpler.

Modular runtime for building and executing task dependency graphs on Ascend devices with coordinated AICPU and AICore execution. Three independently compiled programs (Host .so, AICPU .so, AICore .o) work together through clearly defined APIs.

Where simpler sits in the stack

simpler is one layer of the hw-native-sys stack. Each repo below imports the ones to its left:

pto-isa ──▶ simpler ──▶ pypto ──▶ pypto-lib ──▶ pypto-serving
(tile ISA) (runtime) (compiler) (kernels) (serving)
▲
PTOAS (assembler, installed globally)

simpler owns task orchestration and dispatch at runtime: DAG submission, the AICPU/host scheduler, worker and device lifecycle, the host↔device handshake, and the DFX/profiling tooling that reads it back. simpler does not own kernel bodies, the tile ISA, graph compilation, or model/serving logic — those belong to the repos below.

RepositoryOwnsRelation to simpler
pto-isaPTO tile virtual ISA and its C++ tile-instruction libraryBuild-time dependency: AICore kernels in examples/ include its headers; revision pinned by pto_isa.pin
PTOASptoas — MLIR-based assembler/optimizer lowering PTO bytecode to device codeProvided as a global binary on dev boxes and CI; simpler neither builds nor vendors it
pyptoTensor/Tile programming framework and compiler (Python frontend → PTO IR → device code)Vendors simpler as a submodule at runtime/ and drives it through simpler's Python API
pypto-libTensor-level kernels and end-to-end model implementations (Qwen3, DeepSeek)Consumer of pypto + simpler; source of the cross-repo performance and regression workloads
pypto-servingLLM inference service and standalone model runnersTop of the stack — exercises simpler through the full serving path
pypto_top_level_documentsCross-repo design documents and proposalsWhere runtime designs spanning more than one repo are written down

To run a workload from any of these repos against this checkout of simpler, see .claude/skills/multi-repo-setup/SKILL.md.

Quick Start

# Clone the repository
git clone <repo-url>cd simpler
# Install (venv recommended — see `.claude/rules/venv-isolation.md`)
pip install --no-build-isolation -e '.[test]'# Run the vector example (simulation, no hardware required)
python examples/a2a3/tensormap_and_ringbuffer/vector_example/test_vector_example.py -p a2a3sim --manual include

PTO ISA headers are automatically cloned on first run. See Getting Started for manual setup and troubleshooting.

Platforms

PlatformDescriptionRequirements
a2a3Real Ascend A2/A3 hardwareCANN toolkit (ccec, aarch64 cross-compiler)
a2a3simThread-based A2/A3 simulationgcc/g++ only (no Ascend SDK needed)
a5Real Ascend A5 hardwareCANN toolkit (ccec, aarch64 cross-compiler)
a5simThread-based A5 simulationgcc/g++ only (no Ascend SDK needed)

Runtime Variants

Two runtimes under src/{arch}/runtime/, each with a different graph-building strategy:

RuntimeGraph built onUse case
host_build_graphHost CPUDevelopment, debugging
tensormap_and_ringbufferAICPU (device)Production workloads

See runtime docs per arch: a2a3, a5.

Testing

# Simulation scene tests (no hardware)
pytest examples tests/st --platform a2a3sim
# Hardware scene tests (requires Ascend device)# SDMA cases are quarantined by marker, as in CI; run them separately with -m sdma
pytest examples tests/st -m "not sdma" --platform a2a3 --device 4-7
# Python unit tests
pytest tests/ut -m "not requires_hardware" -v
# C++ unit tests
cmake -B tests/ut/cpp/build -S tests/ut/cpp && cmake --build tests/ut/cpp/build && ctest --test-dir tests/ut/cpp/build --output-on-failure

See Testing Guide for details.

Environment Setup

source /usr/local/Ascend/ascend-toolkit/latest/bin/setenv.bash
export ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest

Documentation

Building on simpler? Start at docs/user/ — how-to guides plus the Python and CLI reference. docs/README.md indexes every document, grouped by task. The entry points:

DocumentDescription
Capability SurveyStatus snapshot: what is shipped, gated, or design-only across topology (L2→L4), CANN launch, and comm engines
Chip-Level ArchitectureL2 single-chip: three-program model (host/AICPU/AICore), API layers, handshake protocol
Hierarchical Level RuntimeL0–L6 level model, component composition (Orchestrator / Scheduler / Worker)
Task FlowEnd-to-end data flow: Callable / TaskArgs / CallConfig handles, IWorker interface
OrchestratorDAG submission internals: submit flow, TensorMap, Scope, Ring, task state machine
SchedulerDAG dispatch internals: wiring/ready/completion queues, dispatch loop
Worker ManagerWorker pool, WorkerThread, THREAD/PROCESS modes, fork + mailbox mechanics
Getting StartedSetup, prerequisites, build process, configuration
Developer GuideDirectory structure, role ownership, conventions
Testing GuideCI pipeline, test types, writing new tests

Per-arch docs

Documenta2a3 archa5 arch
Runtimesa2a3/docs/runtimes.mda5/docs/runtimes.md
Platforma2a3/docs/platform.mda5/docs/platform.md

License

This project is licensed under the CANN Open Software License Agreement Version 2.0. See the LICENSE file for the full license text.

References

  • src/a2a3/platform/ - Platform implementations
  • src/a2a3/runtime/ - Runtime implementations
  • examples/ - Runnable examples, indexed: workers/ for the raw Worker API, a2a3/ and a5/ for @scene_test kernels
  • simpler_setup/ - SceneTestCase framework, runtime builder, kernel compiler
  • python/ - Python bindings and user-facing runtime API

About

No description, website, or topics provided.

Resources

Stars

34 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages