Description
Tracel is a new way of using Burn. It aims at providing a central platform for experiment tracking, model sharing, and deployment for all Burn users!
This repository contains the SDK associated with the project. It provides a Rust API to register your training and inference routines as jobs and dispatch them from a CLI or an HTTP server, sending training data to our application as they run. To use this project you must first create an account on the console.
You'll also want the tracel-cli to log in (tracel login) and store your credentials locally.
Installation
Add Tracel to your Cargo.toml, with the burn feature for the Burn train integration:
[]
= { = "0.11.0", = ["burn"] }
Optional features:
burn: Burntrainintegration (metric logging, checkpoints, progress, interruption).server: the HTTP server front-end,tracel::app::server::Server.stationandrunner: run against a Tracel Station and serve jobs to its queue.
Quick Start
Here's how to integrate Tracel into a Burn training workflow:
1. Register your training function
Wrap your training function into a job with ExperimentModule::create, then register it with a
Cli to run it from the command line:
use Cli;
use JsonMapper;
use ExperimentRun;
use try_init_tracing_subscriber;
use ;
Connection::Cloud reads your credentials from tracel login (or TRACEL_API_KEY) and the
project to report to from a tracel.toml in the working directory (or TRACEL_NAMESPACE and
TRACEL_PROJECT):
= "your-namespace"
= "your-project"
Use Connection::Offline("./runs".into()) instead to record runs locally, without an account.
To dispatch the same job over HTTP, register it with a Server (requires the server feature),
which decodes request bodies with JsonBody and serves each job at POST /{name}:
use ;
new
.port
.register
.run?;
See examples/basics for complete, runnable cli and serve examples.
2. Integrate with your Learner
To enable experiment tracking, attach the experiment to your SupervisedTraining:
use ;
use SupervisedTrainingExperimentExt;
let result = new
.metrics
.num_epochs
.summary
// Experiment metric logging, progress tracking, and interruption handling
.with_experiment
// Experiment model, optimizer, and scheduler checkpoints
.with_experiment_checkpoints
.launch;
For finer control, such as resuming from a previous experiment's checkpoints with
checkpointers_from, ExperimentTrainingExt builds each adapter separately (metric_logger(),
checkpointers(), training_progress_logger(), interrupter()). See
examples/mnist for a complete training run.
3. Run your training
Run your binary with the job's name, optionally followed by a JSON config merged over the default, to track metrics, checkpoints, and logs on the console:
Requirements
- Rust 1.87.0 or higher
- A Tracel account (create one on the console)
- The tracel-cli, to log in and store your credentials locally (or set
TRACEL_API_KEY)
Contribution
Contributions to this repository are welcome. You can also submit issues for features you would like to see in the near future.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.