Skip to content
Lexing Zhang edited this page Sep 15, 2026 · 1 revision

Answers to the questions that come up most often, from the project docs and issue tracker. For anything not covered here, try Discussions or the Discord.

CUDA out of memory

If you see cuda runtime error(2): out of memory, check these common causes:

  1. Accumulating autograd history in the training loop. Keep a running scalar instead of a graph-backed tensor:
    total_loss += float(loss)   # good: detaches from the graph
  2. Holding references you no longer need. del tensors as soon as they are not required.
  3. Overly long RNN sequences. Use truncated backpropagation through time.
  4. Oversized Linear layers. A Linear(n, m) weight costs O(nm) memory — large hidden sizes add up fast.

Build issues

Windows: A single input file is required during compilation. On Windows the build forces the Ninja generator; other generators feed source groups to the compiler in a form it cannot parse. Use the default configuration rather than overriding the generator.

Editable install re-runs on every import. Editable installs use redirect mode with rebuild disabled — a rebuild on every import would stall import tensorplay. Rebuild explicitly when you change C++ code:

pip install -e . --no-build-isolation

CUDA or ROCm? The two GPU backends are mutually exclusive — pick one per build. Set USE_CUDA=OFF for a CPU-only build or USE_ROCM=ON for AMD/HIP. CUDA is auto-detected when nvcc is on the PATH.

Compile is too slow / machine runs out of memory. Cap parallelism with MAX_JOBS, especially when building CUDA kernels.

Testing

Run the Python test suite against an installed (or in-place built) package:

pytest test/                        # full suite
pytest test/test_tensor_basic.py    # single file
pytest --reruns 2 test/test_something.py  # flaky tests

The C++ test suite is built with BUILD_TESTS=ON and lives under test/cpp/.

Versions and releases

  • The package version lives in version.txt (single source of truth); development installs carry a +git<sha> suffix.
  • Stable releases are tagged vMAJOR.MINOR.0; release candidates use X.Y.0rcN; nightlies use X.Y.0.dev<UTC date> with +cpu / +cuXXX local tags.
  • CPU wheels publish to PyPI; CUDA wheels publish to the TensorPlay wheel index with a PEP 503 layout.

Where to ask

TensorPlay TensorPlay

Getting started

Project

Deep dives

Community


Core components

  • tensorplay — Python API
  • p10 — C++ core
  • tpx — autograd
  • stax — JIT compiler

Clone this wiki locally