Skip to content

About

Meta framework for Deep Learning frameworks with PyTorch.

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Meta framework for Deep Learning frameworks with PyTorch.

Getting Started

Supported runtime

The package metadata allows installation on Python 3.8 or newer. The combinations covered by the full runtime-test job are narrower:

Platform Python PyTorch Torchvision Accelerate
Linux 3.8 2.3.1 0.18.1 1.0.1
Linux 3.14 current compatible CPU wheel matching wheel 1.14.0

The Python 3.8 row is reproduced by the committed constraints and uses the newest Accelerate release that supports Python 3.8. Python 3.14 resolves current compatible PyTorch/Torchvision wheels and uses the current Accelerate release. Intermediate Python versions and other operating-system combinations are installable on a best-effort basis, but are not part of the guaranteed runtime-test matrix. PyTorch is deliberately not declared as a direct project dependency, but Accelerate may still pull in a default PyTorch wheel transitively. Preinstall the appropriate PyTorch/Torchvision pair with the official selector so the wheel matches the target CPU/CUDA environment.

Standard installation

From a checkout:

python -m pip install torch==2.3.1 torchvision==0.18.1
python -m pip install .

ONNX export and inference dependencies are optional. Install them when needed:

python -m pip install ".[onnx]"

For development on the supported Linux x86_64 runtime, use the repository's fixed CI constraints. On other platforms, select PyTorch first and treat the remaining combinations as best effort:

python -m pip install --upgrade "pip==24.2"
python -m pip install --extra-index-url https://download.pytorch.org/whl/cpu -c requirements/constraints-ci.txt torch torchvision
python -m pip install -c requirements/constraints-ci.txt -e ".[dev]"
python -m pip check

The Python 3.14 CI lane instead installs current CPU PyTorch/Torchvision wheels, Accelerate 1.14.0 through the project dependency marker, and .[test,onnx] without the Python 3.8 constraints.

Copy-in installation

carefree-core can still be used as a portable package:

  • Copy the core folder into your project.
  • Preinstall the tested PyTorch/Torchvision pair.
  • Declare the runtime dependencies from project.dependencies in pyproject.toml in your own project.
  • Copy the relevant [tool.black], [tool.mypy], and [tool.coverage.*] sections if you want to inherit this repository's tooling policy.

The copied sources are then yours to modify. Both standard installation and this copy-in workflow are covered by packaging smoke tests.

Introductions

toolkit package

This package is meant to hold the common classes / functions that are used across the whole library.

flow package

This package provides lightweight building blocks for arbitrary workflows. Highlights include:

  • Async: async is by design.
  • Parallel: nodes can be executed in parallel.
  • Powerful: complex locks / logics / dependencies can be handled.
    • You can even perform a loop with loop backs in the workflow!
  • Automated:
    • All nodes, as well as the workflow itself, can be automatically turned into RESTful APIs.
    • Detailed documentation of the design / nodes / workflow / ... can be automatically generated, which makes this package and its extended versions agent-friendly.
      • That is to say, you can build a GPT-agent on top of this package by simply feed the auto-generated documentation to it. After which, you can interact with the agent via natural language and it will tell you how to build the workflow you want (it may even be able to give you the final workflow JSON directly)!
      • We even support auto-generating a 'RAG friendly' version of the documentation, which makes Retrieval-Augmented Generation easier. This version uses __RAG__ as the special separator, so you can chunk the documentation into suitable parts for RAG.
  • Extensible: you can easily extend the package with your own nodes.
  • Serializable: the workflow can be serialized into / deserialized from a single JSON file.
  • Human Readable: the workflow JSON file is human readable and easy to understand.
  • Lightweight: workflow construction and execution are implemented within this package.

learn package

This package is the 'main' package of the PyTorch framework, here are some main design principles:

  • Data: Will use torch.utils.data.DataLoader as the data loader.
  • Model: Will be split into module and model:
    • module is the key part of the Model, and should be self-contained at inference stage.
    • model is the wrapper of module, and should contain the training / evaluation / ... logic.
  • Trainer: Will use the accelerate library.
  • Training Abstraction: Will use TrainStep for fine-grained control.

License

carefree-core is MIT licensed, as found in the LICENSE file.

About

Meta framework for Deep Learning frameworks with PyTorch.

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages