Computer

Windows AI Studio and Phi-2: Optimize generative models locally with WSL

Windows AI Studio and Phi-2: Optimize generative models locally with WSL

During the Microsoft Ignite 2023 conference, the Redmond company announced the imminent release of Phi-2an LLM (Large Language Model) which is not that large, compared to many other alternatives available today. Actually, it’s a good thing because with just 2.7 billion parameters, Phi-2 shows comparable performance to models up to 25 times heavier. Phi-2 will soon become usable thanks to Windows AI Studioa Microsoft solution that simplifies the development of AI-powered generative apps.

What is Windows AI Studio and how it works

With the return of Sam Altman as head of OpenAI, Microsoft has even strengthened its position within the company by making it clear that the future of the company responsible for the evolution of GPT models (Generative Pre-trained Transformer), the ChatGPT chatbot, the DALL-E generative image model, and new tools multimodal based on artificial intelligence which will be shaped shortly, represents an essential driving force for the business of the multinational led by Satya Nadella.

Further new confirmation now arrives with the publication of Windows AI Studio, a software that combines advanced tools for AI development of artificial intelligence drawing on both Microsoft resources (including the Azure platform) and sources such as Hugging Face.

With Windows AI Studio it becomes possible to “browse the catalog” of AI models powered by Azure ML e Hugging Face, download them locally, refine them, test them and use them in your applications. Since all processing occurs locally, you need to have the hardware capable of supporting the workloads generated by Windows AI Studio.

Compatibility with NVidia GPUs and use of WSL (Windows Subsystem for Linux)

It is curious to note that Windows AI Studio, at least for the moment, is based on GNU/Linux. To use the new tool, in fact, developers, engineers and data scientist must necessarily install to enable WSL (Windows Subsystem for Linux) in Windows 10 or Windows 11. This is the Microsoft component that allows you to run the vast majority of Linux distributions directly from a Windows window (there is also the possibility of running individual Linux programs from the Start menu or the desktop…).

We have seen how to use Linux in Windows with WSL: in the case of Windows AI Studio, it is essential to install one Ubuntu distribution 18.4 or later. Furthermore, the latest releases of WSL present great innovations in terms of resource and network management.

Furthermore, for now, Windows AI Studio is exclusively compatible with GPU NVIDIA and is provided as an extension for Visual Studio Code.

The use of Windows AI Studio, therefore, first involves downloading and installing VS Code and then proceeding with loading the add-on via the Microsoft Store.

Once the installation of Windows AI Studio is complete, a system check allows you to ensure that all the resources are available: after checking the prerequisites, you can complete the environment configuration by clicking on the “Set Up WSL Environment“.

How to get started working with Windows AI Studio

To use Windows AI Studio you must first log in with a account GitHub. Once this simple step is completed, when Windows AI Studio launches, you can choose from some options:

  • Model Fine-tuning
  • RAG Project
  • Phi-2 Model Playground
  • Windows Optimized Models

The first and last are the only ones that can currently be selected and used; the other two – Microsoft promises – will be added shortly.

With the Model Fine-tuning, you can start a local optimization session of a generative model chosen from the AzureML catalog. You don’t need an Azure account to download the models which, thanks to the QLoRA approach (Quantized Low-Rank Adaptation) and Windows AI Studio, can be enriched and optimized.

Windows Optimized Models instead, it’s a collection of AI models already optimized for Windows, available in several places, including Hugging Face, GitHub, and so on. You can browse templates and find them all in one place, ready for download and direct integration into your Windows applications.

The Phi-2 model, soon integrated into Windows AI Studio

Despite its compact size, the model Microsoft Phi-2 stands out for its ability to compete and outperform models trained with a significantly higher number of parameters, even on complex benchmarks. And this is thanks to some innovations that improve the scalability of the model and to the particular care taken in the training phase.

According to Microsoft technicians, Phi-2 surpasses Mistral and Llama-2, based – respectively – on 7 billion and 13 billion parameters. The behavior of Phi-2 would also be comparable to the model Gemini Nano 2 of Google, despite its smaller size.

Phi-2 Microsoft AI model

Using Phi-2 Model Playgroundit will soon become possible – for Windows AI Studio users – to directly use and experiment with the most recent model unveiled by Nadella and his team.

We suggest keeping an eye on the repository GitHub of Windows AI Studio to know in advance all the evolutions of this promising tool.

Opening image credit: iStock.com/Choreograph

Leave a Reply

Your email address will not be published. Required fields are marked *