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 conversiontico.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.
  • Circle artifact tools — inspect, check, extract, 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+
  • (Optional) one-compiler — only required to run inference with converted Circle models. Conversion itself does not need it.

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 family (2.5 ~ 2.10), an exact version (e.g. 2.7.0+cu118), or nightly. Default: 2.7
--cuda_ver <maj.min> Override the detected CUDA version (e.g. 12.1)
--cpu_only Force a CPU-only Torch installation

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')

[!NOTE] Call eval() on the module before conversion. TICO internally uses torch.export, so the module must be export-able.

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

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, cleanup passes, multi-subgraph and signature behavior, and standard-input/standard-output pipelines.

Quantization

The tico.quantization module provides a unified, modular interface for quantizing neural networks — including large language models — through a simple two-step prepareconvert 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, GPTQConfig())

Documentation

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, 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.

Download files

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

Source Distribution

tico-0.2.0.dev260807.tar.gz (700.3 kB view details)

Uploaded Source

Built Distribution

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

tico-0.2.0.dev260807-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file tico-0.2.0.dev260807.tar.gz.

File metadata

  • Download URL: tico-0.2.0.dev260807.tar.gz
  • Upload date:
  • Size: 700.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tico-0.2.0.dev260807.tar.gz
Algorithm Hash digest
SHA256 d9e6da2d80ab6c61b1d4139b1530b61b89ec565d826b6819d17ae7daedcaafe3
MD5 0ce2a860c9515a60fa9276f53a049492
BLAKE2b-256 ce10f0ac99fa0f427e95ec07c86df6fddeaf389e6ccef8a61510d6dc1bedbb69

See more details on using hashes here.

Provenance

The following attestation bundles were made for tico-0.2.0.dev260807.tar.gz:

Publisher: publish-nightly-package.yaml on Samsung/TICO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tico-0.2.0.dev260807-py3-none-any.whl.

File metadata

  • Download URL: tico-0.2.0.dev260807-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tico-0.2.0.dev260807-py3-none-any.whl
Algorithm Hash digest
SHA256 2ff053304c003a3463f09095dc52a4bac99af2062d921491a169787af073d4a5
MD5 1bfdc5413bb4e433d890982234473965
BLAKE2b-256 997fc2ce50717ef7ae6afdbd7cae93fa5b5adbc32fae6ef1ab08ac88513dcd9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tico-0.2.0.dev260807-py3-none-any.whl:

Publisher: publish-nightly-package.yaml on Samsung/TICO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0.dev260807 This release

2 files

0.1.0

1 file

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