Skip to main content

QuantizeTK

QuantizeTK is a Python library that provides a set of utilities for model optimization and quantization. It simplifies the process of loading optimized and quantized models using OnnxRuntime, along with pre-trained base models. The library is built on top of transformers and optimum.

Installation

pip install quantizetk

Features

  • Load optimized, quantized, or base pipelines
  • Supports models in the OnnxRuntime ecosystem
  • Comprehensive logging and validation utilities
  • Configurable optimization and quantization settings

Quick Start

Initialize a New Pipeline

from quantizetk import init_pipeline

pipeline = init_pipeline(model_id="your_model_id")

Load an Existing Pipeline

from quantizetk.pipeline.load import load_pipeline

pipeline = load_pipeline()

Directory Structure

quantizetk/
│
├── pipeline/
│   ├── create.py
│   ├── load.py
│   └── __init__.py
│
├── shared/
│   ├── constants.py
│   ├── utils/
│   │   ├── validate.py
│   │   └── math_util.py
│   └── __init__.py
│
└── __init__.py

API Overview

pipeline.create

  • create_pipeline(...)

pipeline.load

  • load_pipeline(save_dir, file_name)

shared.utils

validate

  • validate_pipeline(pipeline, pipeline_type, contents)

math_util

  • normalize(obj, p, dim)
  • mean_pooling(model_output, attention_mask)

shared.constants

  • Configuration and path constants

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Metadata

Release files for quantizetk 0.0.1

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

Source distribution (sdist)

Source distribution for quantizetk 0.0.1
File Size Uploaded
quantizetk-0.0.1.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quantizetk 0.0.1
File Interpreter ABI Platform
quantizetk-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / quantizetk-0.0.1.tar.gz

Download URL quantizetk-0.0.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7c92040cbfe3e29a82439c73cc431cd8e1bfa44935e725755f767803f5edbd3e
BLAKE2b-256 checksum
How to use checksums
37b6fc4b3c614d02bca812e3b1064c0a8c81ee81baa07fadc81c06cd90e30ae3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.9.13 Darwin/22.6.0

Release files / quantizetk-0.0.1-py3-none-any.whl

Download URL quantizetk-0.0.1-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfc50d2dfc49cf4aff315491d71ae9d3b070761910e0282340adb0f2ede3a34e
BLAKE2b-256 checksum
How to use checksums
d1582a32abe33837b7e157c3b7dfb3f9601615250bce7538c3ed7e9d2779183f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.9.13 Darwin/22.6.0

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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