Build a PyTorch ReLU Kernel with Hugging Face Kernels (CPU + Metal)
In this video, I walk through the Hugging Face Kernels Library and build a real PyTorch ReLU kernel end to end.
You’ll see how to package kernels, publish compiled artifacts, and load the right kernel at runtime based on your environment.
What we cover:
- What the Hugging Face Kernels Library is and why it exists
- Kernel builder workflow (source → build matrix → artifacts)
- CPU + Metal implementation walkthrough
- Torch extension + Python wrapper setup
- Nix-based deterministic builds and caching
- Runtime kernel selection with get_local_kernel
Chapters:
00:00 Intro
00:31 What the Kernels Library does
02:35 Why use it
04:42 Kernel project structure
06:04 Live demo: ReLU kernel (CPU + Metal)
08:02 Torch extension and Python wrapper
09:36 Build process with Nix + cache
10:49 Build outputs and artifact matrix
12:00 Local usage and runtime selection
13:42 Docs and wrap-up
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from HuggingFace · HuggingFace · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
The Future of Natural Language Processing
HuggingFace
Trends in Model Size & Computational Efficiency in NLP
HuggingFace
Increasing Data Usage in Natural Language Processing
HuggingFace
In Domain & Out of Domain Generalization in the Future of NLP
HuggingFace
The Limits of NLU & the Rise of NLG in the Future of NLP
HuggingFace
The Lack of Robustness in the Future of NLP
HuggingFace
Inductive Bias, Common Sense, Continual Learning in The Future of NLP
HuggingFace
Train a Hugging Face Transformers Model with Amazon SageMaker
HuggingFace
What is Transfer Learning?
HuggingFace
The pipeline function
HuggingFace
Navigating the Model Hub
HuggingFace
Transformer models: Decoders
HuggingFace
The Transformer architecture
HuggingFace
Transformer models: Encoder-Decoders
HuggingFace
Transformer models: Encoders
HuggingFace
Keras introduction
HuggingFace
The push to hub API
HuggingFace
Fine-tuning with TensorFlow
HuggingFace
Learning rate scheduling with TensorFlow
HuggingFace
TensorFlow Predictions and metrics
HuggingFace
Welcome to the Hugging Face course
HuggingFace
The tokenization pipeline
HuggingFace
Supercharge your PyTorch training loop with Accelerate
HuggingFace
The Trainer API
HuggingFace
Batching inputs together (PyTorch)
HuggingFace
Batching inputs together (TensorFlow)
HuggingFace
Hugging Face Datasets overview (Pytorch)
HuggingFace
Hugging Face Datasets overview (Tensorflow)
HuggingFace
What is dynamic padding?
HuggingFace
What happens inside the pipeline function? (PyTorch)
HuggingFace
What happens inside the pipeline function? (TensorFlow)
HuggingFace
Instantiate a Transformers model (PyTorch)
HuggingFace
Instantiate a Transformers model (TensorFlow)
HuggingFace
Preprocessing sentence pairs (PyTorch)
HuggingFace
Preprocessing sentence pairs (TensorFlow)
HuggingFace
Write your training loop in PyTorch
HuggingFace
Managing a repo on the Model Hub
HuggingFace
Chapter 1 Live Session with Sylvain
HuggingFace
Chapter 2 Live Session with Lewis
HuggingFace
The push to hub API
HuggingFace
Chapter 2 Live Session with Sylvain
HuggingFace
Chapter 3 live sessions with Lewis (PyTorch)
HuggingFace
Day 1 Talks: JAX, Flax & Transformers 🤗
HuggingFace
Day 2 Talks: JAX, Flax & Transformers 🤗
HuggingFace
Day 3 Talks JAX, Flax, Transformers 🤗
HuggingFace
Chapter 4 live sessions with Omar
HuggingFace
Deploy a Hugging Face Transformers Model from S3 to Amazon SageMaker
HuggingFace
Deploy a Hugging Face Transformers Model from the Model Hub to Amazon SageMaker
HuggingFace
Run a Batch Transform Job using Hugging Face Transformers and Amazon SageMaker
HuggingFace
[Webinar] How to add machine learning capabilities with just a few lines of code
HuggingFace
Hugging Face + Zapier Demo Video
HuggingFace
Hugging Face + Google Sheets Demo
HuggingFace
Hugging Face Infinity Launch - 09/28
HuggingFace
Build and Deploy a Machine Learning App in 2 Minutes
HuggingFace
Hugging Face Infinity - GPU Walkthrough
HuggingFace
Otto - 🤗 Infinity Case Study
HuggingFace
Workshop: Getting started with Amazon Sagemaker Train a Hugging Face Transformers and deploy it
HuggingFace
Workshop: Going Production: Deploying, Scaling & Monitoring Hugging Face Transformer models
HuggingFace
🤗 Tasks: Causal Language Modeling
HuggingFace
🤗 Tasks: Masked Language Modeling
HuggingFace
More on: AI Workflow Automation
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
AI Video Editing Tools Are Changing Content Creation in 2026
Medium · AI
"I Got Tired of Rewriting 4 AI CLI Config Files. So I Put Setup Behind One Button"
Dev.to · CodeKing
PBIFORGE: The First AI Tool to Generate Full Power BI Dashboards from a Text Prompt
Dev.to · suddhasheel bhatt
I made an extension that notifies you when Codex / Gemini / Claude finishes — got tired of tabbing back every 2 minutes to check
Dev.to · Rakshit Hooda
Chapters (10)
Intro
0:31
What the Kernels Library does
2:35
Why use it
4:42
Kernel project structure
6:04
Live demo: ReLU kernel (CPU + Metal)
8:02
Torch extension and Python wrapper
9:36
Build process with Nix + cache
10:49
Build outputs and artifact matrix
12:00
Local usage and runtime selection
13:42
Docs and wrap-up
🎓
Tutor Explanation
DeepCamp AI