Hands-On Lab With LLMs and Gen AI Within IDC

Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

Hands on Lab with LLMs and

Gen AI
Within IDC

Abhishek Nandy
Chief Data Scientist PrediQt Business
Solution pvt ltd
Intel® DeveloperCloud
Please follow the steps below to get developer access to Intel® Developer
Cloud: 1. Go to Intel Developer Cloud: https://cloud.intel.com/
2. Click Get Started.
3. Register for a “Standard” account by completing the Standard registration
form. 4. Log in via the Intel Developer Cloud landing page
https://cloud.intel.com/ 5. Select the Training catalog in the Intel® Developer
Cloud portal.
IntelConfidential
Department or Event Name 2

Intel Confidential –Internal Use Only


SATG –Software Products & Ecosystem

Intel® DeveloperCloud Overview


Home landing
page:
• Account
registration
• Login
• News updates
• Account types
• FAQ
http://cloud.intel.com

Cloud portal:
• Account admin
• Quick start home page
• Service Instances
• Hardware catalog
• Software catalog
https://console.idcservice.net/docs/index.html
• References • Knowledge base • Community support •
• Support Ticketing
• Release notes • 24 x 7 support
• DedicatedSRE team

Documentation page: • Guides


• Tutorials
Service desk:
https://console.idcservice.net/ • Training catalog https://supporttickets.intel.com/

Intel Confidential –Internal Use Only


SATG –Software Products & Ecosystem
IntelConfidential
Department or Event Name 3

Intel® DeveloperCloud
onCloud.intel.com Click Subscribe for “StandardTier to create
new account

New User Account Creation

Select Get Started


Welcome to Intel
Developer Cloud
SATG –Software Products & Ecosystem

Enter Your details


Enter OTP code
you received in
your email

Intel® DeveloperCloud
Existing User Account with other Intel

service access
Select Already
Enter Email and Password
Member? Sign In
onCloud.intel.com

Welcome to Intel
Developer Cloud

SATG –Software Products & Ecosystem


Click“ChooseStandard”

5
Intel® DeveloperCloud
Training Catalog
SATG –Software Products & Ecosystem
I
6

Intel® DeveloperCloud
Training Catalog –One-Click Jupyter Access
I
m
One-click Jupyter
access

7
Intel® DeveloperCloud
Hardware Catalog

Intel® DeveloperCloud
Deploy and Access the Hardware Platform
I
9

Lets start with all being


registered at IDC •
We will pause and see that everybody is on IDC!

oneAPI Industry ApplicationWorkloadsNeedDiverseHardware

Initiative Middleware & Frameworks

...
Breakthe Chains of ProprietaryLock-inFreedom
oneAPIIndustrySpecification

to Make Your Best Choice

▪ C++programming model for multiple Cross-architecture code reuse Realize allthe Hardware Value
architectures and vendors ▪ forfreedom from vendor lock-in
DirectProgramming SYCL (C++) Comm
Volumetri

API-BasedProgramming
Analytics
c
DNN ML Renderin
Math Threading Parallel STL Ray Tracing / ML g

▪ Performance across CPU, GPUs, FPGAs, and other accelerators Signal


Processin g Image
Processin g
Processin g Image Denois e
Video

▪ Expose and exploit cutting-edge features of the latest


hardware

Develop & Deploy Software with Peace of Mind


▪ Open industry standards provide a safe, clear path to the
future

Low-LevelHardware Interface(oneAPILevelZero)

▪ Interoperable with familiar languages ▪ Powerful libraries for acceleration of CPU GPU FPGA
Other
and programming models including domain-specific functions Accelerators
Fortran,Python, OpenMP, and MPI

11
Intel®oneAPIToolkits
A completesetofprovendeveloper toolsexpandedfromCPU toAccelerators

A core set of high-performance libraries and tools for building C++,SYCL and Python applications

& MPI applications that scale Intel®oneAPIRendering


Intel®oneAPITools for
Toolkit Create performant, high-fidelity
Intel®oneAPITools for IoT Build efficient, reliable solutions visualization applications
HPC Deliver fast Fortran, OpenMP that run at network’s edge

Intel®AIAnalytics Toolkit
Accelerate machine learning & data
science pipelines end-to-end with
optimized DL frameworks & high
performing Python libraries
Latest version available 2023.1

Intel®Distributionof
OpenVINO™Toolkit
Deploy high performance inference & applications from edge to 12
cloud

® developers, AI application developers

Intel AI
Top Features/Benefits
Analytics MachineLearning

Toolkit
Intel®Extension forScikit-learn Intel-optimizedXGBoost

DeepLearning

Intel®OptimizationforTensorFlow
DataAnalytics
Accelerate end-to-end AI and data
analytics pipelines with libraries Intel®OptimizationforPyTorch Intel®NeuralCompressor
Intel®Distributionof Modin OmniSciBackend
optimized for Intel® architectures
ModelZoo for Intel®Architecture

Who Uses It? Intel®AIAnalyticsToolkit Intel-optimizedPython

Data scientists,AI researchers,ML and DL Numba DataParallel

▪ Deep learning performance for training and inference withInteloptimized


DL frameworksand tools

▪ Drop-inacceleration for dataanalytics


and machine learning workflows with Learn More: software.intel.com/oneapi/ai-kit
compute-intensive Python packages
Python NumPy SciPy Pandas
Back to Domain-specific Toolkits for Specialized Workloads

CPU GPU

Hardwaresupportvariesbyindividualtool.Architecturesupport willbeexpandedover time.

GettheToolkitHERE orviatheselocations

Intel Installer Docker Apt,Yum Conda Intel®DevCloud

1199

AI Reference Kits
Machine Learning Pipeline

DataProcessingFeature
EngineeringModelTraining HyperTuning Quantization Inferencing
AI Reference Kit
includes:
• Solution Brief(s)
• Developer Guide(s)
• Reference Code Repository
• Platform Architecture Guide
• Example Benchmarking results

14

Large Language Models


Large Language Models

GPT

BERT
Flan-T5

BLOOM
PaLM 16

Llama

Large Language Models

Prompt Model Completion


Explain
LLM
antibiotics
resistance.

More on LLMs

• Large Language Models (LLMs) are machine


17 learning models designed to understand, generate,
Explain antibiotics and

Antibiotics are
medications used to treat bacterial infections
by either killing the bacteria or stopping them
from reproducing, but they are not effective
against viruses and overuse can lead to
antibiotic
manipulate human language. They are based
on neural network architectures, typically
transformers, that are trained on vast
amounts of text. Examples include OpenAI's GPT series (like the one you're interacting with) and BERT
from Google. The "large" refers to the number of parameters or weights in the model, which can be in the
billions or even trillions. LLMs can be used for a wide range of tasks including translation, question
answering, and text generation.

What is OpenAI API andhow we use it


This Link allows us to view our keys for Open AI
https://platform.openai.com/account/api-keys
What is Langchain?
JavaScript, and can be used to build applications on a variety
of platforms, including web servers, cloud computing
platforms, and mobile devices.

• LangChain is an open-source framework for developing


applications powered by large language models (LLMs). It
provides a standard interface for interacting with LLMs, as
well as a number of utilities and integrations that make it
easier to build and deploy LLM-powered applications.

• LangChain is designed to be used by developers of all skill


levels, from beginners to experts. It is written in Python and

Exploring Dev Cloud


Launching Jupyterlab
Using the launcher
Launching the terminal
Cloning the Github repo

https://github.com/AbhiLegend/RoadshowLLM
Lab exercise1
• Make sure you have the OpenAI key to get started
• https://platform.openai.com/account
Basics LLMOpenAI notebook

• How to use LLM


• How to use the OpenAI Key
• Exploring LLM with the OpenAI model
Basics LLMOpenAI notebook

• How to use LLM


• How to use the OpenAI Key
• Exploring LLM with the OpenAI model

Prompt templates
Prompt templates are predefined textual structures or frameworks that guide the generation of content.
They can be seen as a blueprint or a pattern for generating specific types of output. In the context of
natural language processing and AI models like GPT, a prompt template is a way to structure your input so
that the model can produce the desired output.

Prompt template Notebook


How to construct Prompt template
Exploring no input prompt
One input prompt
Multiple input prompt

Simple LLM Object


Just like our most basic LLM and Chat model Calls earlier in model IO, chains have a basic building block
known as LLM chain object.
We can think of an LLM Chain as just a simple call.

LLM Object Notebook


Just like our most basic LLM and Chat model Calls earlier in model IO, chains have a basic building block
known as LLM chain object.
We can think of an LLM Chain as just a simple call.
Explore the LLMObject notebook.
Sequential Chain

LLMChain LLMChain LLMChain


Sequential Chain

LLMChain LLMChain LLMChain


Sequential Chain
Notebook

• Now that we understand how to use the LLMChain


object, we can chain them together to create more
complex functionality with Langchain.

OpenAI Embeddings
Vector Store
• Langchain supports many text embeddings, that can directly
convert string text to an embedded vectorized representation.
• Later on we can store these embedding vectors and then perform
similarity searches between new vectorized documents or strings
against or vector store.

Vector Store Key Attributes:


Can store large N-dimensional vectors.
Can directly index an embedded vector to its associated string text
document.
Can be “queried”, allowing for a cosine similarity search between a new vector not in the database and the stored vectors.
Can easily add, update, or delete new vectors.
OpenAI Embeddings notebook
Gen AI Essentials
Notebook
Simple LLM Inference
what generative AI can do when powered by the Intel® Data Center GPU Max Series.
QnA time
GAN
GAN stands for Generative Adversarial Network. It is a type of machine learning model that can be used to generate new
data, such as images, text, and music. GANs work by training two neural networks to compete with each other. One network, called
the generator, tries to create new data that looks like the real data. The other network, called the discriminator, tries to tell the
difference between the real data and the fake data generated by the generator.

Stable Diffusion
Stable Diffusion
Text to Image with Stable Diffusion Notebook

Text-to-Image with Stable Diffusion


QnA time Gen AI
Coordinates and code
ttps%3A%2F%2Fwww.google.com%2F Youtube channel link
https://www.youtube.com/channel/UCD1IBC7l6QNpPNMYj
ubi0tg

Code
https://github.com/AbhiLegend/RoadshowLLM

Linkedin
https://in.linkedin.com/in/abhishek-nandy?original_referer=h
Thank you

You might also like