Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

TICO — Torch IR to Circle

TICO (Torch IR to Circle ONE) is a Python library that converts PyTorch modules into Circle models — a lightweight and efficient representation in ONE designed for optimized on-device neural network inference.

Highlights

  • One-call conversion — tico.convert() turns an nn.Module into a ready-to-deploy .circle binary.
  • .pt2 support — convert saved torch.export programs via the Python API or the pt2-to-circle command-line tool.
  • Run Circle models in Python — execute converted models directly for quick parity checks against PyTorch.
  • Generate from LLaMA Circle bundles — reload exported stages and host context for greedy generation without the original checkpoint. See the generation guide.
  • Circle artifact tools — inspect, verify, extract, optimize, and clean up exported .circle graphs with the tico.circle API or tico-circle CLI.
  • Quantization toolkit — a unified prepare/convert API with GPTQ, PTQ (WrapQ), SmoothQuant, SpinQuant, and CLE, plus config-driven CLI recipes for LLMs and VLMs.

Installation

Prerequisites

  • Python 3.10+
  • No ONE or onert installation is needed: conversion and Circle execution (CircleModel.__call__()) use TICO's built-in reference runtime. ONE's circle-interpreter and onert can optionally be selected as external runtimes.

We highly recommend using a virtual environment (e.g., conda, venv).

From PyPI

pip install tico

From source

git clone https://github.com/Samsung/TICO.git
cd TICO

./ccex build     # generates build/ and dist/
./ccex install   # installs the package

./ccex install options

Option Description
--dist Install from the built wheel (default is editable mode)
--torch_ver <ver> Torch version to install: a configured family (2.5 ~ 2.14; 2.5 ~ 2.10 are legacy best-effort and 2.14 is a candidate), an exact version (e.g. 2.14.1+cu132), nightly (repository-pinned), or nightly-latest (moving Torch/TorchVision pair). Default: 2.13
--cuda_ver <maj.min> Override the detected CUDA version (e.g. 12.1)
--cpu_only Force a CPU-only Torch installation

./ccex install pins the newest qualified stable family for a reproducible source setup. Older configured families remain explicitly installable, while pyproject.toml keeps an unbounded torch dependency so pip install does not reject a user-managed Torch version. See the PyTorch version policy for the installer, support, and CI tiers.

Quick start

import tico
import torch

class AddModule(torch.nn.Module):
    def forward(self, x, y):
        return x + y

torch_module = AddModule()
example_inputs = (torch.ones(4), torch.ones(4))

circle_model = tico.convert(torch_module.eval(), example_inputs)
circle_model.save('add.circle')

Converting a saved .pt2 file from the command line:

pt2-to-circle -i add.pt2 -o add.circle

See the Getting Started guide for compile configurations, .pt2 conversion, and running Circle models directly in Python.

Circle artifact tools

tico.circle provides Python APIs and the tico-circle CLI for inspecting and transforming exported .circle files.

tico-circle inspect model.circle --tensors --operators
tico-circle verify model.circle
tico-circle extract model.circle --ops 20-64 -o region.circle
tico-circle optimize model.circle --preset o1 -o model.o1.circle

verify performs a static internal-consistency check of the Circle artifact itself, including indices, graph connections, buffers, signatures, and subgraph references. It does not run inference or validate numerical accuracy or backend compatibility.

See the Circle artifact tools guide for the Python API, exact verification rules, extraction semantics, semantic optimization and cleanup passes, O1 scheduling, multi-subgraph and signature behavior, and stream pipelines.

Quantization

The tico.quantization module provides a unified, modular interface for quantizing neural networks — including large language models — through a simple two-step prepare → convert workflow:

from tico.quantization import prepare, convert
from tico.quantization.config.gptq import GPTQConfig

prepared_model = prepare(model.eval(), GPTQConfig())

for d in dataset:          # calibration
    prepared_model(d)

quantized_model = convert(prepared_model)

Documentation

Use the documentation index to find project guides, subsystem references, worked examples, test documentation, and historical design documents.

For users

Document Description
Getting Started Converting modules and .pt2 files, compile configuration, running Circle models directly in Python
Circle artifact tools Inspecting, verifying, extracting, optimizing, and cleaning up exported Circle models
Quantization The prepare/convert quantization API and toolkit
Quantization examples Command-line quantization, evaluation, and debugging workflows

For developers

Document Description
Development guide Environment setup, testing, and code formatting with ./ccex
System design Architecture, pass pipeline, invariants, and behavior design
Circle artifact tools Circle pass contracts, index rewriting, verification, and test expectations
Requirements Functional and non-functional requirements
System tests System-level test coverage

Contributing

Contributions are welcome! For quantization algorithms, start with the quantization contribution guide and the recipes developer guide. Before submitting a PR, set up the development environment and run the tests and formatter as described in the development guide.

License

Licensed under the Apache License 2.0 — see LICENSE.

Metadata

Release files for tico 0.4.0.dev261112

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

Source distribution (sdist)

Source distribution for tico 0.4.0.dev261112
File Size Uploaded Provenance Actions
tico-0.4.0.dev261112.tar.gz 1.2 MB With provenance Details for tico-0.4.0.dev261112.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tico 0.4.0.dev261112
File Interpreter ABI Platform Actions
tico-0.4.0.dev261112-py3-none-any.whl Python 3 none any Details for tico-0.4.0.dev261112-py3-none-any.whl

Total release size: 3.0 MB

Release files / tico-0.4.0.dev261112.tar.gz

Download URL tico-0.4.0.dev261112.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
d60d6ca2fc31f3d33a2d3547008879e3a90e3aa4aaf5a35fb84c65ac45e7ecd3
BLAKE2b-256 checksum
How to use checksums
c469bbc3fa2a4470af48c1d7e64d0391650a6b02bb6c01709534a84b15f21f50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / tico-0.4.0.dev261112-py3-none-any.whl

Download URL tico-0.4.0.dev261112-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6ce5c06a41eec29dd2c49c8751e503ba173fb678755b474176f8a6438a6175a6
BLAKE2b-256 checksum
How to use checksums
034615f0109449bec2cbf1434ab30337efb75344210a782de8ccaa52f7decf6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for tico 0.4.0.dev261112

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tico-0.4.0.dev261112.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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