optimum-rbln


Nameoptimum-rbln JSON
Version 0.7.3.post2 PyPI version JSON
download
home_pageNone
SummaryOptimum RBLN is the interface between the Hugging Face Transformers and Diffusers libraries and RBLN accelerators. It provides a set of tools enabling easy model loading and inference on single and multiple rbln device settings for different downstream tasks.
upload_time2025-03-28 01:54:16
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.9
licenseNone
keywords atom diffusers inference rbln rebel transformers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Optimum RBLN

<div align="center">

<img src="assets/rbln_logo.png" width="60%"/>

[![PyPI version](https://badge.fury.io/py/optimum-rbln.svg)](https://badge.fury.io/py/optimum-rbln)
[![License](https://img.shields.io/github/license/rebellions-sw/optimum-rbln)](https://github.com/rebellions-sw/optimum-rbln/blob/main/LICENSE)
[![Documentation](https://img.shields.io/badge/docs-available-brightgreen)](https://docs.rbln.ai/software/optimum/optimum_rbln.html)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)


</div>

🤗 Optimum RBLN provides an interface between HuggingFace libraries ([Transformers](https://huggingface.co/docs/transformers), [Diffusers](https://huggingface.co/docs/diffusers/index)) and RBLN NPUs, including [ATOM](https://rebellions.ai/rebellions-product/rbln-ca25/) and [REBEL](https://rebellions.ai/rebellions-product/rebel/).

This library enables seamless integration between the HuggingFace ecosystem and RBLN NPUs through a comprehensive toolkit for model loading and inference across single and multi-NPU environments. While we maintain a list of [officially validated models and tasks](https://docs.rbln.ai/software/optimum/optimum_rbln.html), users can easily adapt other models and tasks with minimal modifications.

## Key Features

🚀 **High Performance Inference**
- Optimized model execution on RBLN NPUs through RBLN SDK compilation
- Support for both single and multi-NPU inference
- Integrated with RBLN Runtime for optimal performance

🔧 **Easy Integration**
- Seamless compatibility with HuggingFace Model Hub
- Drop-in replacement for existing HuggingFace pipelines
- Minimal code changes required for NPU acceleration


## Seamless Replacement for Existing HuggingFace Code

```diff
- from diffusers import StableDiffusionXLPipeline
+ from optimum.rbln import RBLNStableDiffusionXLPipeline

# Load model
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
- pipe = StableDiffusionXLPipeline.from_pretrained(model_id)
+ pipe = RBLNStableDiffusionXLPipeline.from_pretrained(model_id, export=True)

# Generate image
image = pipe(prompt).images[0]

# Save image result
image.save("image.png")

+ # (Optional) Save compiled artifacts to skip the compilation step in future runs
+ pipe.save_pretrained("compiled_sdxl")
```

## Documentation

Check out [the documentation of Optimum RBLN](https://docs.rbln.ai/software/optimum/optimum_rbln.html) for more advanced usage.

## Getting Started

> **Note:** The `rebel-compiler` library, which is required for running `optimum-rbln`, is only available for approved users. Please refer to the [installation guide](https://docs.rbln.ai/getting_started/installation_guide.html) for instructions on accessing and installing `rebel-compiler`.

### Install from PyPI

To install the latest release of this package:
```bash
pip install optimum-rbln

# CPU-only installation (recommended if you don't plan to use CUDA-enabled PyTorch)
pip install optimum-rbln --extra-index-url https://download.pytorch.org/whl/cpu
```

### Install from source

#### Prerequisites

- Install [uv](https://docs.astral.sh/uv/) (refer to [this link](https://docs.astral.sh/uv/getting-started/installation/) for detailed commands)

The below command installs `optimum-rbln` along with its dependencies.

```bash
git clone https://github.com/rebellions-sw/optimum-rbln.git
cd optimum-rbln
./scripts/uv-sync.sh
```

### Need Help?

- Join discussions and get answers in our [Developer Community](https://discuss.rebellions.ai/)
- Contact maintainers at [support@rebellions.ai](mailto:support@rebellions.ai)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "optimum-rbln",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9",
    "maintainer_email": null,
    "keywords": "atom, diffusers, inference, rbln, rebel, transformers",
    "author": null,
    "author_email": "\"Rebellions Inc.\" <support@rebellions.ai>",
    "download_url": "https://files.pythonhosted.org/packages/9d/a0/74722e0c25ca176c88db822fe721f59ad5e9116f2ed37a098fdea0efc19a/optimum_rbln-0.7.3.post2.tar.gz",
    "platform": null,
    "description": "\n# Optimum RBLN\n\n<div align=\"center\">\n\n<img src=\"assets/rbln_logo.png\" width=\"60%\"/>\n\n[![PyPI version](https://badge.fury.io/py/optimum-rbln.svg)](https://badge.fury.io/py/optimum-rbln)\n[![License](https://img.shields.io/github/license/rebellions-sw/optimum-rbln)](https://github.com/rebellions-sw/optimum-rbln/blob/main/LICENSE)\n[![Documentation](https://img.shields.io/badge/docs-available-brightgreen)](https://docs.rbln.ai/software/optimum/optimum_rbln.html)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n\n\n</div>\n\n\ud83e\udd17 Optimum RBLN provides an interface between HuggingFace libraries ([Transformers](https://huggingface.co/docs/transformers), [Diffusers](https://huggingface.co/docs/diffusers/index)) and RBLN NPUs, including [ATOM](https://rebellions.ai/rebellions-product/rbln-ca25/) and [REBEL](https://rebellions.ai/rebellions-product/rebel/).\n\nThis library enables seamless integration between the HuggingFace ecosystem and RBLN NPUs through a comprehensive toolkit for model loading and inference across single and multi-NPU environments. While we maintain a list of [officially validated models and tasks](https://docs.rbln.ai/software/optimum/optimum_rbln.html), users can easily adapt other models and tasks with minimal modifications.\n\n## Key Features\n\n\ud83d\ude80 **High Performance Inference**\n- Optimized model execution on RBLN NPUs through RBLN SDK compilation\n- Support for both single and multi-NPU inference\n- Integrated with RBLN Runtime for optimal performance\n\n\ud83d\udd27 **Easy Integration**\n- Seamless compatibility with HuggingFace Model Hub\n- Drop-in replacement for existing HuggingFace pipelines\n- Minimal code changes required for NPU acceleration\n\n\n## Seamless Replacement for Existing HuggingFace Code\n\n```diff\n- from diffusers import StableDiffusionXLPipeline\n+ from optimum.rbln import RBLNStableDiffusionXLPipeline\n\n# Load model\nmodel_id = \"stabilityai/stable-diffusion-xl-base-1.0\"\nprompt = \"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k\"\n- pipe = StableDiffusionXLPipeline.from_pretrained(model_id)\n+ pipe = RBLNStableDiffusionXLPipeline.from_pretrained(model_id, export=True)\n\n# Generate image\nimage = pipe(prompt).images[0]\n\n# Save image result\nimage.save(\"image.png\")\n\n+ # (Optional) Save compiled artifacts to skip the compilation step in future runs\n+ pipe.save_pretrained(\"compiled_sdxl\")\n```\n\n## Documentation\n\nCheck out [the documentation of Optimum RBLN](https://docs.rbln.ai/software/optimum/optimum_rbln.html) for more advanced usage.\n\n## Getting Started\n\n> **Note:** The `rebel-compiler` library, which is required for running `optimum-rbln`, is only available for approved users. Please refer to the [installation guide](https://docs.rbln.ai/getting_started/installation_guide.html) for instructions on accessing and installing `rebel-compiler`.\n\n### Install from PyPI\n\nTo install the latest release of this package:\n```bash\npip install optimum-rbln\n\n# CPU-only installation (recommended if you don't plan to use CUDA-enabled PyTorch)\npip install optimum-rbln --extra-index-url https://download.pytorch.org/whl/cpu\n```\n\n### Install from source\n\n#### Prerequisites\n\n- Install [uv](https://docs.astral.sh/uv/) (refer to [this link](https://docs.astral.sh/uv/getting-started/installation/) for detailed commands)\n\nThe below command installs `optimum-rbln` along with its dependencies.\n\n```bash\ngit clone https://github.com/rebellions-sw/optimum-rbln.git\ncd optimum-rbln\n./scripts/uv-sync.sh\n```\n\n### Need Help?\n\n- Join discussions and get answers in our [Developer Community](https://discuss.rebellions.ai/)\n- Contact maintainers at [support@rebellions.ai](mailto:support@rebellions.ai)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Optimum RBLN is the interface between the Hugging Face Transformers and Diffusers libraries and RBLN accelerators. It provides a set of tools enabling easy model loading and inference on single and multiple rbln device settings for different downstream tasks.",
    "version": "0.7.3.post2",
    "project_urls": {
        "Documentation": "https://docs.rbln.ai",
        "Homepage": "https://rebellions.ai",
        "Repository": "https://github.com/rebellions-sw/optimum-rbln"
    },
    "split_keywords": [
        "atom",
        " diffusers",
        " inference",
        " rbln",
        " rebel",
        " transformers"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5440583c47cad30e1310c3df5ae7f3dcf930a96e89a0e74ae93c88c07025946d",
                "md5": "bee027eb7fa1fbdd0e3f3fa832a5fb4d",
                "sha256": "37b5a0ae3f28bd05ca7e4cf269678836032003428b60f2e0c709e038a5fafd0b"
            },
            "downloads": -1,
            "filename": "optimum_rbln-0.7.3.post2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bee027eb7fa1fbdd0e3f3fa832a5fb4d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.9",
            "size": 225402,
            "upload_time": "2025-03-28T01:54:14",
            "upload_time_iso_8601": "2025-03-28T01:54:14.896449Z",
            "url": "https://files.pythonhosted.org/packages/54/40/583c47cad30e1310c3df5ae7f3dcf930a96e89a0e74ae93c88c07025946d/optimum_rbln-0.7.3.post2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9da074722e0c25ca176c88db822fe721f59ad5e9116f2ed37a098fdea0efc19a",
                "md5": "95c09064d46d88ce992547bbcf24af24",
                "sha256": "a45cdc6651f02482a6e8622b575bf790e54008fbb1327452de9f7d0080d90bd5"
            },
            "downloads": -1,
            "filename": "optimum_rbln-0.7.3.post2.tar.gz",
            "has_sig": false,
            "md5_digest": "95c09064d46d88ce992547bbcf24af24",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9",
            "size": 260894,
            "upload_time": "2025-03-28T01:54:16",
            "upload_time_iso_8601": "2025-03-28T01:54:16.737499Z",
            "url": "https://files.pythonhosted.org/packages/9d/a0/74722e0c25ca176c88db822fe721f59ad5e9116f2ed37a098fdea0efc19a/optimum_rbln-0.7.3.post2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-28 01:54:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rebellions-sw",
    "github_project": "optimum-rbln",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "optimum-rbln"
}
        
Elapsed time: 0.42909s