Installation Guide

Requirements

python>=3.10 is required to run HGQ2. We recommend using python>=3.11 for better performance and compatibility.

HGQ2 is built on Keras v3, and essentially requires the same dependencies as Keras. Keras v3 supports multiple backends, including TensorFlow, JAX, and PyTorch. The following are the recommended versions for each backend:

  • tensorflow>=2.16

  • jax>=0.4.28

  • torch>=2.5.0

You’ll need to have at least one of these backends installed in your environment to train models with HGQ2.

Basic Installation

HGQ2 is not yet available on PyPI, so you’ll need to install it from the GitHub repository. Install HGQ2 directly from the repository:

# For development (editable installation)
glt clone https://github.com/calad0i/HGQ2
cd HGQ2
pip install -e .

# For regular installation
pip install 'git+https://github.com/calad0i/HGQ2'

Troubleshooting

Common Issues

  1. Incompatible Keras Version: HGQ2 requires Keras v3. If you see errors related to missing attributes or incompatible methods, check your Keras version:

    import keras
    print(keras.__version__)  # Should be 3.x
    
  2. hls4ml Conversion Issues: If you encounter errors during hls4ml conversion, make sure you’re using the recommended fork:

    pip uninstall hls4ml  # Remove any existing installation
    pip install git+https://github.com/calad0i/hls4ml.git@da4ml-v2
    

Getting Help

If you encounter issues not covered here:

  1. Check the FAQ section in the documentation

  2. Open an issue on the GitHub repository with details about your environment and the encountered error - or -

  3. Ask for help on the FastML Slack workspace in the #hgq2 channel

Next Steps

Check out the Getting Started Guide to learn how to use HGQ2 for quantization-aware training.