Skip to content

Instantly share code, notes, and snippets.

@santurini
Last active February 21, 2024 15:53
Show Gist options
  • Save santurini/15f2522cd0f7ac05c3c1cc246267a5dc to your computer and use it in GitHub Desktop.
Save santurini/15f2522cd0f7ac05c3c1cc246267a5dc to your computer and use it in GitHub Desktop.
Step-by-step installation procedure for Intel neural speed
  1. Setup WSL

    • Install wsl: wsl --install -d Ubuntu

    • Run Powershell as Administrator and enter:

      dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
      dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
      wsl --set-default-version 2
      
    • Press Win and type "Windows Features" and toggle:

      • Windows Subsystems for Linux
      • Virtual Machine Platform
  2. Setup Ubuntu environment

    • Access WSL from Powershell:
      wsl
      
    • Update and install packages:
      sudo apt update && sudo apt upgrade
      sudo apt install ffmpeg libgl1-mesa-glx libgl1-mesa-dev libsm6 libxext6 gcc build-essential python-dev*
      
    • Install python dependencies:
      sudo apt install python3.10-venv python3-pip
      
  3. Setup Python environment

    • Create a virtual environment:

      python -m venv path/to/venv/dir/venv_name
      
      # troubleshooting (if you only have python3)
      ln -sf $(which python3) /usr/bin/python
      python -m venv path/to/venv
      
      # if it still doesn't work try with sudo
      sudo python -m venv path/to/venv
      
    • Activate environment:

      source /path/to/venv/dir/bin/activate
      
    • Install useful packages:

      pip install cmake wheel
      
  4. Install ITREX (intell extension for transformers)

    git clone https://github.com/intel/intel-extension-for-transformers.git
    cd intel-extension-for-transformers
    pip install -r requirements.txt 
    pip install -v .
    
    # if it runs out of memory try
    MAX_JOBS=1 pip install -v .
    
  5. Install Neural Speed

    git clone https://github.com/intel/neural-speed.git
    cd neural-speed
    pip install -r requirements.txt 
    pip install -v .
    
    # if it runs out of memory try
    MAX_JOBS=1 pip install -v .
    

Troubleshooting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment