Introduction
tensor.cx is an independent, Apache-2.0 licensed project for exploring tensor execution. A Python API sits above a backend-neutral C++20 core, with CPU, Apple Metal, and optional CUDA and Vulkan backends.
The project is pre-alpha. It is useful for runtime experiments, studying backend contracts, and testing small tensor workloads. APIs may change.
Start here
Section titled “Start here”- Install a CPU environment from source or a reviewed wheel artifact.
- Run your first tensor operation.
- Read the backend support matrix before enabling a GPU.
- Try matmul and a small inference pipeline.
- Explore the feature overview and remaining work.
- Read the execution experiments for separate OpenCL and software-device validation.
A deliberately compact runtime
Section titled “A deliberately compact runtime”- Contiguous row-major tensors, with
float32, a smallerint32operation set, and boolean masks. - Explicit device transfers and synchronous execution.
- Tensor/scalar arithmetic and broadcasting, batched/vector matmul, all/multi-axis reductions, log/sqrt/abs and selection operations including topk.
- Basic slicing/indexing, concat/stack/split, comparisons,
whereand boolean masks. - Linear, affine normalization, embedding and scaled dot-product attention.
- CPU references for accelerator correctness checks.
- A separate experimental kernel API with persistent compilation caching.
- Installation, operation support and memory diagnostics.
- DLPack storage sharing and an optional PyTorch inference custom op.
- CPU/CUDA/Vulkan profiling, compilation measurements and bounded CUDA/Vulkan memory reuse,
with direct CUDA/Vulkan
emptyallocation and unspecified initial contents.
Autograd, model training, asynchronous streams, distributed execution, and broad dtype coverage are outside the current runtime. There is no general PyTorch model or training compatibility promise.
Read the implementation
Section titled “Read the implementation”The source repository contains the runtime, tests, and engineering records. These guides are a curated user entry point. PROJECT.md remains the authoritative phase ledger; architecture and validation records stay with the implementation.