Skip to main content

Test

optimum-furiosa

Accelerated inference of 🤗 models using FuriosaAI NPU chips.

Furiosa SDK setup

A Furiosa SDK environment needs to be enabled to use this library. Please refer to Furiosa's Installation guide.

Install

To install the latest release of this package:

pip install optimum[furiosa]

Optimum Furiosa is a fast-moving project, and you may want to install from source.

pip install git+https://github.com/huggingface/optimum-furiosa.git

Installing in developer mode

If you are working on the optimum-furiosa code then you should use an editable install by cloning and installing optimum and optimum-furiosa:

git clone https://github.com/huggingface/optimum
git clone https://github.com/huggingface/optimum-furiosa
pip install -e optimum -e optimum-furiosa

Now whenever you change the code, you'll be able to run with those changes instantly.

How to use it?

To load a model and run inference with Furiosa NPU, you can just replace your AutoModelForXxx class with the corresponding FuriosaAIModelForXxx class.

import requests
from PIL import Image

- from transformers import AutoModelForImageClassification
+ from optimum.furiosa import FuriosaAIModelForImageClassification
from transformers import AutoFeatureExtractor, pipeline

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

model_id = "microsoft/resnet-50"
- model = AutoModelForImageClassification.from_pretrained(model_id)
+ model = FuriosaAIModelForImageClassification.from_pretrained(model_id, export=True, input_shape_dict={"pixel_values": [1, 3, 224, 224]}, output_shape_dict={"logits": [1, 1000]},)
feature_extractor = AutoFeatureExtractor.from_pretrained(model_id)
cls_pipe = pipeline("image-classification", model=model, feature_extractor=feature_extractor)
outputs = cls_pipe(image)

If you find any issue while using those, please open an issue or a pull request.

Metadata

Release files for optimum-furiosa 0.1.0

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

Source distribution (sdist)

Source distribution for optimum-furiosa 0.1.0
File Size Uploaded Provenance Actions
optimum-furiosa-0.1.0.tar.gz 22.6 kB Without provenance Details for optimum-furiosa-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for optimum-furiosa 0.1.0
File Interpreter ABI Platform Actions
optimum_furiosa-0.1.0-py3-none-any.whl Python 3 none any Details for optimum_furiosa-0.1.0-py3-none-any.whl

Total release size: 47.2 kB

Release files / optimum-furiosa-0.1.0.tar.gz

Download URL optimum-furiosa-0.1.0.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6207d570bc183456c65e08994e49948867d8459f792c566c7c732639513dd739
BLAKE2b-256 checksum
How to use checksums
58e1b29668f003cf589e342f537a958e86bd7e9c70c12217c48db712c8fa4e27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / optimum_furiosa-0.1.0-py3-none-any.whl

Download URL optimum_furiosa-0.1.0-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13904bd5d45563e7d525478d07f7d2c4a1311a70091f1bb5058d2f2d19478e93
BLAKE2b-256 checksum
How to use checksums
52dca0dcd5553a549ccbcac6bdb612301b06f068b213559314c12d6538a04a4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Security for optimum-furiosa 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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