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.5.0.tar.gz (209.4 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.5.0-py3-none-any.whl (246.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytorchautoforge-0.5.0.tar.gz
Algorithm Hash digest
SHA256 06e3c8c66d7800dd2083b971eba41eec744d75342c197b182f88074b49e1bada
MD5 5871ae6612700fd23dd47dfe7816c94e
BLAKE2b-256 08e23302929ce60dd1d94fc4432cf6749d6fe9b2ed8a340d50335d5e9f9175e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytorchautoforge-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a82115affc568840d47435df1c3c733db173085ffd660511e12f68a2dcd9361e
MD5 4d2ea9b6f132c5f558a9a3e79478def5
BLAKE2b-256 5bde15e4b0678213ff638259fd7d23e9a78b6a6be70087b89a142b16d4188f29

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