HomeThe StackLayer 1

Infrastructure

The compute, storage, and distributed-execution layer that powers every step of building and running AI systems.

AI infrastructure is the set of hardware resources, cloud services, and low-level software tools that provide the computational power, storage, and networking required to develop, train, and operate AI models. Without this layer, the frameworks and model code above it have nowhere to run. Every matrix multiplication, every gradient update, every batch of inference requests ultimately depends on infrastructure components doing physical work.

In the Python AI ecosystem, infrastructure tooling spans several distinct jobs: interacting with cloud object storage and managed services, distributing workloads across multiple machines or processes, accelerating numerical computation on CPUs and GPUs, and writing low-level GPU kernels directly. Tools at this layer sit between the hardware and the higher-level model code, abstracting enough complexity to be usable while exposing enough control to be performant.

The four tools here represent the most common Python paths to each of those jobs. boto3 connects Python code to AWS cloud services, including S3 object storage central to most data pipelines. Ray distributes Python workloads across clusters without requiring a rewrite of application logic. Numba compiles numerical Python functions to machine code at runtime, with optional CUDA GPU targeting. CUDA Python provides direct, low-overhead bindings to NVIDIA's CUDA platform for teams that need kernel-level GPU control.

The official AWS SDK for Python, providing access to S3, SageMaker, EC2, and the full AWS service catalog.

9kstars280M/mo1.0.0Jan 2026
Popularity85
Momentum92
Maintenance87
Maturity90

Why we picked it

boto3 is the canonical Python interface to AWS, with around 280 million downloads per month making it one of the most-used packages in the Python ecosystem. For teams using AWS-managed storage, compute, or ML services, it is a direct dependency with no realistic alternative inside the AWS ecosystem. The SDK is generated from AWS service models, so new services and API changes surface quickly.

Also evaluated

  • google-cloud-storageGoogle Cloud's Python client for GCS; direct equivalent for GCP-hosted data pipelines.
  • azure-storage-blobMicrosoft's Python SDK for Azure Blob Storage; the counterpart for Azure-based infrastructure.
  • s3fsWraps boto3 with a filesystem interface; often used in data pipelines for path-style S3 access.

A distributed computing framework that scales Python tasks, actors, and ML workloads across multi-core machines or clusters.

32kstars5M/mo1.0.0Jan 2026
Popularity83
Momentum90
Maintenance85
Maturity88

Why we picked it

Ray's 32k GitHub stars and over 5 million downloads per month reflect broad adoption across both research and production ML. Its core primitives, remote functions and actors, require minimal changes to existing Python code. Ray Tune integrates distributed hyperparameter search, and Ray Serve handles model serving at scale. The unified framework reduces the number of separate systems a team needs to operate for training, tuning, and inference.

Also evaluated

  • DaskParallel computing library with a familiar NumPy and pandas API; strong for data processing workloads.
  • CeleryMature distributed task queue; suited to async job processing but not purpose-built for ML workloads.
  • multiprocessingPython standard library module for CPU parallelism; no cluster support but zero added dependencies.

A JIT compiler that translates numerical Python and NumPy code to optimized machine code at runtime, with optional CUDA GPU support.

10kstars9M/mo1.0.0Jan 2026
Popularity81
Momentum88
Maintenance83
Maturity86

Why we picked it

Numba's nearly 9 million downloads per month indicate it is a routine tool in scientific computing and AI data preprocessing pipelines. It requires no C extension or separate compilation step: decorating a function with `@jit` or `@cuda.jit` triggers compilation on first call. For numerical loops and array operations that are bottlenecks in pure Python, Numba routinely delivers speedups that require writing a C extension otherwise. The CUDA backend lets the same Python function run on NVIDIA GPUs without a full CUDA C workflow.

Also evaluated

  • CythonCompiles Python-like code to C extensions; requires a build step but covers a broader set of Python constructs.
  • CuPyNumPy-compatible array library that runs on CUDA GPUs; higher-level than Numba for array-level GPU work.
  • PyPyAlternative Python interpreter with a built-in JIT; faster for general Python but incompatible with CPython C extensions.

NVIDIA's official Python bindings to the CUDA Driver API and NVRTC, enabling direct GPU kernel authoring and memory management from Python.

2kstars1M/mo1.0.0Jan 2026
Popularity79
Momentum86
Maintenance81
Maturity84

Why we picked it

CUDA Python is the authoritative low-level interface to NVIDIA GPUs from Python, maintained by NVIDIA itself. With around 1.2 million downloads per month, its usage is narrower than Numba but serves a distinct purpose: teams that need to write and compile CUDA kernels precisely, manage GPU memory manually, or access CUDA features not exposed by higher-level libraries. As the canonical NVIDIA-authored binding, it tracks new CUDA releases and hardware features closer to release than third-party wrappers.

Also evaluated

  • PyCUDAOlder community-maintained CUDA bindings for Python; widely used but not officially supported by NVIDIA.
  • TritonOpenAI's GPU kernel language; higher-level than CUDA C but targets the same performance-critical kernel-authoring use case.
  • CuPyGPU array library with a NumPy API; abstracts most kernel concerns but allows custom kernels via RawKernel.

What I learned

Numba's acceleration is not uniform. Functions with tight loops over NumPy arrays or explicit CUDA kernels compile well and show large speedups. Functions that call pandas, use Python objects, or branch on strings frequently hit compilation errors or fall back to interpreted mode. The gains are real but the scope is narrower than the documentation implies.

Ray's strength shows at the process boundary. For parallelizing independent tasks across cores or machines, the ray.remote decorator with minimal changes to existing Python is genuinely fast to adopt. Ray Tune's search-and-scheduling integration is practical for hyperparameter work. The overhead, though, is measurable on small workloads, and the cluster setup adds operational surface area that single-machine workflows do not need.

CUDA Python targets a narrower audience than the other three tools. The NVRTC and Driver API bindings are thin wrappers around the C API, which means low overhead and full control, but also that the caller writes kernel code and manages memory manually. For most model development workflows, Numba or PyTorch's CUDA tensors are more practical. CUDA Python is relevant when those higher-level paths cannot express a kernel the way you need.

boto3 is essentially unavoidable in AWS-heavy stacks. The generated client interface covers the full AWS surface area, but the API is verbose for simple operations. Libraries like s3fs or fsspec wrap boto3 to give filesystem semantics, which is often the right choice for data pipeline code. Using boto3 directly is most common for operations outside S3, such as interacting with SageMaker, ECS, or AWS Batch.

These four tools are not competing options across a single dimension. They occupy different positions: boto3 handles cloud I/O, Ray handles task and actor distribution, Numba handles CPU and GPU JIT compilation, and CUDA Python handles direct kernel authoring. A production training pipeline might use all four. The choice within each category depends on how much control is needed and how much operational complexity is acceptable. Ray is easier to start with than Dask for task parallelism but adds more cluster overhead. Numba covers most GPU acceleration cases without writing CUDA code directly, and CUDA Python handles what Numba cannot express. The right starting point is usually the highest-level tool that meets the performance requirement.

Amine Azariz

Amine Azariz

Curator of PyStack. Every tool on this layer was picked by hand, against real projects.