Skip to main content

PyTorchAutoForge library is based on raw PyTorch and designed to automate DNN development, model tracking and deployment, tightly integrated with MLflow and Optuna. It supports Spiking networks libraries (WIP). Deployment can be performed using ONNX, pyTorch facilities or TensorRT (WIP). The library is designed to be compatible with Jetson Orin Nano Jetpack rev6.1, with bash script to automatically configure virtualenv.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytorchautoforge-0.6.0.tar.gz (220.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytorchautoforge-0.6.0-py3-none-any.whl (261.1 kB view details)

Uploaded Python 3

File details

Details for the file pytorchautoforge-0.6.0.tar.gz.

File metadata

  • Download URL: pytorchautoforge-0.6.0.tar.gz
  • Upload date:
  • Size: 220.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pytorchautoforge-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4a96dc9819b19e414213aac683586688eac1f8dba144e75d96aa066a1f71d59c
MD5 8f730d501707e74d7ef8b27e565c0c83
BLAKE2b-256 366eb7bdc1683addee5c8ec120fe5c0f921ddf922eebb69b24731a27c4835f1c

See more details on using hashes here.

File details

Details for the file pytorchautoforge-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytorchautoforge-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88afb16934cc3747e1d0a1b981e33415b5bae112591e819f8574f9f5af77a51d
MD5 117d30b3790d3ff7c27d00a0501352cb
BLAKE2b-256 76d3ce7653b9ba67a5bc90dcba4c6607554ae12cef356dc39fc9428f7335f227

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page