1
00:00:00,200 --> 00:00:07,600
The other big topic is Google Colab, and that is the other thing that we're going to be using today
另一个重要主题是 Google Colab，这也是我们今天要使用的另一个东西

2
00:00:07,640 --> 00:00:10,200
as we we it's all about new stuff today.
对于我们来说，今天的一切都是关于新事物的。

3
00:00:10,200 --> 00:00:13,880
So Google Colab, you may have already used it.
那么Google Colab，你可能已经用过它了。

4
00:00:13,880 --> 00:00:16,800
A lot of people have used it already and they're like, why don't we start with Google Colab?
很多人已经使用过它，他们会想，为什么我们不从 Google Colab 开始呢？

5
00:00:16,800 --> 00:00:19,720
There's a lot of a lot to love about Google Colab.
Google Colab 有很多值得喜爱的地方。

6
00:00:19,720 --> 00:00:21,120
First of all, what is it?
首先，它是什么？

7
00:00:21,120 --> 00:00:25,560
So it is something which allows you to to run a notebook.
所以它可以让你运行笔记本。

8
00:00:25,560 --> 00:00:29,960
Notebook is this kind of interface we've been playing with in cursor when you have like, like cells
当你有类似的单元格时，笔记本就是我们在光标中使用的这种界面

9
00:00:29,960 --> 00:00:35,240
of code that you run a cell at a time, there's very experimental way of interacting with code.
一次运行一个单元的代码，有一种非常实验性的与代码交互的方式。

10
00:00:35,240 --> 00:00:42,160
So Google has built something that lets you run a notebook like that, except you're running it in a
因此，谷歌已经构建了一些东西，可以让你运行这样的笔记本，只不过你是在一个

11
00:00:42,160 --> 00:00:48,400
browser, you're running it in a browser window, and it's actually running on one of Google's computers.
浏览器，您在浏览器窗口中运行它，它实际上在 Google 的一台计算机上运行。

12
00:00:48,560 --> 00:00:54,920
So you can like bring up a like a Chrome page, point it at a Google URL, and then you effectively
因此，您可以打开类似 Chrome 的页面，将其指向 Google URL，然后您就可以有效地

13
00:00:54,920 --> 00:01:01,080
have like like a boxes there, and you're remoting in to a Google box and you're able to run the code.
那里有一个盒子，您可以远程连接到 Google 盒子，并且可以运行代码。

14
00:01:01,080 --> 00:01:05,080
And when you run the cell, it's as if it's running in your browser, but of course it's not.
当您运行该单元时，就好像它在浏览器中运行一样，但当然不是。

15
00:01:05,120 --> 00:01:10,120
The code is executing on one of Google's machines out there in the cloud, and you're seeing the results
该代码正在云端的 Google 机器上执行，您将看到结果

16
00:01:10,120 --> 00:01:10,880
immediately.
立即地。

17
00:01:10,960 --> 00:01:16,760
So it lets you remote in to a to a remote box running on Google's cloud.
因此，它可以让您远程访问在 Google 云上运行的远程设备。

18
00:01:16,960 --> 00:01:19,640
And there are a few things about this that are really great.
这其中有一些非常棒的事情。

19
00:01:20,000 --> 00:01:26,600
One of them is that it allows you to collaborate in this super seamless way with other people on the
其中之一是，它允许您以这种超级无缝的方式与网络上的其他人进行协作

20
00:01:26,600 --> 00:01:27,840
same code.
相同的代码。

21
00:01:27,880 --> 00:01:30,160
Like in the same notebook construct.
就像在同一个笔记本结构中一样。

22
00:01:30,800 --> 00:01:36,720
Google is famous, of course, for Google Docs for really bringing the kind of collaborative office
当然，Google 因 Google Docs 真正带来了协作办公而闻名

23
00:01:36,720 --> 00:01:39,400
idea, uh, to, to the mainstream.
想法，呃，到，到主流。

24
00:01:39,520 --> 00:01:44,600
And so everyone's very familiar with this idea that you can share a Google doc and share a sheet and
所以每个人都非常熟悉这个想法，你可以共享 Google 文档并共享表格，

25
00:01:44,600 --> 00:01:49,160
be able to to work together with someone else in it and really collaborate.
能够与其他人一起工作并真正协作。

26
00:01:49,160 --> 00:01:56,280
And Google Colab is bringing that same mentality to a notebook so that you can be coding with somebody
Google Colab 正在将同样的心态带入笔记本中，以便您可以与某人一起编码

27
00:01:56,280 --> 00:01:56,720
else.
别的。

28
00:01:56,760 --> 00:02:00,920
It's not quite you don't quite get to see the changes in quite the same way, but it's almost as good
并不是说你不能以完全相同的方式看到这些变化，但它几乎一样好

29
00:02:00,920 --> 00:02:01,520
as that.
那样。

30
00:02:01,520 --> 00:02:04,040
And you can both be adding code and running things.
您既可以添加代码又可以运行东西。

31
00:02:04,080 --> 00:02:10,880
And so it's such a great way to work together with people and, you know, it's like a it's a different
所以这是一种与人合作的好方法，你知道，这就像一种不同的方式

32
00:02:10,880 --> 00:02:16,160
mindset to something like a using a repo where you where you check stuff in and merge it and so on.
心态类似于使用存储库，您可以在其中签入内容并合并它等等。

33
00:02:16,160 --> 00:02:23,240
It's much more like live working, but it suits the notebook mindset, that experimental mindset, it
它更像是现场工作，但它适合笔记本思维、实验思维，它

34
00:02:23,240 --> 00:02:24,480
works so well with that.
效果很好。

35
00:02:24,480 --> 00:02:27,760
So very collaborative as as the name suggests.
正如其名称所暗示的那样，非常具有协作性。

36
00:02:28,000 --> 00:02:31,320
Uh, and it's also integrated with, with the other Google services.
呃，它还与其他谷歌服务集成。

37
00:02:31,320 --> 00:02:36,480
So, so later this this week we're going to to pull Google Drive in so you can have your Google Drive
因此，本周晚些时候我们将引入 Google 云端硬盘，以便您可以拥有自己的 Google 云端硬盘

38
00:02:36,520 --> 00:02:39,960
docs available there too, which is very convenient.
那里也有文档，非常方便。

39
00:02:39,960 --> 00:02:43,000
So for many reasons it is convenient.
因此，出于多种原因，它很方便。

40
00:02:43,360 --> 00:02:46,600
But above all else the real the.
但最重要的是真实的。

41
00:02:46,640 --> 00:02:47,960
So what is that?
那么那是什么？

42
00:02:47,960 --> 00:02:52,080
It gives you access to high end GPUs.
它使您可以访问高端 GPU。

43
00:02:52,360 --> 00:02:54,000
That's that's the big deal.
这才是最重要的。

44
00:02:54,000 --> 00:02:59,120
And I probably need to mention, just in case you don't, uh, you haven't got the connection between
我可能需要提一下，以防万一你不这样做，呃，你没有得到两者之间的联系

45
00:02:59,120 --> 00:03:00,720
what we're doing and GPUs.
我们正在做什么和 GPU。

46
00:03:00,760 --> 00:03:08,800
I mean, obviously everyone knows about Nvidia stock and that GPUs are at the heart of, of modern AI.
我的意思是，显然每个人都知道 Nvidia 股票，并且 GPU 是现代人工智能的核心。

47
00:03:08,840 --> 00:03:15,200
But but if you're wondering why, when we talk about these models with these huge number of parameters,
但是，如果你想知道为什么，当我们谈论这些具有大量参数的模型时，

48
00:03:15,240 --> 00:03:21,120
these tons and tons, these 8 billion numbers, when you when you're predicting the most likely next
当你预测下一个最有可能的情况时，这吨又吨，这 80 亿个数字

49
00:03:21,120 --> 00:03:27,440
token, the way you do that is by taking all of these numbers and multiplying them repeatedly by the
令牌，你这样做的方法是获取所有这些数字并将它们反复乘以

50
00:03:27,480 --> 00:03:34,080
sort of input sets of tokens in some very clever way, which is known as the transformer architecture,
以某种非常聪明的方式对输入的标记集进行排序，这被称为变压器架构，

51
00:03:34,080 --> 00:03:38,640
which is the way that these things will hook together and you're doing lots of multiplications and adding
这就是这些东西连接在一起的方式，你要做很多乘法和加法

52
00:03:38,880 --> 00:03:43,520
multiplications and adding is basically matrix math, linear algebra.
乘法和加法基本上是矩阵数学，线性代数。

53
00:03:43,680 --> 00:03:49,280
It's lots and lots of matrix calculations, and they can all happen very efficiently in parallel with
这是大量的矩阵计算，并且它们都可以非常有效地并行发生

54
00:03:49,280 --> 00:03:50,000
one another.
彼此。

55
00:03:50,040 --> 00:03:51,280
They're all sort of independent.
他们都是独立的。

56
00:03:51,280 --> 00:03:54,360
So they can all run together in this very, very efficient way.
所以他们可以以这种非常非常有效的方式一起运行。

57
00:03:54,360 --> 00:03:55,960
But they all have to run.
但他们都必须跑。

58
00:03:56,080 --> 00:04:01,240
And it turns out when, when all this is becoming a big thing, in the early 2000, people were saying
事实证明，当这一切变得一件大事时，在 2000 年初，人们说

59
00:04:01,240 --> 00:04:07,560
what we really need is like specialized custom hardware that is that is efficient, that is designed
我们真正需要的是专门的定制硬件，它是高效的，是经过设计的

60
00:04:07,560 --> 00:04:12,440
for matrix calculations in in fast, real time.
用于快速、实时的矩阵计算。

61
00:04:12,440 --> 00:04:16,080
And you can imagine all of these scientists sitting around there thinking about this.
你可以想象所有这些科学家坐在那儿思考这个问题。

62
00:04:16,120 --> 00:04:21,720
And while they were doing it, the other people in the room were busy playing Doom or Quake or whatever
当他们这样做时，房间里的其他人正忙着玩《毁灭战士》或《雷神之锤》或其他游戏

63
00:04:21,760 --> 00:04:28,680
was big in those days and, uh, using using PCs with which were like hammering away at drawing this
那时候很流行，呃，使用电脑就像是在不停地画这个

64
00:04:28,680 --> 00:04:29,720
3D graphics.
3D 图形。

65
00:04:29,880 --> 00:04:37,560
And the way that you do these kinds of games is by doing a lot of quick polygon calculations, which
玩这类游戏的方法是进行大量的快速多边形计算，这

66
00:04:37,600 --> 00:04:40,920
involves lots of efficient matrix maths.
涉及大量有效的矩阵数学。

67
00:04:41,080 --> 00:04:45,120
So the graphics cards, everyone was trying to buy a PC with a bigger graphics card.
因此，显卡方面，每个人都试图购买具有更大显卡的电脑。

68
00:04:45,160 --> 00:04:51,920
Those graphics cards were basically custom hardware designed to run matrix calculations, multiplies
这些显卡基本上是定制硬件，设计用于运行矩阵计算、乘法

69
00:04:51,920 --> 00:04:59,040
and adds in parallel like huge numbers of them at the same time so that it could draw, uh, screens
并同时添加大量的数据，这样它就可以绘制，呃，屏幕

70
00:04:59,040 --> 00:05:00,680
like 60 times a second or whatever.
比如每秒 60 次或其他什么。

71
00:05:00,880 --> 00:05:08,280
Uh, and so it turned out that this kind of hardware was absolutely perfect for the kinds of AI that
呃，事实证明，这种硬件对于人工智能来说绝对是完美的。

72
00:05:08,280 --> 00:05:11,000
we were doing at the time and that we are still doing to this day.
我们当时就在这样做，而且直到今天我们仍然在这样做。

73
00:05:11,200 --> 00:05:13,570
Uh, and luckily for Nvidia.
呃，Nvidia 很幸运。

74
00:05:13,810 --> 00:05:16,930
And so that is why GPUs you probably do all that already.
这就是为什么 GPU 可能已经完成了这一切。

75
00:05:16,970 --> 00:05:17,730
So I'm sorry.
所以我很抱歉。

76
00:05:17,970 --> 00:05:22,610
That's why GPUs are so essential to to modern day AI.
这就是为什么 GPU 对于现代人工智能如此重要。

77
00:05:23,010 --> 00:05:24,570
And they're quite expensive.
而且它们相当昂贵。

78
00:05:24,570 --> 00:05:29,930
And what you really need more than anything is you need them to have a lot of memory, which typically
你真正需要的最重要的是你需要它们有大量的内存，这通常

79
00:05:29,970 --> 00:05:32,650
you need, like it's different to the memory of your computer.
您需要的，就像它与您计算机的内存不同一样。

80
00:05:32,690 --> 00:05:39,850
The GPU also has Ram, as games players all know, and you need to have enough to fit all of the model
GPU 也有 RAM，游戏玩家都知道，你需要有足够的内存来适应所有模型

81
00:05:39,890 --> 00:05:40,090
on.
在。

82
00:05:40,090 --> 00:05:42,450
And if you're training, you need a lot more than that too.
如果你正在训练，你需要的还远不止这些。

83
00:05:42,690 --> 00:05:47,170
And so you need a lot of memory on your GPU for it to be able to run efficiently.
因此，GPU 上需要大量内存才能高效运行。

84
00:05:47,170 --> 00:05:48,250
And that's a problem.
这是一个问题。

85
00:05:48,250 --> 00:05:52,250
And as, uh, that's not a problem, that's expensive and is the constraint.
因为，呃，这不是问题，这很昂贵，而且是限制。

86
00:05:52,410 --> 00:05:53,970
And Apple people will know.
苹果公司的人都会知道。

87
00:05:53,970 --> 00:05:59,490
Well, like I might happen to be a mac person, uh, that, uh, one of the great things about Apple
好吧，就像我碰巧是一个 mac 用户一样，呃，呃，Apple 的伟大之处之一

88
00:05:59,490 --> 00:06:05,770
Silicon is that you have what's called a unified memory, which means that the memory that your CPU
Silicon就是你有所谓的统一内存，这意味着你的CPU的内存

89
00:06:05,810 --> 00:06:08,530
uses is the same as the memory the GPU uses.
使用的内存与 GPU 使用的内存相同。

90
00:06:08,530 --> 00:06:11,170
So you can you can share it together, which is really amazing.
所以你们可以一起分享，这真是太棒了。

91
00:06:11,170 --> 00:06:14,650
But for PCs, you typically have to get a graphics card with big enough memory.
但对于 PC，您通常必须拥有足够大内存的显卡。

92
00:06:14,650 --> 00:06:16,090
And they're expensive.
而且它们很贵。

93
00:06:16,130 --> 00:06:22,570
They are many thousands of dollars and boxes which have big Nvidia chips on on them.
它们价值数千美元，盒子上装有大型 Nvidia 芯片。

94
00:06:22,570 --> 00:06:24,530
Graphics cards are very expensive.
显卡非常昂贵。

95
00:06:24,570 --> 00:06:28,370
You can buy good ones for like $6,000 or something.
你可以花 6,000 美元左右买到好的。

96
00:06:28,410 --> 00:06:31,850
They're expensive, but there's an alternative.
它们很贵，但还有其他选择。

97
00:06:31,890 --> 00:06:37,850
There is an alternative and it's called Google Colab, where you rent GPUs in the cloud instead.
还有一种替代方案，称为 Google Colab，您可以在云中租用 GPU。

98
00:06:37,850 --> 00:06:43,010
And so here are the details you get when you connect to Colab.
以下是连接到 Colab 时获得的详细信息。

99
00:06:43,010 --> 00:06:50,370
You choose a runtime and runtime is it's name of like the, the, uh, like the instance that you're
您选择一个运行时，运行时的名称就像您所在的实例一样

100
00:06:50,370 --> 00:06:51,690
connecting to on the cloud.
连接到云端。

101
00:06:51,690 --> 00:06:57,610
And it includes like a kernel, like we're used to a Python process that's, that's running there.
它包括一个内核，就像我们习惯的Python进程一样，它在那里运行。

102
00:06:57,770 --> 00:07:03,130
And you can get some that are CPU based, meaning that there's no graphics card at all, there's no
你可以得到一些基于CPU的，这意味着根本没有显卡，没有

103
00:07:03,130 --> 00:07:08,050
GPU, so you can just use it for everyday tasks, a bit like you can on your own computer.
GPU，因此您可以将其用于日常任务，就像在自己的计算机上一样。

104
00:07:08,290 --> 00:07:11,810
You can have ones with a lower spec GPU.
您可以使用较低规格的 GPU。

105
00:07:11,930 --> 00:07:13,170
It's still pretty mighty.
威力还是蛮大的

106
00:07:13,210 --> 00:07:14,970
It's still a powerful GPU.
它仍然是一个强大的 GPU。

107
00:07:15,250 --> 00:07:19,210
The typical one is the Nvidia Tesla T4.
典型的是 Nvidia Tesla T4。

108
00:07:19,370 --> 00:07:21,730
The T4 is the typical one.
T4是典型的一款。

109
00:07:21,730 --> 00:07:26,250
It has 15GB of GPU Ram, which is a lot.
它有 15GB 的 GPU RAM，这已经很多了。

110
00:07:26,530 --> 00:07:28,250
And here's the thing.
事情是这样的。

111
00:07:28,490 --> 00:07:29,690
It's free.
它是免费的。

112
00:07:29,930 --> 00:07:31,810
It's it's completely free.
它是完全免费的。

113
00:07:31,930 --> 00:07:38,170
You can have a Google Colab with a T4 GPU, and you can have it for free at any point.
您可以拥有配备 T4 GPU 的 Google Colab，并且可以随时免费获得。

114
00:07:38,170 --> 00:07:40,090
And we're just gonna do it in just a second.
我们只需一秒钟就能完成。

115
00:07:40,090 --> 00:07:40,730
Can you believe it?
你能相信吗？

116
00:07:40,730 --> 00:07:45,650
And that's what you'll be using for this week, for week three and for week seven on this course when
这就是您本周、第三周和第七周在本课程中将使用的内容

117
00:07:45,650 --> 00:07:47,690
we are running on GPUs in the cloud.
我们在云端的 GPU 上运行。

118
00:07:47,690 --> 00:07:48,810
So that's amazing.
所以这太棒了。

119
00:07:49,010 --> 00:08:00,010
And then if you want to splash out you can pay to have a higher spec one, including an A100 for 40GB.
然后，如果你想花大钱，你可以花钱购买更高规格的产品，包括 40GB 的 A100。

120
00:08:00,010 --> 00:08:04,290
But when I say splash out, we're talking about like a few bucks an hour.
但当我说“splash out”时，我们指的是每小时几美元。

121
00:08:04,530 --> 00:08:08,450
We're talking about like, you know, a Big Mac an hour kind of level.
我们谈论的是，你知道，每小时一个巨无霸的水平。

122
00:08:08,570 --> 00:08:12,130
I believe we'll do the maths later to see exactly how much it costs.
我相信我们稍后会计算一下具体要花多少钱。

123
00:08:12,130 --> 00:08:15,650
But, uh, it's it's, uh, I was going to say it's cheap.
但是，呃，就是它，呃，我想说的是它很便宜。

124
00:08:15,650 --> 00:08:16,810
And you might disagree with me there.
你可能不同意我的观点。

125
00:08:16,810 --> 00:08:22,170
You might say a few dollars an hour is not cheap at all, but compare it with the cost of buying an
你可能会说每小时几美元一点也不便宜，但与购买一台电脑的成本相比

126
00:08:22,170 --> 00:08:26,170
A100 on a PC that you're going to have for yourself.
您将拥有自己的 PC 上的 A100。

127
00:08:26,170 --> 00:08:28,370
That that is an expensive proposition.
这是一个昂贵的提议。

128
00:08:28,370 --> 00:08:33,090
And when you think of it in that light, to be able to run it for $2 an hour only when you need it,
当你从这个角度思考时，只有在你需要的时候才能以每小时 2 美元的价格运行它，

129
00:08:33,090 --> 00:08:35,290
and then you don't use it anymore, you don't keep it running.
然后你不再使用它，不再让它运行。

130
00:08:35,290 --> 00:08:38,410
You just you only pay for the minutes that you have it alive.
您只需为您还活着的分钟数付费即可。

131
00:08:38,410 --> 00:08:39,170
That's it.
就是这样。

132
00:08:39,490 --> 00:08:42,410
It seems like it's actually a really great deal.
看起来这确实是一笔很大的交易。

133
00:08:42,410 --> 00:08:48,850
And I feel like we are lucky to have this ability to rent super high powered horsepower whenever we
我觉得我们很幸运，每当我们有能力租用超大马力

134
00:08:48,850 --> 00:08:49,530
want it.
想要它。

135
00:08:49,570 --> 00:08:52,050
And so, yeah, I think this is fabulous.
所以，是的，我认为这太棒了。

136
00:08:52,050 --> 00:08:56,050
And that's why I always when people say to me, I want to buy a box with blah, blah, blah, blah,
这就是为什么我总是当人们对我说，我想买一个盒子，里面装着等等，等等，等等，

137
00:08:56,250 --> 00:09:02,850
I say, really, really, because you know that that you can have as many a100s as you want for a fraction
我说，真的，真的，因为你知道你可以用一小部分的钱拥有任意数量的 a100

138
00:09:02,850 --> 00:09:05,850
of that, uh, just, you know, every weekend.
其中，呃，只是，你知道，每个周末。

139
00:09:06,090 --> 00:09:12,650
So anyways, the, the other the final sales pitch for it and then I'll shut up the, the other point
所以无论如何，另一个最终的销售宣传，然后我会闭嘴，另一个点

140
00:09:12,650 --> 00:09:16,730
to make is that GPUs do go obsolete pretty quickly.
值得一提的是，GPU 确实很快就会过时。

141
00:09:16,730 --> 00:09:20,050
The GPUs that are hot today might not be hot in a year's time.
今天很热门的 GPU 一年后可能就不那么热门了。

142
00:09:20,050 --> 00:09:26,530
And if you buy one, you're kind of stuck with it, but with with Google Colab, you just get the whatever
如果你买了一个，你就会被它困住，但有了 Google Colab，你就可以得到任何东西

143
00:09:26,530 --> 00:09:27,570
they have on offer.
他们有提供。

144
00:09:27,850 --> 00:09:30,290
They have a range of different boxes that you can get.
他们有一系列不同的盒子可供您购买。

145
00:09:30,290 --> 00:09:32,690
And so it's also a nice way to always stay current.
因此，这也是始终保持最新状态的好方法。

146
00:09:32,730 --> 00:09:37,770
I guess it's like leasing a car, you know, it's like it's the buy versus versus lease kind of conundrum
我想这就像租赁一辆车，你知道，这就像购买与租赁之类的难题

147
00:09:37,770 --> 00:09:38,730
that people think about.
人们所思考的。

148
00:09:38,730 --> 00:09:39,410
Anyways.
无论如何。

149
00:09:39,570 --> 00:09:41,050
That is Google Colab.
那就是谷歌Colab。

150
00:09:41,090 --> 00:09:41,330
All right.
好的。

151
00:09:41,330 --> 00:09:45,090
So I just took like ten minutes of your time just talking about this thing.
所以我只花了大约十分钟的时间来谈论这件事。

152
00:09:45,090 --> 00:09:46,330
We need to go and see it.
我们需要去看看。

153
00:09:46,330 --> 00:09:47,450
Let's go and see it.
我们去看看吧。

154
00:09:47,450 --> 00:09:54,010
So look there's people constantly ask me how to find the link to the Google Colab that we use in these
所以看，有人不断问我如何找到我们在这些中使用的 Google Colab 的链接

155
00:09:54,010 --> 00:09:54,490
courses.
课程。

156
00:09:54,490 --> 00:10:02,090
And I've put the links everywhere, but but so one place they are is that if you go into the repo week
我已经把链接放在各处了，但是有一个地方是，如果你进入回购周

157
00:10:02,130 --> 00:10:08,570
three, day one, there is a notebook there in in cursor with a link to the Colab.
第三天，第一天，光标处有一个笔记本，其中有 Colab 的链接。

158
00:10:08,690 --> 00:10:11,850
But also if you look in the readme, there's a link to the Colab.
但如果您查看自述文件，也会发现 Colab 的链接。

159
00:10:11,850 --> 00:10:14,810
If you look in the class resources, there's a link to the Colab.
如果您查看课程资源，就会发现 Colab 的链接。

160
00:10:14,850 --> 00:10:19,610
Like I don't know, you have to just not look anywhere, look up at the ceiling and you won't see it,
我不知道，你必须不看任何地方，抬头看天花板，你就看不到它，

161
00:10:19,610 --> 00:10:23,130
but it's everywhere else, so you got no excuses.
但它无处不在，所以你没有任何借口。

162
00:10:23,130 --> 00:10:26,330
You can find the link to the colab and I will see you right there.
您可以找到 Colab 的链接，我会在那里见到您。
