Run The Suite
Use focused TorchCTS runs while developing a backend, then expand the same test surface for regression and release validation.
Install
If you are working on a backend, install TorchCTS in the same virtual environment you use to build and run that backend. That keeps TorchCTS, PyTorch, and the backend package in the environment you are actually validating.
python -m pip install torchcts
Use this path for backend development, CI inside a backend repository, and release validation against a backend package you already build.
Not A Backend Engineer?
If you just want to try TorchCTS on a machine without wiring it into a backend development environment, use the online installer. It creates a separate TorchCTS install and chooses a PyTorch wheel family for you.
curl -fsSL https://torchcts.ai/scripts/install.sh | sh
irm https://torchcts.ai/scripts/install.ps1 | iex
The website installer chooses the PyTorch wheel family. The run command still chooses the backend under test. If an existing PyTorch install is outside 2.7.0-2.12.1, the installer warns and points to the validated range. Use TORCHCTS_TORCH_VARIANT when you need a specific wheel family, TORCHCTS_UPGRADE_TORCH=1 when you want the installer to install the validated range, and TORCHCTS_NON_INTERACTIVE=1 in scripts.
Backend Development Loop
TorchCTS can bootstrap test-driven development for a backend. Use an existing TorchCTS case as the failing test for the behavior being implemented, keep the run focused while working, and retain the broader coverage after the fix is complete.
Pick the operator, dtype, capability, semantic level, or path-shape case you are implementing.
Set the manifest to the behavior the backend is intended to support at this stage.
Limit the run so the implementation problem is quick to reproduce and easy to inspect.
Use the result category, markdown report, runlog, probe records, and crash record to identify the next engineering action.
Rerun the same selection until the behavior matches the PyTorch expectation.
Add one dtype, semantic level, suite, operator family, or resource tier at a time.
Add the appropriate focused or broader command to the backend's normal CI after the implementation is reliable.
torchcts run --device my_backend --level 2 --dtype torch.float32 --report-skips -k matmul
This example narrows the run to float32 cases through semantic level 2 whose pytest selection matches matmul. Replace the selection with the operator or behavior currently under development.
First Validation
torchcts init --template smoke --non-interactive
torchcts check-manifest
torchcts run --device cuda --level 1 --report-skips
The first run checks the smallest useful backend surface and separates environment setup, manifest configuration, and implementation work.
First Backend Validation Walkthrough
Use this sequence when you are validating a backend for the first time. It is a tutorial path, not the release gate.
Install TorchCTS where your backend package and PyTorch wheel already live. That makes the run test the environment you actually ship.
Run torchcts init --template smoke --non-interactive, then edit device_name, backend_import, dtypes, and capabilities.
torchcts check-manifest must pass before backend results are meaningful.
Start with the core primitive surface. If the run does not complete cleanly, use the result to separate environment setup, manifest configuration, and backend implementation work.
Open the markdown report, latest result reference, canonical history artifact, and runlog. Compare the artifact shape with the sample results in the TorchCTS repo before interpreting a failure cluster.
After the first slice is reliable and understandable, expand one axis at a time: one dtype, one semantic level, one suite, or one operator selection.
For the relationship between TorchCTS and PyTorch's testing foundations, see How TorchCTS Fits With PyTorch.
Backend Bring-Up
torchcts run --device my_backend --level 2 --dtype torch.float32 --report-skips
torchcts run --device my_backend --level 4 --dtype torch.float32 --suite generated --report-skips
torchcts show-skips --device my_backend --level 4 --dtype torch.float32
Keep bring-up narrow while implementing a feature. Make the focused slice reliable, then widen the test surface one axis at a time.
The manifest is both a development configuration and a release-facing support declaration. During bring-up it should describe the support the current implementation is intended to exercise, not an aspirational final state.
Filtered does not mean passed. It means TorchCTS did not run the case and recorded why.
Path-Shape Runs
Path-shape runs use the normal pytest harness and result format. They are a focused way to run tracked shape coverage by family, runner, resource tier, cost class, model role, dtype group, or exact case id.
torchcts path-shapes validate
torchcts path-shapes list --family matmul
torchcts path-shapes run --device cuda --family matmul --level 8 -q
torchcts path-shapes run --device mps --level 8 --subprocess-per-shape -q
torchcts path-shapes run --device mps --all-resource-tiers --level 8 --subprocess-per-shape -q
When is used, TorchCTS forwards the selected path-shape filters to each child process so isolated crash runs execute the same cases.
Do not use as MPS backend evidence. Validation mode forces CPU. Real MPS evidence must come from non-validation runs with --device mps.
Scope Controls
--levelRuns all cases with semantic_level less than or equal to the requested level. See Semantic Levels.
--level-exactRuns one semantic level.
--level-rangeRuns an inclusive level range.
--dtypeNarrows the dtype support included in the run.
--suiteLimits collection to one suite.
FalseLeaves unsupported paths outside the configured test surface.
show-skipsPrints TorchCTS run accounting without executing the full suite.
Backend Release Validation
torchcts check-manifest
torchcts coverage audit
torchcts coverage check --fail-on-unknown
torchcts run --device "$TORCHCTS_DEVICE" --level 8 --report-skips --results-dir results
torchcts report
A release run needs the whole results directory, not just terminal output. Keep the latest result reference, canonical history artifact, markdown report, runlog, coverage files, probe diagnostics, reference diagnostics, and crash evidence.
The release gate reuses the development test system at greater depth. It confirms that focused fixes still work in the broader suite and preserves unsupported paths, regressions, crashes, and coverage gaps as engineering evidence before release.
TorchCTS maintainers separately validate TorchCTS-owned references, routing, provenance, and evidence manifests from the source repository. Those checks are not installed backend tests and do not contribute to backend results.
Read how oracle QA works or review the TorchCTS release checklist.
Interpret The Run Correctly
Filtered means TorchCTS did not execute the case. The recorded reason explains whether it was outside the manifest, operator contract, semantic level, suite selection, or another policy boundary.
When a configured in-contract path reports unsupported or not implemented at runtime, the manifest and implementation are out of alignment. The result remains a failure or error.
Keep the result, report, runlog, coverage files, probe diagnostics, reference diagnostics, and crash evidence. Terminal output alone is not enough for reliable debugging or review.
Subprocess isolation protects the parent run and allows later tests to continue. It does not change the crash result.