Pruna Pro Interface

pruna_pro is our premium offering that provides advanced compression algorithms and features to help you achieve better model compression results. This guide will help you get started with pruna_pro and explain how to transition from the open-source pruna. Make sure to check out the installation instructions in Installing Pruna with Pip and Conda first.

Transitioning from pruna to pruna_pro

If you’re already familiar with pruna, transitioning to pruna_pro is straightforward. The main interfaces remain the same, with just a few adjustments:

  1. Import from pruna_pro instead of pruna:

    from pruna_pro import smash  # instead of: from pruna import smash
    
  2. Use the same familiar workflow with enhanced capabilities:

    • The algorithm documentation applies to both versions

    • Configuration parameters work the same way

    • All pruna features are available in pruna_pro, with additional advanced options

Example of transitioning a basic smashing script:

# Original pruna code
import torch
from diffusers import StableDiffusionPipeline
from pruna import smash, SmashConfig

model = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16)

smash_config = SmashConfig()
smash_config['cacher'] = 'deepcache'
smashed_model = smash(model, smash_config)
# pruna_pro equivalent
import torch
from diffusers import StableDiffusionPipeline
from pruna_pro import smash, SmashConfig

model = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16)

smash_config = SmashConfig()
smash_config['cacher'] = 'deepcache'
smashed_model = smash(model, smash_config, token='<your_pruna_token>')

Key Features in pruna_pro

pruna_pro includes all features from the open-source version plus premium capabilities:

  • Advanced compression algorithms

  • Optimization agent that automatically finds the best compression configuration for your model

  • Quality recovery algorithms that can recover the accuracy of a smashed model

  • Priority support

For a complete feature comparison and pricing details, visit our pricing page.

Note

The documentation for core features applies to both pruna and pruna_pro. When a feature is Pro-only, it will be clearly marked with a “Pro” badge.