Skip to content

Instantly share code, notes, and snippets.

@santurini
Last active August 8, 2024 06:26
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

@exaithrg
Copy link

exaithrg commented Aug 8, 2024

"# if it runs out of memory try
MAX_JOBS=1 pip install -v ."
Thank you !!!!!!!!!!!
I can't believe 32GB memory is still too small to build neural-spped

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