spmd-types
A type system for distributed (SPMD) tensor computations in PyTorch
Decision gist · record as of 2026-08-14
Yes, if you are building or maintaining distributed training code. The package is actively maintained, has no external dependencies, and offers a concrete way to catch synchronization bugs before expensive distributed runs. It is in beta (global SPMD types are under construction), so expect the API to evolve; use it for new projects where you can adapt to changes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; integration with distributed tensor frameworks assumed in usage context.
- Installs with no runtime dependencies and low friction.
- The package is actively maintained with a recent release 8 days old; the repository shows steady activity.
License · maintenance · safety
permissive license (permissive) — BSD 3-Clause License permits commercial and private use with attribution and liability disclaimer. No restrictions on modification or redistribution.
last release 2026-08-06 (8 days) · last repo commit 2026-08-14 · 36 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 111,736 downloads/mo, #12,403 on PyPI
Alternatives
Verify before relying
pip install spmd_types
import spmd_types as spmd
import spmd_types.checker
with spmd.set_current_mesh(mesh), spmd.checker.typecheck():
spmd.assert_type(x, {dp: spmd.R, tp: spmd.P})
y = spmd.all_reduce(x, tp, src=spmd.P, dst=spmd.R)
spmd.assert_type(y, {dp: spmd.R, tp: spmd.R})- Whether the type system catches all realistic gradient-reduction bugs in production training code.
- Performance overhead of runtime type checking during training.
- Maturity and completeness of global SPMD types (noted as 'actively under construction').
- Compatibility with frameworks beyond those mentioned in documentation.
What it is and what it does
spmd_types is a type system for writing distributed tensor computations with explicit, verifiable semantics. It provides two complementary abstractions: local SPMD types track whether gradients are pending reduction or fully synchronized, enabling safe use of Megatron-style differentiable collectives; global SPMD types offer a DTensor-like interface where code has identical semantics whether run on a single device or distributed, but with explicit communication operations so redistributes are never implicit.
The package lets you verify correctness of distributed training logic—checking gradient computation and parallelization equivalence—without running full end-to-end distributed training. It includes runtime type checking via a checker module, allowing you to annotate tensors with their layout and synchronization state and assert those invariants hold at each step.
Use it for
- Porting training frameworks to verify gradients are correctly reduced across ranks without E2E training runs.
- Typechecking distributed code to catch mismatches between expected and actual tensor layouts before deployment.
- Writing distributed logic that is semantically identical whether run on a single device or across multiple ranks.
- Verifying that collective operations are applied to tensors in the correct synchronization state.
- Debugging gradient flow by asserting tensor state at each computation step.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building or maintaining distributed training code.
The package is actively maintained, has no external dependencies, and offers a concrete way to catch synchronization bugs before expensive distributed runs. It is in beta (global SPMD types are under construction), so expect the API to evolve; use it for new projects where you can adapt to changes.
Install
spmd-types on PyPI
Before you install
Installs with no runtime dependencies and low friction. The package is actively maintained with a recent release 8 days old; the repository shows steady activity.
Requires Python 3.10 or later; integration with distributed tensor frameworks assumed in usage context.
License in practice
BSD 3-Clause License permits commercial and private use with attribution and liability disclaimer. No restrictions on modification or redistribution.
Quickstart
pip install spmd_types
import spmd_types as spmd
import spmd_types.checker
with spmd.set_current_mesh(mesh), spmd.checker.typecheck():
spmd.assert_type(x, {dp: spmd.R, tp: spmd.P})
y = spmd.all_reduce(x, tp, src=spmd.P, dst=spmd.R)
spmd.assert_type(y, {dp: spmd.R, tp: spmd.R})
Verify before relying
- Whether the type system catches all realistic gradient-reduction bugs in production training code.
- Performance overhead of runtime type checking during training.
- Maturity and completeness of global SPMD types (noted as 'actively under construction').
- Compatibility with frameworks beyond those mentioned in documentation.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 8 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 111,736 / month, #12,403 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: spmd_types-0.2.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “distributed tensor types”
- spmd-typesProvides type annotations and runtime checking for distributed tensor…
- nixl-cu12NIXL provides Python bindings to accelerate point-to-point…
- tensorizerSerializes and deserializes PyTorch modules and tensors to/from HTTP,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also megatron-fsdp · megatron-core · instanttensor · torchtyping · torchtitan · torchmetrics · torch · cutensornet-cu13 · entmax · jaxtyping