Skip to main content

pyTorchAutoForge

WARNING: work in progress. Do not hesitate to open issues for improvements or problems!

A library based on PyTorch (https://pytorch.org/) and designed to automate ML models development, tracking and deployment, integrated with MLflow and Optuna (https://mlflow.org/, https://optuna.org/). It also supports spiking networks libraries (WIP). Model optimization and deployment can be performed using ONNx, pyTorch facilities or TensorRT (WIP). The library aims to be compatible with Jetson Orin Nano Jetpack rev6.1. Several other functionalities and utilities for sklearn and pySR (https://github.com/MilesCranmer/PySR) are included (see README and documentation).

Some brief usage guides (WIP)

TensorRT exporter quick usage

from pyTorchAutoForge.api.tensorrt import TRTengineExporter

exporter = TRTengineExporter()
engine_path = exporter.build_engine_from_onnx_path(
    onnx_model_path="/tmp/model.onnx",
    output_engine_path="/tmp/model.engine",
)
print(engine_path)
from pyTorchAutoForge.api.tensorrt import TRTengineExporter

exporter = TRTengineExporter()
engine_path = exporter.export_torch_to_trt_engine(
    torch_model=model,                    # torch.nn.Module
    input_sample=sample,                  # torch.Tensor or tuple[torch.Tensor, ...]
    onnx_export_path="/tmp/intermediate.onnx",
    output_engine_path="/tmp/final.engine",
)
print(engine_path)

Notes:

  • TRTEXEC mode requires trtexec in PATH.
  • PYTHON mode requires the tensorrt Python package.
  • Default behavior avoids architecture-specific flags and is suitable for Jetson deployment workflows.

Installation using pip

The suggested installation method is through pip as the others are mostly intended for development and may not be completely up-to-date with the newest release versions. In whatever conda or virtual environment you like (preferably with a sufficiently new torch release, to install from pypi:

pip install pyTorchAutoForge

Or from a local copy of the repository (requires hatch module for the build):

cd pyTorchAutoforge
pip install .

An automatic installation script conda_install.sh is provided and should work in most cases. Note that it will automatically create a new environment named autoforge and makes several assumptions about your environment. Dependencies for the core modules should be installed automatically using pip. However, this is currently not fully tested. Please open related issues.

Metadata

Release files for pyTorchAutoForge 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyTorchAutoForge 0.6.0
File Size Uploaded
pytorchautoforge-0.6.0.tar.gz 220.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyTorchAutoForge 0.6.0
File Interpreter ABI Platform
pytorchautoforge-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 481.7 kB

Release files / pytorchautoforge-0.6.0.tar.gz

Download URL pytorchautoforge-0.6.0.tar.gz
Size 220.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4a96dc9819b19e414213aac683586688eac1f8dba144e75d96aa066a1f71d59c
BLAKE2b-256 checksum
How to use checksums
366eb7bdc1683addee5c8ec120fe5c0f921ddf922eebb69b24731a27c4835f1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / pytorchautoforge-0.6.0-py3-none-any.whl

Download URL pytorchautoforge-0.6.0-py3-none-any.whl
Size 261.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88afb16934cc3747e1d0a1b981e33415b5bae112591e819f8574f9f5af77a51d
BLAKE2b-256 checksum
How to use checksums
76d3ce7653b9ba67a5bc90dcba4c6607554ae12cef356dc39fc9428f7335f227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page