Giter Club home page Giter Club logo

snowflake_workshop's Introduction

BUILD LLM Bootcamp 2023 Day 2: Fine-tune and Deploy Llama 2 in Snowpark Container Services

Prerequisite

Successfully completed BUILD LLM Bootcamp Day 1.

Snowpark Container Services (SPCS) User Account

Get exclusive access to Snowpark Container Services - currently in Private Preview - by clicking on the link provided during the LLM Bootcamp session.

NOTE: If you are not able to get a SPCS user account, you can still attend sessions on Day 1 and Day 2 to earn the badge after completing the assessment by December 8, 2023 11:59PM Pacific Time.

Environment Setup

Step 1: Snowflake Login

Log into Snowflake account using your credentials -- https://app.snowflake.com/sfsenorthamerica/build_spcs

Step 2: Create SQL Worksheet

After you log into your Snowflake account, click on Worksheets on the left navigation menu and then click on '+' button on top right and select SQL Worksheet.

Step 3: Select Database, Schema, and Warehouse

In the SQL Worksheet, run the following commands to select database, schema, and warehouse assigned to you:

use DB_USER####.SCHEMA_LLM;
use WAREHOUSE WH_XS_USER####;

NOTE: In the above SQL, replace #### in database name and warehouse with your user number.

Step 4: Compute Pool Status

Check the status of your compute pool by running the following command:

show compute pools;

NOTE: If the state of your compute pool is STARTING or RESIZING, wait a few mins until it's in IDLE or ACTIVE state before proceeding.

Step 4: Free up Resources

Drop service from Day 1 to free up resources for Day 2 by running the following commands:

show services;

Assuming you have successfully completed hands-on lab from Day 1, the above command will list service that was created when you deployed Llama 2 from Hugging Face in SPCS. If that's the case, run the following command to drop that service.

drop service SERVICE_ID_GOES_HERE;

NOTE: The service ID should like something like SERVICE_FD43C8AA84BD11EE8E7CE246F4FD5A27

Step 5: Create Jupyter Notebook Service

Run the following command to create the service that will host the Jupyter Notebook which will be accessible via a public endpoint.

create service FINETUNE_LLM_SERVICE
  MIN_INSTANCES = 1
  MAX_INSTANCES = 1
  COMPUTE_POOL = COMPUTE_POOL_USER####
  SPEC = '@yaml_stage/llm-bootcamp.yaml';

NOTE: In the above SQL, replace #### in compute pool name with your user number.

Step 6: Jupyter Notebook Service Status

Run the following command to check the status of FINETUNE_LLM_SERVICE service

select 
  v.value:containerName::varchar container_name
  ,v.value:status::varchar status  
  ,v.value:message::varchar message
from (select parse_json(system$get_service_status('FINETUNE_LLM_SERVICE'))) t, 
lateral flatten(input => t.$1) v;

NOTE: Make sure the Status is set to READY and Message is set to Running before proceeding.

Step 7: Jupyter Notebook Service Endpoint

Run the following command to access the endpoint where Jupyter Notebook is hosted in SPCS.

show endpoints in service FINETUNE_LLM_SERVICE;

In the Results section look for a column named ingress_url and copy the URL. It should look something similar to bab5b3y-sfsenorthamerica-build-spcs.snowflakecomputing.app

NOTE: Make sure the Status is set to READY and Message is set to Running before proceeding.

Hands-on Lab: Fine-tune and Deploy Llama 2 in Snowpark Container Services

  • Open a new browser window and paste the Jupyter Notebook service endpoint URL copied in step 7
  • Login using your Snowflake credentials
  • On the left hand side, double click on llm-day2-notebook.ipynb
  • Follow instructions and run through each cell in the Notebook

snowflake_workshop's People

Contributors

coldra1n avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.