slangtorch
A package for calling Slang modules from Python and PyTorch.
Decision gist · record as of 2026-08-14
Yes, if you need to write or integrate Slang-based GPU kernels with PyTorch and have the required CUDA and PyTorch setup. The package is actively maintained, permissively licensed, and has no known vulnerabilities. The main barrier is the external dependency on CUDA Toolkit v12.0+ and PyTorch v2.x with CUDA support; if those are already in your environment, installation is straightforward.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- CUDA Toolkit v12.0 or later and PyTorch v2.x with CUDA support must be installed before slangtorch; a CUDA-capable GPU is required to run kernels.
- Medium install friction due to runtime dependencies on torch, ninja, and hatchling; requires CUDA Toolkit v12.0 or later and PyTorch v2.x with CUDA support as external prerequisites.
- Package itself is actively maintained with a release 14 days old.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute slangtorch and code built with it freely, including in commercial projects, provided you retain the license notice.
last release 2026-07-31 (14 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 92,224 downloads/mo, #13,466 on PyPI
Alternatives
Verify before relying
pip install slangtorch
import slangtorch
# Requires CUDA Toolkit v12.0+ and PyTorch v2.x with CUDA support installed first- Whether Slang kernel compilation is transparent to the user or requires explicit build steps beyond import.
- What performance characteristics or overhead slangtorch adds compared to native PyTorch CUDA kernels.
- Whether the package supports AMD GPUs or only NVIDIA CUDA devices.
What it is and what it does
slangtorch bridges the Slang shading language and PyTorch, allowing you to write GPU kernels in Slang and call them from Python. Slang is a language designed for graphics and compute shaders; slangtorch compiles Slang code to CUDA and integrates it with PyTorch's tensor operations. This is useful when you need fine-grained control over GPU computation or want to leverage existing Slang code within a PyTorch workflow.
The package requires external setup: CUDA Toolkit v12.0 or later and PyTorch v2.x built with CUDA support must be installed before slangtorch. It depends on torch, ninja (for build acceleration), filelock, and hatchling. The package is actively maintained and supports Python 3.10 and later on Linux and Windows.
Use it for
- Write custom PyTorch operations in Slang for performance-critical GPU compute tasks.
- Integrate existing Slang shaders or compute kernels into a PyTorch training or inference pipeline.
- Prototype GPU algorithms using Slang's language features before optimizing further.
- Combine graphics and compute workloads by reusing Slang code across PyTorch and graphics applications.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to write or integrate Slang-based GPU kernels with PyTorch and have the required CUDA and PyTorch setup.
The package is actively maintained, permissively licensed, and has no known vulnerabilities. The main barrier is the external dependency on CUDA Toolkit v12.0+ and PyTorch v2.x with CUDA support; if those are already in your environment, installation is straightforward.
Install
slangtorch on PyPI
Before you install
Medium install friction due to runtime dependencies on torch, ninja, and hatchling; requires CUDA Toolkit v12.0 or later and PyTorch v2.x with CUDA support as external prerequisites. Package itself is actively maintained with a release 14 days old.
CUDA Toolkit v12.0 or later and PyTorch v2.x with CUDA support must be installed before slangtorch; a CUDA-capable GPU is required to run kernels.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute slangtorch and code built with it freely, including in commercial projects, provided you retain the license notice.
Quickstart
pip install slangtorch
import slangtorch
# Requires CUDA Toolkit v12.0+ and PyTorch v2.x with CUDA support installed first
Verify before relying
- Whether Slang kernel compilation is transparent to the user or requires explicit build steps beyond import.
- What performance characteristics or overhead slangtorch adds compared to native PyTorch CUDA kernels.
- Whether the package supports AMD GPUs or only NVIDIA CUDA devices.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 4 packagesfilelockhatchlingninjatorch |
| Maintenance | Actively maintained 14 days since the last release |
| First released | |
| Downloads | 92,224 / month, #13,466 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 |
Evidence: slangtorch-1.3.22-py3-none-manylinux_2_27_x86_64.whl; slangtorch-1.3.22-py3-none-manylinux_2_28_aarch64.whl; slangtorch-1.3.22-py3-none-win_amd64.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 › “pytorch custom kernels”
- slangtorchslangtorch lets you write PyTorch kernels in the Slang shading…
- cuequivariance-ops-torch-cu12Provides CUDA-accelerated PyTorch kernels and operators for…
- gram-newton-schulzImplements a hardware-aware Gram Newton-Schulz algorithm for polar…
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 sglang-kernel · nvidia-cuda-tileiras · cuda-python · cpm-kernels · cuequivariance-ops-torch-cu12 · nvidia-cuda-nvrtc · tilelang · cuda-tile · nvidia-cutlass-dsl-libs-cu13 · nvidia-cutlass-dsl-libs-cu12