Dependencies¶
Required dependencies¶
The 3lc Python package declares several required dependencies, which are automatically installed when installing
3lc. The core surface — Tables, Runs, the Object Service, URL adapters — has no dependency on a deep-learning
framework.
Optional dependencies¶
To avoid pulling in a large number of potentially unused packages, 3lc declares additional functionality behind
optional extras. The following table lists the available extras and the packages they pull in:
Installation |
Dependencies |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PyTorch¶
PyTorch is required for any workflow that collects per-sample metrics from a model, and for constructing a Table from
a torch.utils.data.Dataset. Specifically, the following entry points require torch (and, for VisionDataset
features, torchvision):
The framework integrations under
tlc.integration.detectron2,tlc.integration.hugging_face, andtlc.integration.super_gradients
If torch is not installed and one of these entry points is called, 3lc raises an ImportError pointing at
pip install 3lc[torch]. The rest of the package — Tables, Runs, URL adapters, the Object Service, and the
FunctionalMetricsCollector -
all work without torch installed.
Installation¶
Prior to 3lc >= 3.0, torch and torchvision were required dependencies. They are now optional, so users only
running torch-free workflows do not need them installed.
The simplest way to get a working setup is:
pip install 3lc[torch]
This installs whichever PyTorch wheel PyPI provides for your platform — at the time of writing, CPU-only wheels on Windows and macOS, and GPU-accelerated wheels on Linux.
For a build matched to a specific accelerator (CUDA, ROCm, MPS, etc.), follow the official PyTorch install instructions to pick the right index URL and wheel:
We recommend installing torch and torchvision before 3lc, or as part of the same pip install invocation, so
that pip can respect any accelerator-specific index URL you pass:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126followed bypip install 3lcyieldscu126wheels.pip install 3lc torch torchvision --index-url https://download.pytorch.org/whl/cu126does the same in a single step.
If torch and torchvision are installed after 3lc[torch] and 3lc has already pulled the PyPI default wheels,
either pin the full version including the local-version specifier (e.g.
pip install torch==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126), or pass --force-reinstall to
override the existing wheels.
The 3lc[huggingface] extra depends on 3lc[torch] transitively, so installing it pulls torch and torchvision in
as well.