Digital Alchemy Lab

Digital Alchemy Lab

Home
Notes
AI Chronicles
Archive
About

Share this post

Digital Alchemy Lab
Digital Alchemy Lab
Making Sure Everything's Ready: Your AI Setup Checklist
AI Chronicles

Making Sure Everything's Ready: Your AI Setup Checklist

Building in Public: Part 2 - Is Your AI Kitchen Really Ready? 🧐

Devon Artis's avatar
Devon Artis
Nov 09, 2024
4

Share this post

Digital Alchemy Lab
Digital Alchemy Lab
Making Sure Everything's Ready: Your AI Setup Checklist
1
Share
Cross-post from Digital Alchemy Lab
Before teaching AI to spot harmful content, let’s make sure our setup is actually ready no cold ovens here! In this second part, I’m sharing how (and why) we verify everything’s working before the real experiments begin so you can avoid rookie mistakes like mine. Read on for the practical prep! -
Devon Artis

Hey there, Alchemists! 👋

Last time we talked about the importance of AI bias and our exciting journey ahead. Today, we're going to do something super important - we're going to make absolutely sure our AI kitchen is ready for cooking! You know how bakers check their oven temperature before making a soufflé? That's exactly what we're doing with our AI setup!

Teaching AI to Spot Harmful Content: A Journey into Unsupervised Learning

Teaching AI to Spot Harmful Content: A Journey into Unsupervised Learning

Devon Artis
·
November 1, 2024
Read full story

Why Do We Need to Verify? 🤔

You might be thinking, "Come on, I installed everything, isn't that enough?" Well, let me tell you a funny story. The first time I set up my environment, everything seemed fine until I actually started training. Two hours in, I realized my GPU wasn't even being used! 😅 That's why we're going to check everything first.

Meet verify.py: Your AI Kitchen Inspector 🔍

Let's look at our verification script:

python

"""
Verify that all required packages are properly installed and configured
"""
import sys
import tensorflow as tf
import cv2
import numpy as np
import pandas as pd
from tqdm import tqdm

def verify_setup():
    """
    Verify that all required packages are properly installed and configured
    """
    print("Python version:", sys.version)
    print("\nTensorFlow version:", tf.__version__)
    print("TensorFlow Metal device:", 
tf.config.list_physical_devices('GPU'))

Think of this like your pre-flight checklist - we're checking every single thing that could affect our AI's performance!

Let's Run Some Tests! ✈️

First up, let's check our versions. It's like making sure all your ingredients aren't expired:

Digital Alchemy Lab is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

Now for the exciting part - testing our GPU:


print("\nTesting Metal acceleration...")
    with tf.device('/GPU:0'):
        a = tf.random.normal([1000, 1000])
        b = tf.random.normal([1000, 1000])
        c = tf.matmul(a, b)
        print("Matrix multiplication test successful")

This is like turning on all your burners to make sure they're working. If this runs quickly, your GPU is ready to rock! 🎸

Common "Uh-Oh" Moments and How to Fix Them 🔧

  1. "GPU not found" Message

print("TensorFlow Metal device:", tf.config.list_physical_devices('GPU'))
# If this shows [], we've got a problem!
  1. Quick Fix: Make sure you've installed tensorflow-metal and set DEVICE='metal'

  2. Slow Matrix Multiplication If our test takes more than a few seconds, something's not right with our GPU setup. Usually this means Metal isn't properly configured.

  3. Import Errors These are like finding out you forgot to buy a key ingredient - annoying but easily fixed!

Let's Check Memory Too! 💾

Here's a neat addition I like to make to verify.py:

print("\nChecking available memory...")
try:
    # Test with a reasonably sized matrix
    test_matrix = tf.random.normal([5000, 5000])
    print("Memory test passed!")
except:
    print("Warning: Memory constraints detected")

Your Turn: The Verification Challenge! 🎯

Try this out:

  1. Run verify.py

  2. Look at each output carefully

  3. Try changing the matrix size in the GPU test

  4. Watch your Activity Monitor while running tests

Pro Tip: Keep verify.py handy - I run it before starting any major training session. It's saved me hours of debugging!

Download Verify.py code

Quick Health Check! 🏥

Before you go, make sure:

  • Your GPU shows up in device list

  • Matrix multiplication is fast

  • All imports work

  • Memory test passes

The Ethics Corner 🎯

Even in verification,

  • Memory test passes

The Ethics Corner 🎯

Even in verification, we think about bias:

  • Are we assuming everyone has the same computing power?

  • How can we make our code more accessible?

  • What about users with different hardware?

What's Next? 🚀

Now that we know our kitchen is ready, next time we'll start cooking - I mean, training our model! Make sure everything passes these checks before then!

Share Your Experience! 💭

Drop a comment with:

  • Your verification results

  • Any weird errors you hit

  • Tips for others setting up

  • Questions about anything unclear

Remember, we're all learning together! No such thing as a silly question in this kitchen! 🧑‍🍳

#BuildInPublic #MachineLearning #AppleSilicon #AIverification

P.S. If verify.py shows any errors, don't panic! Drop a comment with the error message, and let's debug together! 🛠️

AI Chronicles

From Training to Action: Making Our AI Work in the Real World

Devon Artis
·
December 5, 2024
From Training to Action: Making Our AI Work in the Real World

Hey there, fellow Alchemists ! 👋

Read full story

AI Chronicles

Let's Try to Trick Our AI (and Learn From It)! Building in Public:

Devon Artis
·
December 17, 2024
Let's Try to Trick Our AI (and Learn From It)! Building in Public:

Hey there, AI explorers! 👋

Read full story

4

Share this post

Digital Alchemy Lab
Digital Alchemy Lab
Making Sure Everything's Ready: Your AI Setup Checklist
1
Share

No posts

© 2025 Devon Artis
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share