tensorstudio 1.0.0rc2__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/.github/workflows/ci.yml +12 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/.github/workflows/publish-testpypi.yml +1 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/.github/workflows/publish.yml +16 -4
- tensorstudio-1.1.0/CHANGELOG.md +89 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/CMakeLists.txt +3 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/PKG-INFO +49 -32
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/README.md +48 -31
- tensorstudio-1.1.0/benchmark_all.py +50 -0
- tensorstudio-1.1.0/benchmarks/__init__.py +2 -0
- tensorstudio-1.1.0/benchmarks/bench_conv2d.py +8 -0
- tensorstudio-1.1.0/benchmarks/bench_pooling.py +8 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/benchmark_report.py +307 -28
- tensorstudio-1.1.0/benchmarks/results.md +353 -0
- tensorstudio-1.1.0/benchmarks/results_conv2d.md +39 -0
- tensorstudio-1.1.0/benchmarks/results_matmul.md +45 -0
- tensorstudio-1.1.0/benchmarks/results_pooling.md +45 -0
- tensorstudio-1.1.0/benchmarks/results_reductions.md +75 -0
- tensorstudio-1.1.0/benchmarks/results_tensor_ops.md +309 -0
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Autograde}/autograd.md +1 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/Autograde/index.md +1 -1
- tensorstudio-1.1.0/docs/Benchmarks/index.md +86 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/Hardware/cpu-backend.md +4 -4
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Hardware}/windows.md +1 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/Neural Networks/modules.md +40 -0
- tensorstudio-1.0.0rc2/docs/nn.md → tensorstudio-1.1.0/docs/Neural Networks/nn.md +45 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/Neural Networks/training.md +1 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/Roadmap/index.md +8 -7
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Usage}/api.md +77 -5
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Usage}/data.md +2 -2
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/Usage/serialization.md +1 -1
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Usage}/tensors.md +34 -3
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/development.md +11 -4
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/index.md +20 -19
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/publishing.md +33 -14
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/quickstart.md +43 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/serialization.md +2 -2
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/ops.hpp +36 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/version.hpp +1 -1
- tensorstudio-1.1.0/mkdocs.yml +44 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/pyproject.toml +1 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/_C.pyi +45 -8
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/__init__.py +7 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/_version.py +1 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/nn/__init__.py +20 -1
- tensorstudio-1.1.0/python/tensorstudio/nn/functional.py +167 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/nn/losses.py +14 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/nn/modules.py +165 -0
- tensorstudio-1.1.0/python/tensorstudio/ops.py +262 -0
- tensorstudio-1.1.0/src/bindings/bind_ops.cpp +118 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/bindings/bind_tensor.cpp +44 -10
- tensorstudio-1.1.0/src/core/ops.cpp +2356 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/tensor.cpp +128 -6
- tensorstudio-1.1.0/test_all.py +102 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_autograd.py +82 -0
- tensorstudio-1.1.0/tests/test_benchmark_report.py +71 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_import.py +1 -1
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_nn.py +97 -0
- tensorstudio-1.1.0/tests/test_ops.py +314 -0
- tensorstudio-1.0.0rc2/CHANGELOG.md +0 -40
- tensorstudio-1.0.0rc2/benchmarks/results.md +0 -214
- tensorstudio-1.0.0rc2/benchmarks/results_matmul.md +0 -38
- tensorstudio-1.0.0rc2/docs/Benchmarks/index.md +0 -53
- tensorstudio-1.0.0rc2/docs/Usage/tensors.md +0 -139
- tensorstudio-1.0.0rc2/mkdocs.yml +0 -32
- tensorstudio-1.0.0rc2/python/tensorstudio/nn/functional.py +0 -75
- tensorstudio-1.0.0rc2/python/tensorstudio/ops.py +0 -157
- tensorstudio-1.0.0rc2/src/bindings/bind_ops.cpp +0 -40
- tensorstudio-1.0.0rc2/src/core/ops.cpp +0 -1093
- tensorstudio-1.0.0rc2/tests/test_ops.py +0 -63
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/.github/workflows/wheels.yml +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/.gitignore +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/.pre-commit-config.yaml +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/CONTRIBUTING.md +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/LICENSE +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/SECURITY.md +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/bench_activations.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/bench_autograd.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/bench_elementwise.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/bench_matmul.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/bench_reductions.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/bench_tensor_ops.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/benchmarks/bench_training_loop.py +0 -0
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Hardware}/linux.md +0 -0
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Hardware}/macos.md +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/docs/Usage/numpy-interop.md +0 -0
- {tensorstudio-1.0.0rc2/docs → tensorstudio-1.1.0/docs/Usage}/optim.md +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/examples/basic_tensor_ops.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/examples/linear_regression.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/examples/save_load_model.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/examples/tiny_mlp.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/autograd.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/device.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/dtype.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/errors.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/module.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/optim.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/random.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/serialization.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/shape.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/storage.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/include/tensorstudio/tensor.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/autograd.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/data/__init__.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/data/dataloader.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/data/dataset.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/errors.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/grad_mode.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/optim/__init__.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/optim/adam.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/optim/adamw.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/optim/lr_scheduler.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/optim/sgd.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/optim/utils.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/py.typed +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/serialization.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/tensor.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/python/tensorstudio/typing.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/bindings/bind_autograd.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/bindings/bind_nn.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/bindings/bind_optim.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/bindings/bindings.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/bindings/bindings.hpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/autograd.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/device.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/dtype.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/errors.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/module.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/optim.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/random.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/serialization.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/shape.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/src/core/storage.cpp +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_data.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_numpy_interop.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_optim.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_serialization.py +0 -0
- {tensorstudio-1.0.0rc2 → tensorstudio-1.1.0}/tests/test_tensor.py +0 -0
|
@@ -30,6 +30,10 @@ jobs:
|
|
|
30
30
|
run: mypy --python-version ${{ matrix.python-version }} python/tensorstudio
|
|
31
31
|
- name: Tests
|
|
32
32
|
run: pytest -q
|
|
33
|
+
- name: Runner scripts
|
|
34
|
+
run: |
|
|
35
|
+
python test_all.py --help
|
|
36
|
+
python benchmark_all.py --help
|
|
33
37
|
- name: Example
|
|
34
38
|
run: python examples/basic_tensor_ops.py
|
|
35
39
|
|
|
@@ -59,6 +63,10 @@ jobs:
|
|
|
59
63
|
run: mypy --python-version ${{ matrix.python-version }} python/tensorstudio
|
|
60
64
|
- name: Tests
|
|
61
65
|
run: pytest -q
|
|
66
|
+
- name: Runner scripts
|
|
67
|
+
run: |
|
|
68
|
+
python test_all.py --help
|
|
69
|
+
python benchmark_all.py --help
|
|
62
70
|
- name: Example
|
|
63
71
|
run: python examples/basic_tensor_ops.py
|
|
64
72
|
|
|
@@ -88,5 +96,9 @@ jobs:
|
|
|
88
96
|
run: mypy --python-version ${{ matrix.python-version }} python/tensorstudio
|
|
89
97
|
- name: Tests
|
|
90
98
|
run: pytest -q
|
|
99
|
+
- name: Runner scripts
|
|
100
|
+
run: |
|
|
101
|
+
python test_all.py --help
|
|
102
|
+
python benchmark_all.py --help
|
|
91
103
|
- name: Example
|
|
92
104
|
run: python examples/basic_tensor_ops.py
|
|
@@ -4,9 +4,6 @@ on:
|
|
|
4
4
|
workflow_dispatch:
|
|
5
5
|
release:
|
|
6
6
|
types: [published]
|
|
7
|
-
push:
|
|
8
|
-
tags:
|
|
9
|
-
- "v1.0.0"
|
|
10
7
|
|
|
11
8
|
permissions:
|
|
12
9
|
contents: read
|
|
@@ -97,11 +94,26 @@ jobs:
|
|
|
97
94
|
needs: [windows_wheels, linux_wheels, macos_wheels, build_sdist]
|
|
98
95
|
runs-on: ubuntu-latest
|
|
99
96
|
environment: pypi
|
|
97
|
+
env:
|
|
98
|
+
HAS_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN != '' }}
|
|
100
99
|
steps:
|
|
101
100
|
- uses: actions/download-artifact@v4
|
|
102
101
|
with:
|
|
103
102
|
pattern: dist-*
|
|
104
103
|
path: dist
|
|
105
104
|
merge-multiple: true
|
|
106
|
-
- name:
|
|
105
|
+
- name: Verify artifacts
|
|
106
|
+
run: |
|
|
107
|
+
python -m pip install -U twine
|
|
108
|
+
python -m twine check dist/*
|
|
109
|
+
- name: Publish to PyPI with configured API token
|
|
110
|
+
if: env.HAS_PYPI_TOKEN == 'true'
|
|
107
111
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
112
|
+
with:
|
|
113
|
+
password: ${{ secrets.PYPI_TOKEN }}
|
|
114
|
+
skip-existing: true
|
|
115
|
+
- name: Publish to PyPI with Trusted Publishing
|
|
116
|
+
if: env.HAS_PYPI_TOKEN != 'true'
|
|
117
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
118
|
+
with:
|
|
119
|
+
skip-existing: true
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 1.1.0 - 2026-07-07
|
|
6
|
+
|
|
7
|
+
- Added native CPU NCHW `conv2d` with stride, padding, dilation, optional bias,
|
|
8
|
+
and reverse-mode gradients for input, weight, and bias.
|
|
9
|
+
- Added `tensorstudio.conv2d`, `tensorstudio.ops.conv2d`,
|
|
10
|
+
`tensorstudio.nn.functional.conv2d`, and `tensorstudio.nn.Conv2d`.
|
|
11
|
+
- Added convolution tests, finite-difference autograd coverage, and a
|
|
12
|
+
standalone convolution benchmark script.
|
|
13
|
+
- Added convolution rows to the full benchmark report and updated docs to mark
|
|
14
|
+
convolution as partially implemented rather than missing.
|
|
15
|
+
- Added native CPU NCHW `max_pool2d` and `avg_pool2d` operations with autograd,
|
|
16
|
+
Python top-level and functional APIs, `nn.MaxPool2d`, `nn.AvgPool2d`, tests,
|
|
17
|
+
docs, and benchmark coverage.
|
|
18
|
+
- Added native single-axis `sum`, `mean`, `max`, and `min` reductions with
|
|
19
|
+
`keepdims` and reverse-mode gradients.
|
|
20
|
+
- Added a typed contiguous 2D fast path for common axis `sum`/`mean`
|
|
21
|
+
reductions.
|
|
22
|
+
- Added `nn.softmax`, `nn.log_softmax`, `nn.cross_entropy`, and
|
|
23
|
+
`nn.CrossEntropyLoss` for small multiclass classification workloads.
|
|
24
|
+
- Added native `astype`, `concat`, and `stack` operations with Python wrappers,
|
|
25
|
+
Tensor methods for casting, and autograd support for floating tensors.
|
|
26
|
+
|
|
27
|
+
## 1.0.1
|
|
28
|
+
|
|
29
|
+
- Added `test_all.py` for one-command local release checks covering lint,
|
|
30
|
+
typing, tests, examples, docs, build, and package metadata validation.
|
|
31
|
+
- Added `benchmark_all.py` for one-command full benchmark report generation.
|
|
32
|
+
- Added explicit benchmark win columns for NumPy, TensorFlow, PyTorch, and JAX,
|
|
33
|
+
plus fastest-library reporting for each benchmark case.
|
|
34
|
+
- Hardened release publishing triggers so future `v*` tags are eligible for
|
|
35
|
+
the publish workflow instead of only `v1.0.0`.
|
|
36
|
+
- Updated docs to describe benchmark interpretation, local release checks, and
|
|
37
|
+
site navigation for benchmark, hardware, roadmap, and usage pages.
|
|
38
|
+
|
|
39
|
+
## 1.0.0
|
|
40
|
+
|
|
41
|
+
- Promoted the CPU-only stable API foundation from release candidate status.
|
|
42
|
+
- Added direct C++ buffer copies for NumPy import/export paths.
|
|
43
|
+
- Added faster typed tensor construction, flat-vector export, contiguous tensor
|
|
44
|
+
copy, and floating-point optimizer update paths.
|
|
45
|
+
- Added a `float32` contiguous matmul fast path that avoids double accumulation
|
|
46
|
+
and per-element dtype conversion for the common training dtype.
|
|
47
|
+
- Added typed contiguous reduction kernels for `sum` and `mean`.
|
|
48
|
+
- Expanded benchmark reports with framework version metadata and PyTorch
|
|
49
|
+
win/loss summaries.
|
|
50
|
+
- Updated documentation to describe honest `1.0.0` performance boundaries.
|
|
51
|
+
|
|
52
|
+
## 1.0.0rc2
|
|
53
|
+
|
|
54
|
+
- Added `*_like` tensor creation helpers for zero, one, full, empty, uniform
|
|
55
|
+
random, and normal random tensors.
|
|
56
|
+
- Added `nn.Identity`, `nn.LeakyReLU`, `nn.Softplus`,
|
|
57
|
+
`nn.BCEWithLogitsLoss`, `nn.HuberLoss`, and matching functional helpers.
|
|
58
|
+
- Expanded `nn.Module` with child/module introspection, trainable parameter
|
|
59
|
+
filtering, freeze/unfreeze helpers, parameter counting, recursive `apply`,
|
|
60
|
+
and richer `repr` details.
|
|
61
|
+
- Added optimizer utilities for gradient clipping and lightweight
|
|
62
|
+
`StepLR`/`ExponentialLR` learning-rate schedulers.
|
|
63
|
+
- Added `len(DataLoader)` batch counting with `drop_last` support.
|
|
64
|
+
- Added typed C++ fast paths for contiguous elementwise/unary kernels and a
|
|
65
|
+
contiguous matmul kernel that avoids per-element Tensor method dispatch.
|
|
66
|
+
- Bumped the next release candidate after public `1.0.0rc1` artifacts.
|
|
67
|
+
|
|
68
|
+
## 1.0.0rc1
|
|
69
|
+
|
|
70
|
+
- Release-candidate hardening toward a CPU-only v1.0.0 API foundation.
|
|
71
|
+
- Added additional tensor creation helpers, math operations, comparisons,
|
|
72
|
+
no-grad mode, state APIs, data utilities, and Windows-first CI/release docs.
|
|
73
|
+
- This is not final v1.0.0; remaining platform checklist items must pass before
|
|
74
|
+
a stable release.
|
|
75
|
+
|
|
76
|
+
## 0.1.1
|
|
77
|
+
|
|
78
|
+
- Publishable wheel release for CPython 3.10-3.13.
|
|
79
|
+
- Fixed MSVC build portability by removing non-portable `ssize_t` usage.
|
|
80
|
+
- Updated wheel CI to build 64-bit Windows wheels and modern Linux wheels.
|
|
81
|
+
- Expanded documentation with MkDocs navigation and detailed usage guides.
|
|
82
|
+
|
|
83
|
+
## 0.1.0
|
|
84
|
+
|
|
85
|
+
- Initial experimental release.
|
|
86
|
+
- C++20 CPU tensor core with Python bindings.
|
|
87
|
+
- Basic broadcasting, matrix multiplication, reductions, activations, and views.
|
|
88
|
+
- Reverse-mode autograd for the initial operation set.
|
|
89
|
+
- Python `nn`, `optim`, serialization, examples, tests, docs, and CI workflows.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.18)
|
|
2
2
|
|
|
3
|
-
project(tensorstudio VERSION 1.0.
|
|
3
|
+
project(tensorstudio VERSION 1.0.1 LANGUAGES CXX)
|
|
4
4
|
|
|
5
|
+
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
|
|
6
|
+
set(PYBIND11_FINDPYTHON ON)
|
|
5
7
|
find_package(pybind11 CONFIG REQUIRED)
|
|
6
8
|
|
|
7
9
|
set(TENSORSTUDIO_CORE_SOURCES
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tensorstudio
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: TensorStudio is a compact C++ tensor and autograd engine with a Python API for learning, experimentation, and lightweight ML workloads.
|
|
5
5
|
Keywords: tensor,autograd,machine-learning,cpp,pybind11
|
|
6
6
|
Author: TensorStudio contributors
|
|
@@ -65,14 +65,12 @@ Description-Content-Type: text/markdown
|
|
|
65
65
|
TensorStudio is a compact C++ tensor and autograd engine with a Python API for
|
|
66
66
|
learning, experimentation, and lightweight ML workloads.
|
|
67
67
|
|
|
68
|
-
TensorStudio `1.0
|
|
69
|
-
|
|
70
|
-
mature ML frameworks. The final `1.0.0` version should only be tagged after the
|
|
71
|
-
Windows, Linux, and macOS release checklist passes.
|
|
68
|
+
TensorStudio `1.1.0` is a CPU-only stable API foundation. It is eager-only,
|
|
69
|
+
intentionally small, and not a replacement for mature ML frameworks.
|
|
72
70
|
|
|
73
71
|
## Install
|
|
74
72
|
|
|
75
|
-
From PyPI
|
|
73
|
+
From PyPI:
|
|
76
74
|
|
|
77
75
|
```bash
|
|
78
76
|
python -m pip install tensorstudio
|
|
@@ -154,6 +152,8 @@ d = ts.linspace(0.0, 1.0, 5)
|
|
|
154
152
|
|
|
155
153
|
print(a.shape, a.strides, a.device, a.is_contiguous)
|
|
156
154
|
print((b.clamp(0.2, 0.8) + 1).mean().item())
|
|
155
|
+
print(b.sum(axis=1).tolist())
|
|
156
|
+
print(ts.concat([b, b], axis=0).shape, b.astype("float64").dtype)
|
|
157
157
|
print(c.tolist(), d.tolist())
|
|
158
158
|
print(ts.zeros_like(b).shape, ts.randn_like(b, seed=11).dtype)
|
|
159
159
|
```
|
|
@@ -219,8 +219,8 @@ for features, targets in loader:
|
|
|
219
219
|
print(features.shape, targets.shape)
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
The v1
|
|
223
|
-
|
|
222
|
+
The v1 DataLoader is intentionally single-process so it works cleanly on
|
|
223
|
+
Windows without multiprocessing setup.
|
|
224
224
|
|
|
225
225
|
## Performance
|
|
226
226
|
|
|
@@ -229,34 +229,45 @@ performance is still experimental. Benchmarks live in `benchmarks/` and can be
|
|
|
229
229
|
run locally:
|
|
230
230
|
|
|
231
231
|
```bash
|
|
232
|
+
python benchmark_all.py
|
|
232
233
|
python benchmarks/benchmark_report.py
|
|
233
234
|
```
|
|
234
235
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
`benchmark_all.py` writes `benchmarks/results.md` and includes explicit win
|
|
237
|
+
columns for NumPy, TensorFlow, PyTorch, and JAX when those libraries are
|
|
238
|
+
available locally.
|
|
239
|
+
|
|
240
|
+
On one Windows CPython 3.10 development run reporting `1.1.0`, TensorStudio
|
|
241
|
+
beat NumPy on 23 small operation benchmark cases and lost on 80
|
|
242
|
+
NumPy-comparable cases. Against PyTorch CPU `2.12.1+cpu`, TensorStudio won 74
|
|
243
|
+
local cases and lost 34. The strongest local wins were small eager operations,
|
|
244
|
+
small contiguous axis reductions, and the simple NumPy convolution/pooling
|
|
245
|
+
references where framework dispatch or Python loops dominate; larger matrix
|
|
246
|
+
multiplication, PyTorch convolution and pooling, larger axis reductions, larger
|
|
247
|
+
transcendental activations, and larger autograd workloads remain faster in
|
|
248
|
+
PyTorch and NumPy.
|
|
249
|
+
See `benchmarks/results.md` for the full table, platform details, and exact
|
|
250
|
+
timings.
|
|
242
251
|
|
|
243
252
|
Snapshot from that local run:
|
|
244
253
|
|
|
245
|
-
| operation | shape | TensorStudio
|
|
246
|
-
|
|
247
|
-
| `sigmoid` | `(
|
|
248
|
-
| `mean` | `(
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
251
|
-
| `matmul` | `(256, 256)` | 4.
|
|
254
|
+
| operation | shape | TensorStudio | NumPy | PyTorch CPU | TS vs NumPy | TS vs PyTorch |
|
|
255
|
+
|---|---:|---:|---:|---:|---:|---:|
|
|
256
|
+
| `sigmoid` | `(32,)` | 0.0017 ms | 0.0036 ms | 0.0580 ms | 2.1201x | 33.8536x |
|
|
257
|
+
| `mean` | `(32,)` | 0.0018 ms | 0.0078 ms | 0.0127 ms | 4.2927x | 7.0047x |
|
|
258
|
+
| `sum_axis1` | `(16, 16)` | 0.0021 ms | 0.0029 ms | 0.0068 ms | 1.3727x | 3.2193x |
|
|
259
|
+
| `chain_relu` | `(128,)` | 0.0086 ms | 0.0039 ms | 0.0559 ms | 0.4478x | 6.5042x |
|
|
260
|
+
| `matmul` | `(256, 256)` | 4.1154 ms | 0.3679 ms | 0.0931 ms | 0.0894x | 0.0226x |
|
|
261
|
+
| `conv2d_3x3_padding1` | `(1, 1, 8, 8)` | 0.1788 ms | 1.2241 ms | 0.0131 ms | 6.8478x | 0.0731x |
|
|
262
|
+
| `max_pool2d_2x2` | `(1, 1, 16, 16)` | 0.0146 ms | 0.2649 ms | 0.0062 ms | 18.1659x | 0.4242x |
|
|
263
|
+
| `avg_pool2d_2x2` | `(1, 1, 16, 16)` | 0.0139 ms | 0.5486 ms | 0.0052 ms | 39.5974x | 0.3748x |
|
|
264
|
+
| `elementwise_backward` | `(1024,)` | 2.3885 ms | n/a | 0.1947 ms | n/a | 0.0815x |
|
|
252
265
|
|
|
253
|
-
Speedup is `
|
|
254
|
-
TensorStudio.
|
|
255
|
-
pre-optimization run was about 259 ms for the same `(256, 256)` case on this
|
|
256
|
-
machine.
|
|
266
|
+
Speedup is `competitor median / TensorStudio median`, so values above `1.0x`
|
|
267
|
+
favor TensorStudio.
|
|
257
268
|
|
|
258
|
-
Do not treat these results as universal. TensorStudio does not
|
|
259
|
-
|
|
269
|
+
Do not treat these results as universal. TensorStudio does not claim to be
|
|
270
|
+
faster than NumPy, TensorFlow, PyTorch, or JAX overall.
|
|
260
271
|
|
|
261
272
|
## Save And Load
|
|
262
273
|
|
|
@@ -276,6 +287,7 @@ unsafe because pickle can execute arbitrary code.
|
|
|
276
287
|
|
|
277
288
|
```bash
|
|
278
289
|
python -m pip install -e ".[dev,docs]"
|
|
290
|
+
python test_all.py --skip-build
|
|
279
291
|
ruff check .
|
|
280
292
|
mypy python/tensorstudio
|
|
281
293
|
pytest -q
|
|
@@ -288,6 +300,7 @@ scikit-build-core, and C++20.
|
|
|
288
300
|
|
|
289
301
|
## Release Checklist
|
|
290
302
|
|
|
303
|
+
- `python test_all.py` passes locally.
|
|
291
304
|
- `ruff check .` passes.
|
|
292
305
|
- `mypy python/tensorstudio` passes.
|
|
293
306
|
- `pytest -q` passes on Windows, Linux, and macOS.
|
|
@@ -312,10 +325,14 @@ tokens or print secrets.
|
|
|
312
325
|
- CPU backend only.
|
|
313
326
|
- Eager execution only.
|
|
314
327
|
- No CUDA or Metal backend yet.
|
|
328
|
+
- No BLAS-backed matrix multiplication yet.
|
|
315
329
|
- No graph compiler or distributed runtime.
|
|
316
|
-
-
|
|
330
|
+
- Convolution and pooling support are currently limited to CPU NCHW
|
|
331
|
+
`conv2d`, `max_pool2d`, and `avg_pool2d` style workloads.
|
|
332
|
+
- Reductions support all-element or single-axis reductions, not tuple-axis
|
|
333
|
+
reductions yet.
|
|
317
334
|
- No sparse tensors or advanced indexing.
|
|
318
|
-
-
|
|
335
|
+
- Dtype casting is basic and does not include a full promotion/casting policy.
|
|
319
336
|
- Experimental performance; benchmarks are local references only.
|
|
320
337
|
- Pickle serialization is for trusted TensorStudio objects only.
|
|
321
338
|
|
|
@@ -323,8 +340,8 @@ tokens or print secrets.
|
|
|
323
340
|
|
|
324
341
|
- CUDA backend
|
|
325
342
|
- Graph/JIT mode
|
|
326
|
-
-
|
|
327
|
-
-
|
|
343
|
+
- Broader convolution ops, adaptive/global pooling, and image-model examples
|
|
344
|
+
- Richer dataset utilities
|
|
328
345
|
- Model zoo examples
|
|
329
346
|
- ONNX import/export
|
|
330
347
|
- Improved memory allocator
|
|
@@ -7,14 +7,12 @@
|
|
|
7
7
|
TensorStudio is a compact C++ tensor and autograd engine with a Python API for
|
|
8
8
|
learning, experimentation, and lightweight ML workloads.
|
|
9
9
|
|
|
10
|
-
TensorStudio `1.0
|
|
11
|
-
|
|
12
|
-
mature ML frameworks. The final `1.0.0` version should only be tagged after the
|
|
13
|
-
Windows, Linux, and macOS release checklist passes.
|
|
10
|
+
TensorStudio `1.1.0` is a CPU-only stable API foundation. It is eager-only,
|
|
11
|
+
intentionally small, and not a replacement for mature ML frameworks.
|
|
14
12
|
|
|
15
13
|
## Install
|
|
16
14
|
|
|
17
|
-
From PyPI
|
|
15
|
+
From PyPI:
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
18
|
python -m pip install tensorstudio
|
|
@@ -96,6 +94,8 @@ d = ts.linspace(0.0, 1.0, 5)
|
|
|
96
94
|
|
|
97
95
|
print(a.shape, a.strides, a.device, a.is_contiguous)
|
|
98
96
|
print((b.clamp(0.2, 0.8) + 1).mean().item())
|
|
97
|
+
print(b.sum(axis=1).tolist())
|
|
98
|
+
print(ts.concat([b, b], axis=0).shape, b.astype("float64").dtype)
|
|
99
99
|
print(c.tolist(), d.tolist())
|
|
100
100
|
print(ts.zeros_like(b).shape, ts.randn_like(b, seed=11).dtype)
|
|
101
101
|
```
|
|
@@ -161,8 +161,8 @@ for features, targets in loader:
|
|
|
161
161
|
print(features.shape, targets.shape)
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
The v1
|
|
165
|
-
|
|
164
|
+
The v1 DataLoader is intentionally single-process so it works cleanly on
|
|
165
|
+
Windows without multiprocessing setup.
|
|
166
166
|
|
|
167
167
|
## Performance
|
|
168
168
|
|
|
@@ -171,34 +171,45 @@ performance is still experimental. Benchmarks live in `benchmarks/` and can be
|
|
|
171
171
|
run locally:
|
|
172
172
|
|
|
173
173
|
```bash
|
|
174
|
+
python benchmark_all.py
|
|
174
175
|
python benchmarks/benchmark_report.py
|
|
175
176
|
```
|
|
176
177
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
`benchmark_all.py` writes `benchmarks/results.md` and includes explicit win
|
|
179
|
+
columns for NumPy, TensorFlow, PyTorch, and JAX when those libraries are
|
|
180
|
+
available locally.
|
|
181
|
+
|
|
182
|
+
On one Windows CPython 3.10 development run reporting `1.1.0`, TensorStudio
|
|
183
|
+
beat NumPy on 23 small operation benchmark cases and lost on 80
|
|
184
|
+
NumPy-comparable cases. Against PyTorch CPU `2.12.1+cpu`, TensorStudio won 74
|
|
185
|
+
local cases and lost 34. The strongest local wins were small eager operations,
|
|
186
|
+
small contiguous axis reductions, and the simple NumPy convolution/pooling
|
|
187
|
+
references where framework dispatch or Python loops dominate; larger matrix
|
|
188
|
+
multiplication, PyTorch convolution and pooling, larger axis reductions, larger
|
|
189
|
+
transcendental activations, and larger autograd workloads remain faster in
|
|
190
|
+
PyTorch and NumPy.
|
|
191
|
+
See `benchmarks/results.md` for the full table, platform details, and exact
|
|
192
|
+
timings.
|
|
184
193
|
|
|
185
194
|
Snapshot from that local run:
|
|
186
195
|
|
|
187
|
-
| operation | shape | TensorStudio
|
|
188
|
-
|
|
189
|
-
| `sigmoid` | `(
|
|
190
|
-
| `mean` | `(
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
193
|
-
| `matmul` | `(256, 256)` | 4.
|
|
196
|
+
| operation | shape | TensorStudio | NumPy | PyTorch CPU | TS vs NumPy | TS vs PyTorch |
|
|
197
|
+
|---|---:|---:|---:|---:|---:|---:|
|
|
198
|
+
| `sigmoid` | `(32,)` | 0.0017 ms | 0.0036 ms | 0.0580 ms | 2.1201x | 33.8536x |
|
|
199
|
+
| `mean` | `(32,)` | 0.0018 ms | 0.0078 ms | 0.0127 ms | 4.2927x | 7.0047x |
|
|
200
|
+
| `sum_axis1` | `(16, 16)` | 0.0021 ms | 0.0029 ms | 0.0068 ms | 1.3727x | 3.2193x |
|
|
201
|
+
| `chain_relu` | `(128,)` | 0.0086 ms | 0.0039 ms | 0.0559 ms | 0.4478x | 6.5042x |
|
|
202
|
+
| `matmul` | `(256, 256)` | 4.1154 ms | 0.3679 ms | 0.0931 ms | 0.0894x | 0.0226x |
|
|
203
|
+
| `conv2d_3x3_padding1` | `(1, 1, 8, 8)` | 0.1788 ms | 1.2241 ms | 0.0131 ms | 6.8478x | 0.0731x |
|
|
204
|
+
| `max_pool2d_2x2` | `(1, 1, 16, 16)` | 0.0146 ms | 0.2649 ms | 0.0062 ms | 18.1659x | 0.4242x |
|
|
205
|
+
| `avg_pool2d_2x2` | `(1, 1, 16, 16)` | 0.0139 ms | 0.5486 ms | 0.0052 ms | 39.5974x | 0.3748x |
|
|
206
|
+
| `elementwise_backward` | `(1024,)` | 2.3885 ms | n/a | 0.1947 ms | n/a | 0.0815x |
|
|
194
207
|
|
|
195
|
-
Speedup is `
|
|
196
|
-
TensorStudio.
|
|
197
|
-
pre-optimization run was about 259 ms for the same `(256, 256)` case on this
|
|
198
|
-
machine.
|
|
208
|
+
Speedup is `competitor median / TensorStudio median`, so values above `1.0x`
|
|
209
|
+
favor TensorStudio.
|
|
199
210
|
|
|
200
|
-
Do not treat these results as universal. TensorStudio does not
|
|
201
|
-
|
|
211
|
+
Do not treat these results as universal. TensorStudio does not claim to be
|
|
212
|
+
faster than NumPy, TensorFlow, PyTorch, or JAX overall.
|
|
202
213
|
|
|
203
214
|
## Save And Load
|
|
204
215
|
|
|
@@ -218,6 +229,7 @@ unsafe because pickle can execute arbitrary code.
|
|
|
218
229
|
|
|
219
230
|
```bash
|
|
220
231
|
python -m pip install -e ".[dev,docs]"
|
|
232
|
+
python test_all.py --skip-build
|
|
221
233
|
ruff check .
|
|
222
234
|
mypy python/tensorstudio
|
|
223
235
|
pytest -q
|
|
@@ -230,6 +242,7 @@ scikit-build-core, and C++20.
|
|
|
230
242
|
|
|
231
243
|
## Release Checklist
|
|
232
244
|
|
|
245
|
+
- `python test_all.py` passes locally.
|
|
233
246
|
- `ruff check .` passes.
|
|
234
247
|
- `mypy python/tensorstudio` passes.
|
|
235
248
|
- `pytest -q` passes on Windows, Linux, and macOS.
|
|
@@ -254,10 +267,14 @@ tokens or print secrets.
|
|
|
254
267
|
- CPU backend only.
|
|
255
268
|
- Eager execution only.
|
|
256
269
|
- No CUDA or Metal backend yet.
|
|
270
|
+
- No BLAS-backed matrix multiplication yet.
|
|
257
271
|
- No graph compiler or distributed runtime.
|
|
258
|
-
-
|
|
272
|
+
- Convolution and pooling support are currently limited to CPU NCHW
|
|
273
|
+
`conv2d`, `max_pool2d`, and `avg_pool2d` style workloads.
|
|
274
|
+
- Reductions support all-element or single-axis reductions, not tuple-axis
|
|
275
|
+
reductions yet.
|
|
259
276
|
- No sparse tensors or advanced indexing.
|
|
260
|
-
-
|
|
277
|
+
- Dtype casting is basic and does not include a full promotion/casting policy.
|
|
261
278
|
- Experimental performance; benchmarks are local references only.
|
|
262
279
|
- Pickle serialization is for trusted TensorStudio objects only.
|
|
263
280
|
|
|
@@ -265,8 +282,8 @@ tokens or print secrets.
|
|
|
265
282
|
|
|
266
283
|
- CUDA backend
|
|
267
284
|
- Graph/JIT mode
|
|
268
|
-
-
|
|
269
|
-
-
|
|
285
|
+
- Broader convolution ops, adaptive/global pooling, and image-model examples
|
|
286
|
+
- Richer dataset utilities
|
|
270
287
|
- Model zoo examples
|
|
271
288
|
- ONNX import/export
|
|
272
289
|
- Improved memory allocator
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from benchmarks.benchmark_report import run_benchmarks
|
|
7
|
+
|
|
8
|
+
ALL_SECTIONS = {
|
|
9
|
+
"elementwise",
|
|
10
|
+
"matmul",
|
|
11
|
+
"conv2d",
|
|
12
|
+
"pooling",
|
|
13
|
+
"reductions",
|
|
14
|
+
"activations",
|
|
15
|
+
"autograd",
|
|
16
|
+
"training_loop",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main() -> None:
|
|
21
|
+
parser = argparse.ArgumentParser(description="Run every TensorStudio benchmark section.")
|
|
22
|
+
parser.add_argument(
|
|
23
|
+
"--section",
|
|
24
|
+
action="append",
|
|
25
|
+
choices=sorted(ALL_SECTIONS),
|
|
26
|
+
help="Run only the selected section. Repeat for multiple sections.",
|
|
27
|
+
)
|
|
28
|
+
parser.add_argument(
|
|
29
|
+
"--output",
|
|
30
|
+
type=Path,
|
|
31
|
+
default=Path("benchmarks") / "results.md",
|
|
32
|
+
help="Markdown report path. Defaults to benchmarks/results.md.",
|
|
33
|
+
)
|
|
34
|
+
parser.add_argument(
|
|
35
|
+
"--print",
|
|
36
|
+
action="store_true",
|
|
37
|
+
help="Print the full Markdown report after writing it.",
|
|
38
|
+
)
|
|
39
|
+
args = parser.parse_args()
|
|
40
|
+
|
|
41
|
+
selected_sections = set(args.section or ALL_SECTIONS)
|
|
42
|
+
report = run_benchmarks(selected_sections, args.output)
|
|
43
|
+
if args.print:
|
|
44
|
+
print(report)
|
|
45
|
+
else:
|
|
46
|
+
print(f"Wrote benchmark report to {args.output}")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
main()
|