1
00:00:02,120 --> 00:00:07,720
Yeah, all this OBS stuff broke 
on me two weeks ago and then I 

2
00:00:07,720 --> 00:00:10,360
just got hammered and was sick 
and I haven't been able to 

3
00:00:10,360 --> 00:00:12,640
figure it out. 
But for whatever reason, 

4
00:00:12,640 --> 00:00:17,000
whenever anyone that's listening
early on right now, if you know 

5
00:00:17,000 --> 00:00:23,240
why switching OBS scenes with 
video sources is causing lag on 

6
00:00:23,400 --> 00:00:26,880
video streaming, let me know 
because it's really annoying. 

7
00:00:27,880 --> 00:00:31,440
But yeah, so that's what's going
on there. 

8
00:00:32,360 --> 00:00:37,920
Yeah, I I have an audio set up 
here that's pretty brittle. 

9
00:00:38,520 --> 00:00:41,880
Maybe brittle was the correct 
word, because I, I share the 

10
00:00:41,880 --> 00:00:46,520
same keyboard, mouse, monitor, 
and external sound card between 

11
00:00:47,000 --> 00:00:49,840
the the work laptop and my 
desktop. 

12
00:00:51,360 --> 00:00:56,840
And I have two KTM switches for 
that because I already had one 

13
00:00:56,840 --> 00:01:00,560
that that could handle the mouse
and keyboard, but it doesn't 

14
00:01:00,800 --> 00:01:03,160
handle the sound card pretty 
well. 

15
00:01:03,640 --> 00:01:07,160
And I got a cheaper one just for
the the USB switching. 

16
00:01:08,880 --> 00:01:16,280
And sometimes I just boot into 
Windows, let's say for whatever 

17
00:01:16,280 --> 00:01:19,680
reason, and it just doesn't 
recognize the sound card. 

18
00:01:19,680 --> 00:01:26,240
Yeah, that's at all. 
Yeah, sometimes I'm tempted. 

19
00:01:26,240 --> 00:01:31,200
I just want maybe just a Linux 
box for doing streams and then I

20
00:01:31,200 --> 00:01:33,560
don't have to worry. 
I mean, maybe I would have to 

21
00:01:33,560 --> 00:01:36,840
worry about. 
Other things but audio drivers 

22
00:01:36,840 --> 00:01:39,480
in Linux is. 
More difficult, right? 

23
00:01:39,480 --> 00:01:41,960
Yeah. 
It is a problem of it, yeah. 

24
00:01:43,120 --> 00:01:45,800
Yeah, that makes sense. 
Hey, what's up, Saul? 

25
00:01:46,320 --> 00:01:49,080
All right, I'm going to go ahead
and kick this off. 

26
00:01:50,000 --> 00:01:52,640
What's up guys? 
I'm Jacob Blitzo, your Elixir 

27
00:01:52,640 --> 00:01:55,480
mentor, and welcome to another 
exciting episode of the Elixir 

28
00:01:55,480 --> 00:01:57,560
Mentor Podcast. 
This is where we discuss 

29
00:01:57,680 --> 00:02:00,280
everything related to Elixir, 
from interviews with 

30
00:02:00,280 --> 00:02:03,600
enthusiasts, pioneers in the 
community to innovative projects

31
00:02:03,600 --> 00:02:05,560
and library shaping. 
Elixir's future. 

32
00:02:05,800 --> 00:02:10,360
Today I'm thrilled to welcome 
Paulo Valente, an R&D software 

33
00:02:10,360 --> 00:02:14,960
engineer and maintainer of NX, 
the numerical Elixir ecosystem. 

34
00:02:15,560 --> 00:02:18,800
Welcome to the show, Paulo. 
It's awesome to have you here. 

35
00:02:18,800 --> 00:02:21,800
Do you want to go ahead and just
kind of give a brief 

36
00:02:21,800 --> 00:02:25,440
introduction of yourself? 
Yeah, thanks for having me. 

37
00:02:26,320 --> 00:02:30,040
You gave already most of the 
introduction that I or I 

38
00:02:30,040 --> 00:02:34,160
normally give. 
I want to highlight that I work 

39
00:02:34,200 --> 00:02:39,600
at Dockyard and most of the NX 
work that I do is at dock on 

40
00:02:39,600 --> 00:02:42,840
Dockyard time. 
So it's pretty important for us 

41
00:02:42,840 --> 00:02:44,920
to recognize that. 
Yeah, that's amazing. 

42
00:02:44,920 --> 00:02:49,760
Dockyard is does amazing stuff 
for the Elixir community. 

43
00:02:51,360 --> 00:02:57,640
Yeah, and as you can see around 
me, I'm also a musician by hobby

44
00:02:57,640 --> 00:03:02,840
mostly. 
And actually, yeah, I got into 

45
00:03:02,960 --> 00:03:05,920
programming in DSP, signal 
processing and then machine 

46
00:03:05,920 --> 00:03:10,000
learning because of music. 
So that's a nice curiosity. 

47
00:03:11,440 --> 00:03:13,800
Yeah, yeah, yeah. 
And I work with an X. 

48
00:03:14,320 --> 00:03:21,440
Yeah, very cool. 
What what kind of started you to

49
00:03:21,480 --> 00:03:23,280
get into the like the elixir 
world? 

50
00:03:23,880 --> 00:03:29,080
What pulled you in? 
It was mostly just coincidence, 

51
00:03:29,120 --> 00:03:36,200
because in early 28, late 2017, 
early 2018, I was looking for an

52
00:03:36,200 --> 00:03:41,120
internship because I needed a 
military internship for 

53
00:03:41,760 --> 00:03:48,400
graduating college. 
And a friend of mine that he's 

54
00:03:48,400 --> 00:03:51,240
still around in the Elixir 
space, but not quite as much. 

55
00:03:51,240 --> 00:03:57,640
Bernardo Omrin. 
He was working at Stone, a 

56
00:03:57,640 --> 00:04:03,200
fintech in Brazil and he 
basically when I was going to 

57
00:04:03,200 --> 00:04:07,480
start looking for an internship,
he asked me if I wanted wanted 

58
00:04:07,480 --> 00:04:12,680
to go work there. 
So things lined up nicely, but I

59
00:04:12,880 --> 00:04:15,640
my coding challenge was in 
Python. 

60
00:04:16,600 --> 00:04:22,240
And then one month or two after 
I joined we started moving 

61
00:04:22,240 --> 00:04:30,120
towards Elixir and Long story 
short, we build a an online bank

62
00:04:30,120 --> 00:04:33,000
from scratch using Elixir. 
Wow. 

63
00:04:34,360 --> 00:04:40,640
And I worked there for almost 
five years, 4 1/2. 

64
00:04:41,080 --> 00:04:45,600
OK, nice. 
And then what brought you 

65
00:04:46,080 --> 00:04:50,760
towards the like the creation of
Annex and that project? 

66
00:04:53,000 --> 00:04:57,720
Well, as I mentioned, one of the
main reasons for me to having 

67
00:04:58,560 --> 00:05:03,960
for me to become an electronics 
engineer was so that I could 

68
00:05:03,960 --> 00:05:07,520
work with music, even if on the 
side. 

69
00:05:08,200 --> 00:05:13,840
So besides me, I have a guitar 
amplifier that I modded like two

70
00:05:13,840 --> 00:05:17,880
months ago and it's my main 
driver right now. 

71
00:05:20,760 --> 00:05:24,400
So always like looking for 
applications of engineering 

72
00:05:24,400 --> 00:05:28,160
towards music. 
And during college that meant 

73
00:05:28,600 --> 00:05:32,080
doing a research internship in 
audio processing. 

74
00:05:33,760 --> 00:05:39,000
And that's in that space that I 
learned most of the linear 

75
00:05:39,000 --> 00:05:42,760
algebra that I know. 
And also I started learning 

76
00:05:43,040 --> 00:05:45,680
machine learning. 
Yeah. 

77
00:05:47,480 --> 00:05:53,120
And then I ended up not doing my
project in that space, my my 

78
00:05:53,120 --> 00:05:58,000
graduation project in that 
space, mostly because I wanted 

79
00:05:58,000 --> 00:06:04,320
to do it in Elixir and focus 
more on the functional 

80
00:06:04,320 --> 00:06:09,280
programming and distributed 
system side of it, because 

81
00:06:09,320 --> 00:06:12,560
that's what I was working with 
at the time. 

82
00:06:13,120 --> 00:06:21,440
This is like mid 2019. 
So I ended up doing a project 

83
00:06:21,440 --> 00:06:26,360
that that's related to machine 
functional programming systems 

84
00:06:26,360 --> 00:06:32,000
for managing machine learning 
subsystems, which meant that the

85
00:06:32,000 --> 00:06:37,160
MVP was Elixir calling into 
Python via GRPC. 

86
00:06:38,360 --> 00:06:46,320
And then with that bridge, we 
could consume data images from 

87
00:06:46,880 --> 00:06:53,320
different video streams, batch 
them, and then send them to the 

88
00:06:53,560 --> 00:06:57,320
classifier that was in Python 
And then get the results back 

89
00:06:57,320 --> 00:07:02,520
and unbatch the results. 
And if this sounds familiar is 

90
00:07:02,600 --> 00:07:04,840
it's because it's basically an X
serving. 

91
00:07:06,200 --> 00:07:14,960
But yeah, I did that in mid 2019
and there was always this 

92
00:07:14,960 --> 00:07:19,400
internal urge for me to work 
with machine learning or 

93
00:07:19,400 --> 00:07:22,840
something in the space in a 
lecture. 

94
00:07:24,360 --> 00:07:31,200
And then unbeknownst to me, Sean
and Jose started working in on 

95
00:07:31,200 --> 00:07:38,440
Annex in the late 2020 and then 
they they published the library 

96
00:07:38,440 --> 00:07:42,840
in early 2021 and that's when I 
started working in the project, 

97
00:07:42,840 --> 00:07:44,240
OK. 
Very cool. 

98
00:07:44,320 --> 00:07:48,080
That's awesome. 
For people that may not know, 

99
00:07:48,080 --> 00:07:51,880
can you explain like in the 
simplest terms you can, what 

100
00:07:52,080 --> 00:07:56,760
what is NX and how does it help 
Elixir and what does it actually

101
00:07:56,760 --> 00:08:02,200
do for us? 
Hey, first NX stands for 

102
00:08:02,200 --> 00:08:08,160
Numerical Elixir and the reason 
that we need a project like an 

103
00:08:08,160 --> 00:08:15,200
axe is because of how the beam 
works being the the Elixir VM or

104
00:08:15,200 --> 00:08:23,120
or like VM because it's always 
trade-offs, right. 

105
00:08:23,120 --> 00:08:28,240
So because we want a platform 
that's built for concurrent 

106
00:08:28,240 --> 00:08:33,799
programming, the trade off there
is that functions in general 

107
00:08:34,679 --> 00:08:40,200
have to give up control of the 
the system every four 

108
00:08:40,200 --> 00:08:41,919
milliseconds if they aren't 
done. 

109
00:08:43,320 --> 00:08:47,560
This means that computations 
that take longer than that will 

110
00:08:47,560 --> 00:08:50,640
be even slower than what they 
would be. 

111
00:08:52,600 --> 00:08:58,360
And that coupled with some of 
the other data structures that 

112
00:08:58,360 --> 00:09:04,600
we have on the beam makes it so 
that number crunching and 

113
00:09:04,600 --> 00:09:09,440
especially linear algebra type 
of crunching, that that's the 

114
00:09:09,440 --> 00:09:15,960
basis of machine learning and 
AI, those aren't suited for the 

115
00:09:15,960 --> 00:09:20,400
Bing VM. 
And then NX can leverage 

116
00:09:20,760 --> 00:09:26,960
elixirs, metaprogramming, the 
ability to turn code into other 

117
00:09:26,960 --> 00:09:30,560
data structures instead of just 
spinning out the result. 

118
00:09:31,080 --> 00:09:36,240
We can take advantage of that to
then start lowering down the 

119
00:09:36,240 --> 00:09:42,360
code until we can call into CC 
functions for instance. 

120
00:09:43,240 --> 00:09:51,920
So NX is the higher level 
interface for doing number 

121
00:09:51,920 --> 00:09:56,320
crunching in Elixir. 
That's the the short summary. 

122
00:09:57,040 --> 00:10:00,240
OK, very cool. 
And that's like when you'll hear

123
00:10:00,240 --> 00:10:04,240
examples of people like adding 
Rust to their stacks and things.

124
00:10:04,480 --> 00:10:08,720
NX would kind of alleviate you 
having to bring in another 

125
00:10:08,720 --> 00:10:10,920
language, right? 
It's like the high level version

126
00:10:10,920 --> 00:10:14,320
of. 
Well, NX kind of. 

127
00:10:14,800 --> 00:10:16,960
NX kind of already does bring 
that. 

128
00:10:17,920 --> 00:10:24,880
Not NX itself, but NX is built 
with pluggable backends, so for 

129
00:10:24,880 --> 00:10:30,280
people in the Elixir space 
that's like Tesla having a 

130
00:10:30,560 --> 00:10:38,240
Hackney or Finch type of client,
or Acto having adapters for 

131
00:10:38,800 --> 00:10:41,480
other databases. 
Then not just post Chris. 

132
00:10:42,040 --> 00:10:45,920
It's the same interface, but the
implementation and the functions

133
00:10:45,920 --> 00:10:49,240
that are available aren't 
necessarily the same. 

134
00:10:50,680 --> 00:10:54,800
And NX does that. 
And then we have back ends which

135
00:10:55,440 --> 00:10:58,880
provide the the individual 
functions. 

136
00:10:59,440 --> 00:11:04,640
And we can also provide 
compilers which take whole NX 

137
00:11:04,640 --> 00:11:10,080
functions, NX computations and 
lower them down into machine 

138
00:11:10,080 --> 00:11:13,880
code as a unit. 
But those libraries, they do 

139
00:11:13,880 --> 00:11:19,800
have the their native code, the 
ones that that we wrote 

140
00:11:19,840 --> 00:11:25,280
officially they are, they use 
C++, but that's just because 

141
00:11:25,280 --> 00:11:30,720
it's the the common language 
that we know we have Ortex which

142
00:11:30,720 --> 00:11:34,640
is in the the Elixir annex or 
GitHub or organization right 

143
00:11:34,640 --> 00:11:38,200
now. 
And Ortex is written in Rust, 

144
00:11:39,880 --> 00:11:43,080
Explorer is written in Rust as 
well. 

145
00:11:44,760 --> 00:11:50,200
And both of those provide annex 
back ends or at least part of of

146
00:11:50,200 --> 00:11:52,080
back ends as well. 
Gotcha. 

147
00:11:52,200 --> 00:11:57,720
OK, very cool. 
For those that are like are new 

148
00:11:57,760 --> 00:12:01,640
and like me, I don't know much 
about numerical computing or 

149
00:12:01,640 --> 00:12:05,400
anything, but you'll always hear
the term like tensor thrown 

150
00:12:05,400 --> 00:12:09,280
around. 
Can you kind of explain to the 

151
00:12:09,520 --> 00:12:14,160
US what that is like? 
Like is it close to what a list 

152
00:12:14,160 --> 00:12:15,840
is a matricy? 
What? 

153
00:12:15,840 --> 00:12:20,840
What is it? 
I was having the this discussion

154
00:12:20,840 --> 00:12:26,680
with a friend of mine this 
earlier this week because we're 

155
00:12:26,920 --> 00:12:31,480
going through a deep learning 
book, like a book club of sorts.

156
00:12:33,080 --> 00:12:38,160
And the simpler answer is that 
you can think of the answers as 

157
00:12:38,160 --> 00:12:44,800
lists of lists. 
So going from lower dimensions 

158
00:12:44,800 --> 00:12:52,200
to greater dimensions, we have 
scalars, numbers, so 12101 

159
00:12:52,200 --> 00:12:55,360
million, they're all scalars. 
It's just a single number. 

160
00:12:57,240 --> 00:13:03,480
We have vectors which are just a
list of numbers. 

161
00:13:05,960 --> 00:13:10,000
There's a discussion whether a 
vector is just a list of of 

162
00:13:10,000 --> 00:13:12,600
numbers. 
But for this purpose, let's 

163
00:13:12,800 --> 00:13:14,960
let's think of just being a 
list. 

164
00:13:16,000 --> 00:13:22,360
And then a matrix is a list of 
lists and they all need to have 

165
00:13:22,360 --> 00:13:26,240
the same size. 
And then there's the tensor, 

166
00:13:26,240 --> 00:13:29,240
which is the generalization for 
more dimensions. 

167
00:13:31,320 --> 00:13:34,600
So that's one way to think about
tensors. 

168
00:13:35,360 --> 00:13:43,600
And we can, we can maybe do some
analogies here, not analogies, 

169
00:13:43,600 --> 00:13:47,680
but really connecting the these 
abstract concepts with something

170
00:13:47,680 --> 00:13:52,680
that people are familiar with. 
So let's think about a video. 

171
00:13:54,000 --> 00:14:00,560
Each pixel is a scaler. 
And then if you're talking about

172
00:14:00,560 --> 00:14:05,360
RGB video, RGBA with the 
transparency channel as well, 

173
00:14:06,480 --> 00:14:11,440
each channel is a matrix. 
So the red channel is just a 

174
00:14:11,440 --> 00:14:15,560
matrix of pixels. 
The blue channel was the same, 

175
00:14:15,560 --> 00:14:20,800
green and alpha, all the the 
same shape, the same width and 

176
00:14:20,800 --> 00:14:23,440
height, each one of with 
different values. 

177
00:14:23,440 --> 00:14:25,480
But it's just a matrix for each 
channel. 

178
00:14:27,280 --> 00:14:33,000
If we're talking about about a 
JPG image or PNG or GBA images, 

179
00:14:34,480 --> 00:14:40,360
those can be thought of as 3D 
tensors already, because it's a 

180
00:14:40,360 --> 00:14:45,680
list of matrix matrices you have
with height and channels. 

181
00:14:48,200 --> 00:14:53,440
And then when you step into the 
4th dimension, you can think 

182
00:14:53,440 --> 00:14:56,520
about time, for instance, that's
a video. 

183
00:14:58,440 --> 00:15:01,160
It's a list of images over time.
OK. 

184
00:15:03,360 --> 00:15:08,840
So a video can be thought of as 
a 4D dancer. 

185
00:15:09,320 --> 00:15:14,280
In that sense it seems a bit 
disconnected. 

186
00:15:14,280 --> 00:15:19,680
But when you start working with 
the lower level data, 

187
00:15:21,120 --> 00:15:26,600
manipulating images as tensors, 
this becomes a bit more evident.

188
00:15:27,720 --> 00:15:34,800
But I I know that it's a bit a 
bit out there to just say that a

189
00:15:34,800 --> 00:15:41,600
video is a tensor, but really it
can be a little. 

190
00:15:41,960 --> 00:15:43,480
Bit. 
Yeah. 

191
00:15:44,040 --> 00:15:50,560
And then the important thing is 
that when you step into higher 

192
00:15:50,640 --> 00:15:57,600
dimensions, things can be 
interpreted in different ways. 

193
00:15:58,200 --> 00:16:04,920
So you're saying that a vector 
is a list of numbers Is one 

194
00:16:04,920 --> 00:16:10,320
thing, but maybe you just want a
list of numbers. 

195
00:16:10,440 --> 00:16:14,640
It's not like a unit measurement
unit. 

196
00:16:14,640 --> 00:16:17,440
The factor and then a matrix is 
the same. 

197
00:16:17,440 --> 00:16:19,040
It can. 
It can just have a list of 

198
00:16:19,040 --> 00:16:23,560
factors. 
And when you go into higher 

199
00:16:23,560 --> 00:16:27,400
dimensional tensors, the 
interpretation really will 

200
00:16:27,400 --> 00:16:32,520
depend on what the the person is
doing. 

201
00:16:34,320 --> 00:16:39,800
So there's not really much more 
than I can use to define a 

202
00:16:39,800 --> 00:16:44,080
tensor than just a list of 
numbers, a deeply in acid list 

203
00:16:44,080 --> 00:16:47,240
of numbers. 
And from the aspect from like 

204
00:16:47,240 --> 00:16:51,240
just the higher up macro view of
them, what what are they used 

205
00:16:51,240 --> 00:16:53,520
for? 
You're using them to analyze and

206
00:16:53,520 --> 00:16:56,520
compare data types and data, 
right? 

207
00:16:58,120 --> 00:17:02,280
Yeah. 
So if you're doing image field 

208
00:17:02,280 --> 00:17:06,079
training, for instance, you need
to represent the the image in 

209
00:17:06,079 --> 00:17:09,920
some way that you can't hear. 
My dog, he's dreaming behind me.

210
00:17:13,960 --> 00:17:16,920
If you're doing image 
processing, you need to be able 

211
00:17:16,920 --> 00:17:20,280
to represent the image in some 
way that you can manipulate 

212
00:17:20,480 --> 00:17:23,839
mathematically. 
And then if you load the image 

213
00:17:23,839 --> 00:17:30,840
as a tensor then you can use all
of the linear algebra contracts 

214
00:17:31,200 --> 00:17:37,520
that we have out there to 
operate on that data structure. 

215
00:17:38,520 --> 00:17:44,560
It's the same thing as asking I 
need to count frequencies of 

216
00:17:44,800 --> 00:17:49,680
letters in a text. 
What's the best data structure? 

217
00:17:51,280 --> 00:17:53,880
It will depend on the sub 
problem that you want to solve. 

218
00:17:54,520 --> 00:18:01,760
For instance, if you're doing 
arbitrary encodings such as UTF 

219
00:18:01,880 --> 00:18:06,680
8, UTF 16 and you don't want to 
restrict yourself, maybe you 

220
00:18:06,680 --> 00:18:11,640
want to accumulate a map. 
If you're just counting Latin 

221
00:18:11,640 --> 00:18:19,960
letters the 26 of those and not 
do and do it in a case 

222
00:18:19,960 --> 00:18:25,680
insensitive way, then maybe an 
array can be like a. 

223
00:18:25,680 --> 00:18:29,040
An array with 26 entries might 
be enough. 

224
00:18:30,240 --> 00:18:33,200
And then the advantage of the 
array is that you don't keep 

225
00:18:33,200 --> 00:18:38,960
allocating memory over time. 
The map will grow over time and 

226
00:18:38,960 --> 00:18:42,680
that might be a problem. 
And there is no good answer to 

227
00:18:43,040 --> 00:18:45,320
hey, this is the best data 
structure right now. 

228
00:18:46,040 --> 00:18:54,440
But when you're talking about 
getting something as a list or a

229
00:18:54,440 --> 00:18:59,040
collection of numbers and then 
doing mathematical functions on 

230
00:18:59,040 --> 00:19:04,640
that collection, probably some 
type of tensor representation is

231
00:19:04,640 --> 00:19:07,080
going to be the the best way to 
go. 

232
00:19:09,360 --> 00:19:13,200
And what what makes it so much 
better? 

233
00:19:13,200 --> 00:19:17,520
Just because you don't have your
unknown like length of arrays or

234
00:19:17,560 --> 00:19:22,680
a growing map, you is it like a 
confined to rules or what makes 

235
00:19:22,720 --> 00:19:27,080
it? 
It's mostly because if you have 

236
00:19:27,080 --> 00:19:32,520
the the concept of a tensor, you
most likely have the linear 

237
00:19:32,520 --> 00:19:36,680
algebra functions or functions 
that can perform operations on 

238
00:19:36,680 --> 00:19:43,160
tensors defined along with it. 
OK, it generally comes the other

239
00:19:43,160 --> 00:19:44,920
way around. 
Hey, I want to apply these 

240
00:19:44,920 --> 00:19:47,440
functions to tensors. 
OK, let's create a tensor 

241
00:19:47,440 --> 00:19:52,000
representation. 
OK, so you start, you start with

242
00:19:52,000 --> 00:19:55,720
your your algebra and then you 
get your representation in the 

243
00:19:55,720 --> 00:19:57,200
tensor form. 
Yeah. 

244
00:19:57,960 --> 00:20:03,800
Gotcha, that makes sense. 
That's cool when when we're 

245
00:20:03,800 --> 00:20:10,400
talking about like this is 
correct me if I'm just like not 

246
00:20:10,400 --> 00:20:12,680
making sense. 
But there are like 3 main 

247
00:20:12,680 --> 00:20:16,760
capabilities of NX, right? 
You have like tensors with type 

248
00:20:16,760 --> 00:20:19,320
to data. 
And then you have your numerical

249
00:20:19,320 --> 00:20:23,320
definitions and then like 
automatic differentiation, 

250
00:20:23,320 --> 00:20:28,960
right? 
Is that or would you be able to 

251
00:20:29,000 --> 00:20:31,880
kind of walk through those and 
talk about them a little bit 

252
00:20:31,880 --> 00:20:39,360
with us? 
Yeah, we we have the tensor 

253
00:20:39,360 --> 00:20:43,200
representations as we we have 
been discussing and along with 

254
00:20:43,200 --> 00:20:45,040
those the functions. 
That off. 

255
00:20:46,200 --> 00:20:49,360
Yeah. 
And then the numerical 

256
00:20:49,360 --> 00:20:53,960
definitions gets into that meta 
programming aspect that I was 

257
00:20:53,960 --> 00:21:00,280
mentioning it. 
It's just a easier way of 

258
00:21:00,280 --> 00:21:05,280
writing an X functions. 
You don't need defence, but what

259
00:21:05,280 --> 00:21:12,280
you'll need is. 
Imagine I want to get a sequence

260
00:21:12,280 --> 00:21:16,000
of computations, sequence of 
functions to be treated as a 

261
00:21:16,000 --> 00:21:21,000
single unit. 
I can wrap that into a function.

262
00:21:21,760 --> 00:21:26,360
It might be a def fan, but it 
could just be a simple elixir 

263
00:21:26,360 --> 00:21:33,040
function and then I call into 
the inputs with an X functions. 

264
00:21:34,960 --> 00:21:43,920
If I'm just using an X functions
for building the output, then NX

265
00:21:43,920 --> 00:21:47,400
can use one of the back ends 
that we provide which is the NX 

266
00:21:47,400 --> 00:21:54,440
define expression to trace 
through the computation and 

267
00:21:54,440 --> 00:22:01,080
instead of spitting out a number
it it spits out an AST a a 

268
00:22:01,080 --> 00:22:04,360
representation of the 
computation in terms of data. 

269
00:22:05,440 --> 00:22:10,200
So if you have an addition 
operation, you're going to have 

270
00:22:10,400 --> 00:22:13,840
a node that says, hey, this is 
an addition with these 

271
00:22:13,840 --> 00:22:18,240
arguments. 
And that's the power of that 

272
00:22:18,240 --> 00:22:22,240
fan. 
It's being able to restrict the 

273
00:22:22,240 --> 00:22:26,080
subset of Elixir that you can 
use for NX. 

274
00:22:27,080 --> 00:22:33,800
And then the output of a def 
fan, the intermediate output is 

275
00:22:33,800 --> 00:22:38,640
a def fan expression. 
And because it's code 

276
00:22:38,640 --> 00:22:41,400
represented as data, we can do 
stuff with that. 

277
00:22:42,560 --> 00:22:45,760
And one of the things that we 
can do is automatic 

278
00:22:45,760 --> 00:22:50,280
differentiation, but we can do 
other things as well. 

279
00:22:52,840 --> 00:22:59,880
Really anything that requires 
understanding the code as as a 

280
00:22:59,880 --> 00:23:04,040
structure and not just values, 
just the the values that it 

281
00:23:04,040 --> 00:23:09,080
functions without the next FM 
will be able to the definite 

282
00:23:09,080 --> 00:23:12,480
expression will be able to help 
with that. 

283
00:23:12,480 --> 00:23:18,040
And then yeah, after we have the
definite expression, we can then

284
00:23:18,040 --> 00:23:22,520
pass that on to a compiler, 
which gets into what I was 

285
00:23:22,520 --> 00:23:27,200
talking about earlier, where 
there are some back ends that 

286
00:23:27,200 --> 00:23:33,720
are also compilers and they can 
get those functions lowered down

287
00:23:33,720 --> 00:23:40,680
into machine code as a unit. 
But maybe you don't have a 

288
00:23:40,680 --> 00:23:44,040
compiler ready. 
And then you just traverse the 

289
00:23:44,400 --> 00:23:49,440
we have the deaf end evaluator 
which traverses the the deaf end

290
00:23:49,440 --> 00:23:53,160
expression and then calls into 
the specific back end functions 

291
00:23:54,640 --> 00:24:00,280
underneath. 
I think I I think I get it. 

292
00:24:01,160 --> 00:24:04,080
Yeah, it's, it's a bit hard to 
to grok. 

293
00:24:04,080 --> 00:24:15,000
It's, it's too much information 
holes, maybe a more concrete 

294
00:24:15,000 --> 00:24:19,640
example. 
So if we step up from Annex to 

295
00:24:19,640 --> 00:24:26,880
Accent, the neural network 
library X and has layers, and 

296
00:24:26,880 --> 00:24:35,800
each layer is treated as a unit 
of computations for the purposes

297
00:24:35,800 --> 00:24:41,760
of X and. 
But whenever you're recalling 

298
00:24:42,000 --> 00:24:45,840
from, you have a deaf fan and 
you're recalling into another 

299
00:24:45,840 --> 00:24:49,920
deaf fan, the AST will 
propagate. 

300
00:24:49,920 --> 00:24:52,040
It's not the values that are 
being passed. 

301
00:24:52,040 --> 00:24:55,040
So you can accumulate the AST 
over. 

302
00:24:56,080 --> 00:25:01,000
And this means that an Axon 
model is just a big definite 

303
00:25:01,000 --> 00:25:05,000
expression with some other stuff
around as well. 

304
00:25:06,720 --> 00:25:15,400
And then you have a function 
that takes in parameters and 

305
00:25:15,400 --> 00:25:20,480
outputs something. 
And the parameters are not just 

306
00:25:20,480 --> 00:25:24,280
the input, but also the weights 
of the neural network. 

307
00:25:26,160 --> 00:25:31,000
The media is always saying when 
you're, you see announcements 

308
00:25:31,000 --> 00:25:36,800
about LLMS and whatnot, oh, it's
a 70 billion perimeter thing. 

309
00:25:37,320 --> 00:25:42,400
It's because besides the input, 
you have 70 billion numbers 

310
00:25:42,720 --> 00:25:45,640
somewhere in there which are 
passed as arguments. 

311
00:25:46,080 --> 00:25:51,440
OK. 
And then what you want to do is 

312
00:25:52,120 --> 00:25:57,800
for training, you pass an input 
and then you know the expected 

313
00:25:57,800 --> 00:26:01,760
output and you know the actual 
output that the function gives. 

314
00:26:03,280 --> 00:26:08,120
Then you apply what we call a 
last function, which is 

315
00:26:08,120 --> 00:26:16,320
basically how wrong you are. 
And and then if you have a way 

316
00:26:16,320 --> 00:26:22,320
of differentiating the function,
the loss function, then you can 

317
00:26:22,320 --> 00:26:27,960
use that to modify the weights 
back. 

318
00:26:29,400 --> 00:26:32,520
And that's the power that a deaf
end gives. 

319
00:26:32,920 --> 00:26:37,400
You don't have to define how the
differentiation how happens. 

320
00:26:38,640 --> 00:26:42,640
You're using automatic 
differentiation for that, but it

321
00:26:42,640 --> 00:26:48,480
it this is just possible because
it's all code being represented 

322
00:26:48,480 --> 00:26:51,960
as data before it. 
Executes. 

323
00:26:52,360 --> 00:26:55,840
OK. 
All right. 

324
00:26:56,640 --> 00:26:59,880
If we take all of this stuff 
that you've just kind of 

325
00:26:59,880 --> 00:27:04,280
explained to us, can we can, can
you kind of put it into like a 

326
00:27:04,680 --> 00:27:10,520
real world example that from the
standpoint of a developer, how 

327
00:27:10,520 --> 00:27:13,880
you would even begin to use NX 
and like what's a good project 

328
00:27:14,200 --> 00:27:17,360
where you would start 
implementing it? 

329
00:27:19,080 --> 00:27:27,120
Well, if you're aiming to learn 
NX and machine learning, the 

330
00:27:27,120 --> 00:27:31,760
simpler examples are probably 
the best ones. 

331
00:27:32,600 --> 00:27:37,840
NX on there some some guides 
there and maybe start with 

332
00:27:37,840 --> 00:27:43,120
those. 
So things like representing the 

333
00:27:43,320 --> 00:27:49,040
the XOR function as a neural 
network and then training the 

334
00:27:49,040 --> 00:27:52,480
neural network to give off the 
proper result. 

335
00:27:53,120 --> 00:27:56,760
That's maybe the simplest 
example that you can have. 

336
00:27:58,240 --> 00:28:04,080
And then you can step up to 
digit classification, which is 

337
00:28:04,440 --> 00:28:08,920
another one of the bread and 
butter examples that we have. 

338
00:28:10,920 --> 00:28:16,680
And then after that you can 
start threading your path in 

339
00:28:16,680 --> 00:28:19,400
machine learning and work 
easily. 

340
00:28:19,960 --> 00:28:24,320
Cause in working with those, 
you'll learn learn about 

341
00:28:24,320 --> 00:28:32,240
supervised learning, which is 
this concept where I have the 

342
00:28:32,240 --> 00:28:37,200
input and the expected output as
a pair and then I can use those 

343
00:28:37,200 --> 00:28:40,080
to train the new network. 
That's supervised learning. 

344
00:28:43,600 --> 00:28:45,280
And then you'll learn about 
that. 

345
00:28:45,280 --> 00:28:50,440
You'll learn about the how to 
use accent at least. 

346
00:28:53,040 --> 00:28:57,320
And then if you need an X, 
you're probably going to need a 

347
00:28:57,320 --> 00:29:01,280
specific subset of NX. 
And then you can go in the 

348
00:29:01,280 --> 00:29:03,880
documentation and see how to use
that. 

349
00:29:06,240 --> 00:29:13,760
And as you step up to digital 
classification, you're already 

350
00:29:14,000 --> 00:29:18,120
moving from a regression problem
to a classification problem. 

351
00:29:18,520 --> 00:29:21,200
And then you'll Start learning 
about different types of machine

352
00:29:21,200 --> 00:29:25,680
learning problems. 
And that's at least how I learn 

353
00:29:25,680 --> 00:29:30,040
things. 
I like starting from a higher 

354
00:29:30,040 --> 00:29:35,560
level concept and learning the 
details as I see the holes in 

355
00:29:35,560 --> 00:29:39,840
the knowledge. 
And not only as I see them, but 

356
00:29:40,040 --> 00:29:43,520
as I see that I need to fill in 
those holes. 

357
00:29:43,600 --> 00:29:47,720
Yeah, well, I feel like this is 
a very easy subject to jump too 

358
00:29:47,720 --> 00:29:51,560
far and too quick and you get 
overwhelmed because there's a 

359
00:29:51,560 --> 00:29:55,640
lot going on. 
Yeah, if you, if you're doing 

360
00:29:55,640 --> 00:30:00,520
like depth first learning, 
you're probably going to end up 

361
00:30:00,640 --> 00:30:06,000
looking into bits and bytes. 
And that's not that that's too 

362
00:30:06,000 --> 00:30:10,520
far deep. 
And maybe depending on what you 

363
00:30:10,520 --> 00:30:14,960
want to do, the linear algebra 
surface too far deep 'cause we 

364
00:30:14,960 --> 00:30:18,360
have Bumblebee. 
If you're a an Elixir developer 

365
00:30:18,360 --> 00:30:24,120
that wants to have an AI 
application AI function running 

366
00:30:24,120 --> 00:30:28,920
in your app, but you don't 
really want to learn how to 

367
00:30:28,920 --> 00:30:34,160
build one, maybe Bumblebee 
already provides the the model 

368
00:30:34,160 --> 00:30:39,960
that you want to run. 
And then it's just a like 4 

369
00:30:39,960 --> 00:30:43,600
lines of code to get that as a 
process that you can call into 

370
00:30:44,320 --> 00:30:49,600
in your application tree. 
OK, I see. 

371
00:30:50,720 --> 00:30:52,680
Yeah. 
Can you explain? 

372
00:30:52,680 --> 00:30:56,960
I, can you explain what 
Bumblebee is a little bit for 

373
00:30:57,000 --> 00:31:01,120
us? 
I think it's just like learning 

374
00:31:01,120 --> 00:31:04,440
models, right, that you can 
apply to what you're doing 

375
00:31:04,440 --> 00:31:09,400
without LLMS, right? 
Or I might be wrong. 

376
00:31:10,240 --> 00:31:19,200
It's not just LLMS I think 
maybe, but really what bumblebee

377
00:31:19,200 --> 00:31:22,760
is. 
Yes, we have NX as the 

378
00:31:22,760 --> 00:31:26,960
foundation. 
Then we have Axon for neural 

379
00:31:26,960 --> 00:31:32,280
networks and above Axon we have 
bumblebee which takes in 

380
00:31:33,800 --> 00:31:40,920
configuration from Hugging Face 
which is a separate repository 

381
00:31:40,920 --> 00:31:43,400
for machine learning. 
Think of it as GitHub for 

382
00:31:43,400 --> 00:31:44,760
machine learning. 
OK. 

383
00:31:45,720 --> 00:31:50,400
Bumblebee can load models from 
Hugging face into Exxon models. 

384
00:31:53,000 --> 00:31:58,280
So it you need to define some 
coding bumblebee for that to 

385
00:31:58,280 --> 00:32:02,120
happen. 
But in the end result is that we

386
00:32:02,120 --> 00:32:07,560
have a way of getting the 
configuration off of Hugging 

387
00:32:07,560 --> 00:32:13,440
Face and import that as NX code.
And then you can apply 

388
00:32:13,520 --> 00:32:16,600
everything that we have to have 
been talking about so far. 

389
00:32:17,760 --> 00:32:22,000
But if you don't want to, we can
just use that NX code. 

390
00:32:23,200 --> 00:32:28,040
I think it it spits out an Excel
model and then you can get that 

391
00:32:29,960 --> 00:32:38,400
and just use NX serving which is
a a functionality in NX4. 

392
00:32:39,480 --> 00:32:45,080
Spinning up a process that can 
handle batches of data for a 

393
00:32:45,080 --> 00:32:49,560
given function. 
Then it's just spin that up and 

394
00:32:49,560 --> 00:32:55,920
and run with your model. 
Don't need to to go too deep, 

395
00:32:55,920 --> 00:32:58,160
you can just stay at the 
bumblebee level if you want. 

396
00:32:59,440 --> 00:33:03,720
Yeah, that's nice. 
Yeah, I demoed this a bit in the

397
00:33:04,400 --> 00:33:08,080
Denver Elixir meet up. 
That's there's an online 

398
00:33:08,080 --> 00:33:11,040
recording somewhere out in on 
YouTube. 

399
00:33:11,600 --> 00:33:14,520
OK. 
If people want to see like how 

400
00:33:14,520 --> 00:33:19,600
to connect bumblebee with a live
view for instance. 

401
00:33:20,120 --> 00:33:22,760
Yeah, very cool. 
I'm checking out the bumblebee 

402
00:33:22,760 --> 00:33:27,520
GitHub right now and apparently 
hopefully people can hear me. 

403
00:33:27,520 --> 00:33:31,240
I bumped my game quite a bit. 
Apparently my audio is a little 

404
00:33:31,240 --> 00:33:37,320
quiet, but yours is good, so 
hopefully maybe I'll just kind 

405
00:33:37,320 --> 00:33:43,280
of go crazy on my gain. 
Dude, OBS man, it's nothing but 

406
00:33:43,360 --> 00:33:45,360
trouble lately. 
I might have to find a new 

407
00:33:45,440 --> 00:33:52,120
alternative. 
But anyways, hopefully, 

408
00:33:52,120 --> 00:33:54,040
hopefully you can hear me now. 
Nero. 

409
00:33:54,120 --> 00:33:56,440
Do I sound better or is it still
quiet? 

410
00:34:03,300 --> 00:34:06,100
We'll just assume it's probably 
a little better, but I'm 

411
00:34:06,100 --> 00:34:10,000
probably still on the low side 
when it comes to like handling 

412
00:34:10,000 --> 00:34:12,360
performance optimization with 
NX. 

413
00:34:12,400 --> 00:34:16,440
Are there like specific things 
that you need to do to make sure

414
00:34:17,120 --> 00:34:19,360
you're keeping the performance 
that you need? 

415
00:34:28,520 --> 00:34:32,280
There. 
It's probably really hard to. 

416
00:34:33,719 --> 00:34:38,040
There are some things that I I 
mean the the most important one 

417
00:34:38,040 --> 00:34:44,199
is to make sure that your code 
is running with a native back 

418
00:34:44,199 --> 00:34:55,800
end such as Yaxley or EMLX. 
And besides that if if the 

419
00:34:55,800 --> 00:34:58,680
computation doesn't change too 
much over time. 

420
00:34:58,680 --> 00:35:05,360
So if you're passing, if you're 
always passing the same shape of

421
00:35:05,360 --> 00:35:11,760
data as input, then you might 
also want to use a compiler if 

422
00:35:11,760 --> 00:35:13,400
available. 
OK. 

423
00:35:14,160 --> 00:35:18,720
Generally the complaints that I 
get of hey this is too slow is 

424
00:35:18,720 --> 00:35:22,840
mostly due to people not 
configuring the back end 

425
00:35:22,840 --> 00:35:29,920
compiler properly and then 
that's one thing. 

426
00:35:30,280 --> 00:35:35,760
The other is stay in an X lane 
as much as much as possible. 

427
00:35:37,360 --> 00:35:44,720
So one quick example. 
Imagine I have a list of angles 

428
00:35:44,960 --> 00:35:53,000
that I want to calculate the 
cosine of and the list of angles

429
00:35:53,000 --> 00:35:55,040
is represented as in an 
Accenture. 

430
00:35:56,120 --> 00:36:01,600
A simple way would be to do a 
for loop and apply the cosine at

431
00:36:01,600 --> 00:36:05,920
each position and then I get the
number and sort that somewhere. 

432
00:36:07,640 --> 00:36:13,720
The fast version is to just call
an X Cos on the tensor itself 

433
00:36:14,160 --> 00:36:18,040
and Cos is in element. 
By its operation, it already 

434
00:36:18,040 --> 00:36:23,120
knows how to apply itself to the
tensor, and that means that you 

435
00:36:23,120 --> 00:36:29,000
didn't leave an excellent to 
calculate the loop of the cosine

436
00:36:31,440 --> 00:36:33,760
and the. 
I mean, that's a pretty simple 

437
00:36:33,760 --> 00:36:37,320
example, but as as soon as you 
get to more complicated 

438
00:36:37,720 --> 00:36:43,960
functions, or you're translating
functions from math into NX, 

439
00:36:44,480 --> 00:36:49,720
then maybe you need to change 
the way you think about the code

440
00:36:49,720 --> 00:36:57,200
a bit to make it fit into the 
paradigm of vectorized 

441
00:36:57,200 --> 00:37:01,880
computations. 
I see we have a question from 

442
00:37:01,880 --> 00:37:05,000
George, he said. 
Can you describe again what is a

443
00:37:05,000 --> 00:37:07,680
back end and and what is a 
compiler? 

444
00:37:08,760 --> 00:37:15,840
Yeah. 
So NX provides a behavior NX dot

445
00:37:15,840 --> 00:37:21,840
back end, which lists quite a 
few callbacks that you need to 

446
00:37:21,840 --> 00:37:27,760
implement for the NX interface 
to call into. 

447
00:37:29,920 --> 00:37:36,160
So the back end is just that, 
it's a way of turning the NX 

448
00:37:36,160 --> 00:37:40,520
call into some result. 
The back end can do whatever it 

449
00:37:40,520 --> 00:37:43,840
wants really. 
In general we want to calculate 

450
00:37:43,840 --> 00:37:46,560
the actual functions, but not 
always. 

451
00:37:47,960 --> 00:37:53,560
And DNXFN expression is one 
example of that where instead of

452
00:37:53,560 --> 00:37:59,560
spitting out numbers you're 
spitting out a an AST. 

453
00:38:01,320 --> 00:38:05,920
Kind of like using in depth 
macro instead of dev, right? 

454
00:38:08,200 --> 00:38:11,960
But the back end is just that. 
And then you can implement that 

455
00:38:11,960 --> 00:38:16,920
in Elixir itself, which is the 
NX binary back end that comes 

456
00:38:16,920 --> 00:38:21,240
with NX. 
Or you can call into C functions

457
00:38:21,240 --> 00:38:25,680
from somewhere else that's the 
back end. 

458
00:38:25,800 --> 00:38:31,440
The compiler is doing almost the
same, but instead of being 

459
00:38:31,440 --> 00:38:38,440
called of it being called into 
buy an X whenever you do an X 

460
00:38:38,440 --> 00:38:42,200
dot add. 
For instance, an X dot add is 

461
00:38:42,200 --> 00:38:46,200
going to call a back end. 
But if you do an X def fan 

462
00:38:46,520 --> 00:38:52,800
compile, jet jet apply, or you 
have a globally configured 

463
00:38:52,800 --> 00:38:58,400
compiler and you do a dafn and 
call the dafn, all of those are 

464
00:38:58,400 --> 00:39:00,960
going to call into the compiler 
that's configured. 

465
00:39:01,880 --> 00:39:11,440
The compiler is going to take in
not NX add or NX subtract. 

466
00:39:11,480 --> 00:39:15,160
It's going to take in a function
and the arguments. 

467
00:39:16,200 --> 00:39:19,360
OK. 
And then whenever you do that 

468
00:39:19,360 --> 00:39:21,680
and you're called the the 
function with the argument to 

469
00:39:21,680 --> 00:39:26,000
get the expression that 
represents that function, and 

470
00:39:26,000 --> 00:39:30,360
then it takes that expression 
and transforms it into native 

471
00:39:30,360 --> 00:39:33,960
code. 
Doesn't need to be native code, 

472
00:39:33,960 --> 00:39:37,840
but that's generally why you 
want to do a compiler. 

473
00:39:38,600 --> 00:39:41,840
OK, that makes sense. 
And your probably your 

474
00:39:41,840 --> 00:39:45,880
performance and everything is 
probably a lot better when 

475
00:39:45,880 --> 00:39:47,440
you're down in native code, 
right? 

476
00:39:49,040 --> 00:39:53,800
Yeah, it is. 
But The thing is when you you do

477
00:39:53,800 --> 00:40:00,720
a compiler, you're you also have
the ability of the underlying 

478
00:40:00,720 --> 00:40:04,920
code that you're using to do 
operate a fusion and whatnot. 

479
00:40:05,240 --> 00:40:10,600
So one example is EMLX, the back
end and compiler that we have. 

480
00:40:11,160 --> 00:40:21,960
For running on Apple GPU, Metal 
and EMLX without a compiler is 

481
00:40:22,040 --> 00:40:25,760
about 5 times slower than with a
compiler. 

482
00:40:26,280 --> 00:40:32,800
Wow. 
And yeah, it's a pretty big 

483
00:40:32,800 --> 00:40:36,880
difference. 
Yeah, that's, you know, someone.

484
00:40:36,880 --> 00:40:41,160
Let's see, at the very beginning
we had Mark, he's curious to 

485
00:40:41,160 --> 00:40:42,920
hear about the new metal 
support. 

486
00:40:43,480 --> 00:40:46,840
Great timing. 
And so that must have been a new

487
00:40:47,200 --> 00:40:54,280
a new feature recently added. 
I I don't it might have been 

488
00:40:54,280 --> 00:40:56,840
like one month ago exactly. 
OK. 

489
00:40:57,560 --> 00:41:03,320
That I decided that maybe it, 
it, it was time to not just try 

490
00:41:04,200 --> 00:41:09,840
to keep using an XUE, which is 
another back end compiler that 

491
00:41:09,840 --> 00:41:13,200
we have. 
That's the first thing that we 

492
00:41:13,200 --> 00:41:17,240
want. 
We tried to bring Metal support 

493
00:41:17,240 --> 00:41:21,880
into an X. 
And then I decided, hey, MLX 

494
00:41:21,880 --> 00:41:25,240
seems to be stable right now. 
Maybe we can use that. 

495
00:41:25,400 --> 00:41:31,120
And MLX is the official Apple 
library for for machine 

496
00:41:31,120 --> 00:41:35,760
learning. 
So we put together a team that 

497
00:41:37,840 --> 00:41:52,240
me, Samrat, Coco like most of 
the comments were by us 3 and in

498
00:41:52,240 --> 00:41:56,400
like 10 days we we got the whole
back end done. 

499
00:41:57,200 --> 00:41:58,240
That's amazing. 
That's. 

500
00:41:58,560 --> 00:42:01,240
Good. 
Yeah, I I was really impressed. 

501
00:42:04,720 --> 00:42:09,360
Aside from like specific options
in specific functions that are 

502
00:42:09,360 --> 00:42:15,120
harder to to implement, but most
of NX already works with the 

503
00:42:15,120 --> 00:42:19,320
back end. 
And I just now yesterday I I 

504
00:42:19,320 --> 00:42:22,600
sent a pull request for the 
compiler. 

505
00:42:23,440 --> 00:42:26,680
OK. 
It does some crazy stuff 'cause 

506
00:42:26,680 --> 00:42:31,920
it needs to call it back into 
Elixir from NIF land. 

507
00:42:32,320 --> 00:42:37,920
Which was? 
Pretty uncommon and it if we 

508
00:42:37,920 --> 00:42:41,040
were doing this like a month ago
it wouldn't be possible because 

509
00:42:41,240 --> 00:42:48,720
cocos library didn't exist yet. 
But yeah, we called back into an

510
00:42:48,720 --> 00:42:54,880
X into elixir to run through the
function that an X defines. 

511
00:42:56,720 --> 00:43:01,280
But with what? 
With the tracing arguments that 

512
00:43:01,280 --> 00:43:11,080
MLX provides, so that spit spits
out internally at least, the 

513
00:43:11,080 --> 00:43:14,680
equivalent of what we have as a 
definite expression. 

514
00:43:14,960 --> 00:43:19,760
And then MLX can compile that 
down into a function. 

515
00:43:19,760 --> 00:43:24,360
And then we just get that 
function, return it to Elixir, 

516
00:43:24,680 --> 00:43:29,640
cache that, and then pass that 
with the list of inputs into 

517
00:43:29,640 --> 00:43:33,240
another NAF that will do the 
actual function call. 

518
00:43:33,800 --> 00:43:41,240
OK, is most of is is the back 
end and like the compiler are 

519
00:43:41,240 --> 00:43:45,880
these always, are these mostly 
like GPU tasks or how does that 

520
00:43:45,880 --> 00:43:50,000
work? 
Not necessarily. 

521
00:43:50,360 --> 00:43:58,680
I wouldn't say mostly they can 
run on GPU, but for instance if 

522
00:43:58,680 --> 00:44:04,200
you're talking about MLX, Macs 
have a unified memory 

523
00:44:04,200 --> 00:44:10,160
architecture so you're doing 
stuff on the GPU or on the CPU. 

524
00:44:10,160 --> 00:44:13,160
Boils down to what does what 
faster. 

525
00:44:13,880 --> 00:44:17,840
OK. 
GPUs are highly parallel, but 

526
00:44:17,840 --> 00:44:20,160
they don't do sequential stuff 
really well. 

527
00:44:21,280 --> 00:44:26,560
So if we're doing a loop over 
and over the same data, maybe 

528
00:44:26,760 --> 00:44:29,000
doing that on the CPU is going 
to be faster. 

529
00:44:29,280 --> 00:44:35,600
OK, now is this something that 
is automatically figured out or 

530
00:44:35,600 --> 00:44:37,680
is this something that has to be
done in configuration? 

531
00:44:38,760 --> 00:44:40,840
It has to be done in 
configuration. 

532
00:44:40,960 --> 00:44:45,240
OK. 
Right now, we might be able to 

533
00:44:45,840 --> 00:44:51,920
to say, hey, you're trying to 
run this on this GPU, but that's

534
00:44:51,920 --> 00:44:53,600
not it should be running on the 
CPU. 

535
00:44:53,600 --> 00:44:58,080
Yeah, but we're definitely not 
on that stage. 

536
00:44:58,080 --> 00:45:01,680
Yeah, no, I mean, that was 
probably a dumb question. 

537
00:45:01,680 --> 00:45:05,760
I was just, I didn't know. 
No, definitely not a dumb 

538
00:45:05,760 --> 00:45:14,600
question. 
In general, it's it's hard for 

539
00:45:15,400 --> 00:45:21,720
someone that's not in the space 
to differentiate between it's 

540
00:45:21,840 --> 00:45:26,640
sequential code and parallel 
code and parallel code versus 

541
00:45:26,640 --> 00:45:31,120
concurrent code. 
Because the magic of the GPUs 

542
00:45:31,120 --> 00:45:33,680
really is that you're truly 
parallel. 

543
00:45:34,080 --> 00:45:37,400
You're not concurrent. 
I mean, you're concurrent in the

544
00:45:37,400 --> 00:45:41,160
sense that the GPU is a 
resource, but as soon as you 

545
00:45:41,160 --> 00:45:46,440
have a computation running on 
the GPU, it can take over all 

546
00:45:46,440 --> 00:45:49,800
the of the GPU at once if it 
needs to. 

547
00:45:50,680 --> 00:45:54,000
And then that's why running 
things on the GPO is a lot 

548
00:45:54,000 --> 00:45:57,400
faster. 
GP OS are built for doing high, 

549
00:45:57,520 --> 00:46:01,480
highly parallel computations 
over the exact types of 

550
00:46:01,480 --> 00:46:06,560
computations that we have in 
neural networks, which is matrix

551
00:46:06,560 --> 00:46:09,280
and vector products mostly. 
Got you. 

552
00:46:09,360 --> 00:46:12,880
That's where the GPO shines. 
OK, that makes sense. 

553
00:46:15,160 --> 00:46:19,280
And that's why you, that's why I
like NVIDIA stocks are shooting 

554
00:46:19,280 --> 00:46:24,760
through the roof right now. 
Yeah, but then when you get to 

555
00:46:24,760 --> 00:46:28,760
something like the Fourier 
transform, which is really 

556
00:46:28,760 --> 00:46:34,520
common for non machine learning 
stuff, GPUs don't do that too 

557
00:46:34,520 --> 00:46:36,520
well. 
OK. 

558
00:46:37,240 --> 00:46:41,960
Like the, the CPU 
implementations tend to be, if 

559
00:46:41,960 --> 00:46:46,000
not faster, at least as fast. 
OK. 

560
00:46:46,800 --> 00:46:49,680
As GPU, so and then you don't 
have the overhead of 

561
00:46:49,680 --> 00:46:53,360
transferring data to the GPU. 
OK, that makes sense. 

562
00:46:54,240 --> 00:46:58,400
Are you able to have these? 
Like if you have different 

563
00:46:58,400 --> 00:47:01,720
tasks, can you are you, can you 
have different configurations 

564
00:47:01,720 --> 00:47:05,840
set up that like this goes to 
the CPU and this goes to the 

565
00:47:05,840 --> 00:47:10,080
GPU? 
You have currently you had you, 

566
00:47:11,360 --> 00:47:16,280
you can, but currently you have 
to to split the computation 

567
00:47:16,280 --> 00:47:21,360
manually for that to happen. 
But the work that I've been 

568
00:47:21,360 --> 00:47:25,840
doing the past three months in 
sharding and partitioning 

569
00:47:25,840 --> 00:47:30,520
functions, one of the things 
that stems from that is that you

570
00:47:30,520 --> 00:47:37,960
can annotate a an X function 
with metadata and then basically

571
00:47:37,960 --> 00:47:43,280
get it to be split up between 
different execution stages. 

572
00:47:43,720 --> 00:47:46,320
Oh, OK, cool. 
And then each execution stage 

573
00:47:46,320 --> 00:47:52,160
will be able to to be compiled 
down to whatever target you 

574
00:47:52,160 --> 00:47:52,760
want. 
Nice. 

575
00:47:53,880 --> 00:47:58,480
OK, that's cool. 
And the the goal here is for us 

576
00:47:58,480 --> 00:48:03,160
to be able to get maybe the 1st 
2 stages to run on the current 

577
00:48:03,160 --> 00:48:06,800
machine and then the third stage
to run on a separate machine. 

578
00:48:07,760 --> 00:48:10,440
If we have clustering, that 
should work just fine. 

579
00:48:10,920 --> 00:48:13,920
OK. 
And then the machines don't need

580
00:48:13,920 --> 00:48:17,960
to be the same hardware. 
Oh wow, yeah, that's cool. 

581
00:48:18,040 --> 00:48:24,600
I can cluster my Mac with my 
Linux machines and then have the

582
00:48:24,600 --> 00:48:27,400
native code for each one run. 
OK. 

583
00:48:27,760 --> 00:48:32,200
The communication happens via 
Elixir, but. 

584
00:48:33,520 --> 00:48:37,000
Like over like node? 
Oh, like a distributed system? 

585
00:48:37,000 --> 00:48:39,240
Then yeah. 
Yes, exactly that. 

586
00:48:41,200 --> 00:48:46,280
And like just being able to 
compile onto different hardware 

587
00:48:46,280 --> 00:48:50,440
is already enough. 
But even in the same machine you

588
00:48:50,440 --> 00:48:54,960
can have a section that runs on 
the CPU and a section that runs 

589
00:48:54,960 --> 00:48:59,720
on the GPU. 
I brought this as a as an 

590
00:48:59,720 --> 00:49:05,400
experimental thing to an X Siri 
even, but it probably needs to 

591
00:49:05,400 --> 00:49:09,120
be redone where there are 
certain functions that don't 

592
00:49:09,120 --> 00:49:12,120
work home at all yet. 
OK. 

593
00:49:13,120 --> 00:49:17,240
On that back end. 
Then I take the computation and 

594
00:49:17,240 --> 00:49:21,200
split it up so that those 
functions are running on the 

595
00:49:21,200 --> 00:49:23,240
CPU. 
OK, that's. 

596
00:49:23,720 --> 00:49:27,440
Then I then you go back to to 
the GPU to run the rest. 

597
00:49:28,440 --> 00:49:31,920
Could you potentially then kind 
of treat it like a load balancer

598
00:49:31,920 --> 00:49:36,960
as well, like like across your 
resources that are available? 

599
00:49:40,360 --> 00:49:44,440
I wouldn't say a load balancer 
because that's more on the NX 

600
00:49:44,440 --> 00:49:46,960
serving type of functionality. 
OK. 

601
00:49:49,200 --> 00:49:54,080
At least in the sense of 
balancing loads of how many 

602
00:49:54,080 --> 00:49:57,400
requests you have versus how 
many machines you have or how 

603
00:49:57,400 --> 00:50:01,280
many you have when I said. 
That I was meaning more like. 

604
00:50:01,600 --> 00:50:04,040
Yeah, balancing being. 
Allocated. 

605
00:50:05,040 --> 00:50:10,120
Yeah, if you, if you're, you 
want to have, imagine you're, 

606
00:50:10,120 --> 00:50:14,320
you're running on desktops. 
Like there's one desktop there, 

607
00:50:14,920 --> 00:50:17,760
there's another right beside me 
and this machine. 

608
00:50:17,760 --> 00:50:21,520
Imagine all of the three, all 
all three of those are used by 

609
00:50:21,640 --> 00:50:24,560
people. 
You don't want to hog all the 

610
00:50:24,560 --> 00:50:30,280
resources because people might 
be using those for whatever. 

611
00:50:31,960 --> 00:50:37,440
Then maybe it makes sense for 
you to to run most of the code 

612
00:50:37,440 --> 00:50:41,520
in your in the machine that 
you're using and then take over 

613
00:50:41,520 --> 00:50:45,640
parts of the other machines just
for. 

614
00:50:48,000 --> 00:50:52,680
Maybe the model doesn't fit in 
your machine, but really the 

615
00:50:52,680 --> 00:50:57,200
least splits that you do is 
probably going to be faster. 

616
00:50:58,160 --> 00:50:59,520
OK. 
Yeah, that makes sense. 

617
00:51:01,640 --> 00:51:06,040
But yeah, you there are a lot, a
lot of things that you can do 

618
00:51:06,040 --> 00:51:08,920
when you have that kind of trend
or control. 

619
00:51:09,240 --> 00:51:11,720
Yeah, no, that's really cool. 
I love that. 

620
00:51:13,080 --> 00:51:17,320
Another thing that we might be 
able to do, or at least that's 

621
00:51:17,320 --> 00:51:22,840
one of the things that I, I want
to get working by February. 

622
00:51:24,880 --> 00:51:29,960
Imagine you have a a cluster of 
being nodes. 

623
00:51:31,720 --> 00:51:39,080
You can build a graph that tells
you which nodes are what's the 

624
00:51:39,240 --> 00:51:48,360
the the least least latency path
without loops between those 

625
00:51:48,480 --> 00:51:57,200
nodes like just so that in the 
end you can take a computation 

626
00:51:57,200 --> 00:52:02,520
splitted over all of those nodes
in such a way that you're doing 

627
00:52:02,600 --> 00:52:08,640
the least split with the least 
amount of latency possible. 

628
00:52:09,040 --> 00:52:13,720
Nice. 
Yeah, that really like there's 

629
00:52:13,720 --> 00:52:17,320
your performance optimization, 
right, The lowest latency in. 

630
00:52:17,320 --> 00:52:19,640
Yeah, yeah. 
But then that that's not a 

631
00:52:19,640 --> 00:52:21,360
machine learning problem 
anymore. 

632
00:52:21,800 --> 00:52:24,280
Yeah. 
It becomes like distributed 

633
00:52:24,280 --> 00:52:25,840
systems graphs. 
Right. 

634
00:52:26,160 --> 00:52:28,160
Yeah. 
That type of problems please. 

635
00:52:29,880 --> 00:52:32,840
It's just how you're handling 
your machine learning problems. 

636
00:52:33,360 --> 00:52:35,480
Yeah. 
Now you're going to need like 

637
00:52:35,480 --> 00:52:39,040
some version of DevOps just for 
for that part. 

638
00:52:40,880 --> 00:52:45,560
Yeah. 
What is like when you're setting

639
00:52:45,560 --> 00:52:48,240
up? 
Like when you're using like 

640
00:52:48,240 --> 00:52:52,080
distributed nodes and things for
processing machine learning 

641
00:52:52,080 --> 00:52:57,720
problems, is it normally like 
local, local host things like 

642
00:52:57,720 --> 00:53:03,440
are, is it like lab like, you 
know, desk testing things or are

643
00:53:03,440 --> 00:53:07,960
you running servers all over the
world to do stuff with like 

644
00:53:07,960 --> 00:53:21,000
larger projects? 
Imagine you have a web app for 

645
00:53:21,000 --> 00:53:26,240
instance, and then it does a lot
of stuff and one of the the 

646
00:53:26,240 --> 00:53:34,880
things that it does, it requires
a machine learning task, but it 

647
00:53:34,880 --> 00:53:37,440
just doesn't do that. 
It does other things as well. 

648
00:53:38,480 --> 00:53:43,960
It might make sense for you to 
have multiple web nodes and then

649
00:53:43,960 --> 00:53:50,440
have those web nodes call into a
separate single GPU node just 

650
00:53:50,440 --> 00:53:57,160
for that machine learning task. 
OK, so it's if you have a web 

651
00:53:57,160 --> 00:54:01,560
app and you do a machine 
learning task, have a separate 

652
00:54:02,160 --> 00:54:06,720
resource just for that. 
Yeah, that's not necessarily 

653
00:54:06,720 --> 00:54:10,040
what you want to do. 
Like if if the the machine 

654
00:54:10,040 --> 00:54:12,160
learning task is the main thing 
that you do. 

655
00:54:12,680 --> 00:54:14,360
OK. 
Maybe you want to keep them 

656
00:54:14,360 --> 00:54:25,880
closer, but generally it's one 
of many moving parts and then an

657
00:54:25,880 --> 00:54:27,960
X serving can handle that for 
you. 

658
00:54:28,720 --> 00:54:35,360
The the Denver Meter demo that I
mentioned, I start by developing

659
00:54:35,360 --> 00:54:42,600
things as a single note and then
I I start 2 notes, one of which 

660
00:54:42,960 --> 00:54:48,840
one of one of those has just the
NX serving and the other has 

661
00:54:49,200 --> 00:54:55,760
just the web parts of the the 
supervisor tree. 

662
00:54:57,360 --> 00:55:01,520
And because it's name 
registration in a global aspect,

663
00:55:03,680 --> 00:55:08,920
the whenever you call an X 
serving batched run from the 

664
00:55:08,920 --> 00:55:11,960
live view it or it will call 
into the other node 

665
00:55:11,960 --> 00:55:16,480
automatically. 
Like you you change the the the 

666
00:55:16,480 --> 00:55:22,240
supervision tree but not the 
code that's called the the NX 

667
00:55:22,240 --> 00:55:27,120
for me. 
Then if you have multiple nodes 

668
00:55:27,120 --> 00:55:29,680
with the same serving then it 
does load balancing and that 

669
00:55:29,680 --> 00:55:31,400
types type of stuff. 
OK. 

670
00:55:32,040 --> 00:55:35,640
And that's taken care of in your
NX serving for the load 

671
00:55:35,640 --> 00:55:37,440
balancing part? 
Nice. 

672
00:55:37,440 --> 00:55:44,200
Yeah, that's cool. 
So we can have 20 web nodes and 

673
00:55:44,440 --> 00:55:49,400
2-3 GPO nodes. 
OK, Yeah, that's really cool. 

674
00:55:49,480 --> 00:55:51,200
Yeah, I. 
Have a lot to learn. 

675
00:55:56,360 --> 00:55:58,040
I love that. 
That's very cool. 

676
00:55:59,440 --> 00:56:02,400
My mind is getting blown over 
and over right now. 

677
00:56:04,960 --> 00:56:10,240
Yeah. 
But really keeping my keeping in

678
00:56:10,240 --> 00:56:16,520
mind that all of these concepts 
that we talked about, they keep 

679
00:56:16,680 --> 00:56:21,080
appearing as the relevant 
questions are being asked. 

680
00:56:22,440 --> 00:56:28,120
So really it's just too much 
thing, too much stuff to learn 

681
00:56:28,880 --> 00:56:34,840
or it seems too much because 
we're talking for too long 

682
00:56:34,840 --> 00:56:40,920
without you going back and oh, I
have what I need to to do what I

683
00:56:40,920 --> 00:56:45,000
want it wanted to do right now, 
which is the process that you're

684
00:56:45,000 --> 00:56:47,760
following when you're developing
something. 

685
00:56:47,920 --> 00:56:50,600
Yeah, it's like, hey, I need to 
solve this problem. 

686
00:56:50,600 --> 00:56:54,440
What do I need to do? 
What do I need to learn or I 

687
00:56:54,440 --> 00:56:56,640
need to run this OK, I can solve
the problem. 

688
00:56:57,200 --> 00:56:59,800
Hey, I have a new problem. 
What do I need to do to solve 

689
00:56:59,800 --> 00:57:03,840
that? 
It just gets overwhelming when 

690
00:57:03,840 --> 00:57:09,520
you're like, yeah, when you're 
just taking actual overview of. 

691
00:57:09,560 --> 00:57:11,400
Everything right? 
Exactly. 

692
00:57:11,400 --> 00:57:13,640
But that is true. 
Like anytime you're learning 

693
00:57:13,640 --> 00:57:17,360
something, it's best to start 
your own project, right? 

694
00:57:17,360 --> 00:57:20,840
And then, yeah, you run into 
problem at a time that you have 

695
00:57:20,840 --> 00:57:24,520
to solve versus 100 problems at 
once. 

696
00:57:25,280 --> 00:57:29,160
Yeah, and then things get less 
overwhelming. 

697
00:57:29,440 --> 00:57:32,480
Yeah, for sure. 
When you do that, plus the thing

698
00:57:32,480 --> 00:57:39,320
that I mentioned where maybe you
want to go depth first but limit

699
00:57:39,320 --> 00:57:40,960
the depth. 
Yeah, yeah. 

700
00:57:41,400 --> 00:57:44,920
No, I get like a lot of times 
I'll like to like, read 

701
00:57:45,200 --> 00:57:47,280
something about a subject, 
right. 

702
00:57:48,320 --> 00:57:51,520
But then you'll find yourself 
reading and like, learning too 

703
00:57:51,520 --> 00:57:54,960
much where you start to not 
grasp things, and that's where 

704
00:57:54,960 --> 00:57:57,240
I'll stop. 
And then you get that to start 

705
00:57:57,240 --> 00:58:00,560
at step one. 
Yeah. 

706
00:58:04,360 --> 00:58:07,640
Yeah, like I need to go back and
just kind of wrap my head around

707
00:58:07,640 --> 00:58:10,560
tensors and then then we can 
continue. 

708
00:58:15,040 --> 00:58:21,680
Yeah, just to highlight for 
people listening, it's this 

709
00:58:21,680 --> 00:58:24,280
stuff that we're talking about 
in learning. 

710
00:58:24,280 --> 00:58:27,080
It's not just machine learning, 
it's learning in general. 

711
00:58:28,240 --> 00:58:30,760
That's the same process of 
learning that I apply for 

712
00:58:30,760 --> 00:58:36,640
everything I learn. 
Find find a motivator problem, 

713
00:58:37,000 --> 00:58:41,360
use that to bootstrap the low 
level knowledge but not too 

714
00:58:41,360 --> 00:58:45,360
much, and then go into a 
separate problem, then that's 

715
00:58:45,360 --> 00:58:48,480
something. 
And then if you do that over and

716
00:58:48,480 --> 00:58:51,600
over, you're closing the gap 
between the higher level 

717
00:58:51,600 --> 00:58:55,120
knowledge and the low level 
knowledge until you fully grasp 

718
00:58:55,440 --> 00:58:57,800
the subject. 
Yeah, that's great advice. 

719
00:58:58,080 --> 00:58:59,680
I love that. 
That's good. 

720
00:59:01,680 --> 00:59:06,360
So what what's on the road map 
for NX that you're like most 

721
00:59:06,360 --> 00:59:09,080
excited about that you can talk 
about it. 

722
00:59:09,080 --> 00:59:11,640
You don't have to talk about 
anything that you're not ready 

723
00:59:11,640 --> 00:59:16,080
to, but. 
Well, I'd say that the sharding 

724
00:59:16,080 --> 00:59:17,920
and partitioning thing that I 
mentioned. 

725
00:59:18,040 --> 00:59:22,280
Yeah, that sounds really cool. 
We talked about partitioning, 

726
00:59:22,280 --> 00:59:27,080
which is sequential splits in 
the code, but there is also 

727
00:59:27,080 --> 00:59:32,120
sharding. 
Sorry, there is also sharding, 

728
00:59:32,360 --> 00:59:38,280
where Imagine going back to the 
cosine example. 

729
00:59:39,600 --> 00:59:42,800
To calculate the cosine in each 
position of a vector. 

730
00:59:44,680 --> 00:59:48,280
You don't need to get the data 
from other positions right? 

731
00:59:49,560 --> 00:59:55,920
And that means that if you split
the computation up, calculate 

732
00:59:55,920 --> 01:00:00,320
each data piece separately, and 
then stitch the results back 

733
01:00:00,320 --> 01:00:03,120
together, you're going to get 
the same result. 

734
01:00:05,360 --> 01:00:10,280
Which means that if you want to 
configure your code to be split 

735
01:00:10,280 --> 01:00:16,480
up, let's say you get a matrix 
and split into and then split 

736
01:00:16,480 --> 01:00:21,960
that into four parts and get two
of those who run on the GPU and 

737
01:00:21,960 --> 01:00:27,880
the other two to run on the CPU.
Or you have multiple Gpos in 

738
01:00:27,880 --> 01:00:33,280
each of those processes, one of 
the the thing, one of the other 

739
01:00:33,280 --> 01:00:36,600
parts, and then you'll stitch 
the results back together. 

740
01:00:37,600 --> 01:00:46,200
Then you might be able to handle
more data or handle data in a 

741
01:00:46,200 --> 01:00:54,960
faster way. 
So both of those have the aspect

742
01:00:54,960 --> 01:01:03,640
of being able to handle more 
data, which is really important 

743
01:01:03,640 --> 01:01:10,360
for in a time that, like the run
of the MU LLM requires 80 

744
01:01:10,360 --> 01:01:12,480
gigabytes of RAM or something. 
Yeah. 

745
01:01:12,560 --> 01:01:18,840
That's wild. 
Like I I have that on on my 

746
01:01:18,840 --> 01:01:22,000
desktop but in RAM, not in VRAM.
Right. 

747
01:01:22,840 --> 01:01:27,960
Right. 
And yeah, you you need to be 

748
01:01:27,960 --> 01:01:32,800
able to split your split up your
computation if you want to run 

749
01:01:32,800 --> 01:01:38,400
that on your machine or if you 
need to reduce costs by getting 

750
01:01:38,400 --> 01:01:43,760
a cheaper GPU, then maybe you 
instead of splitting it up on 

751
01:01:43,760 --> 01:01:46,560
different machines, you do 
splits over time. 

752
01:01:47,080 --> 01:01:49,800
Right. 
You do one thing, save the 

753
01:01:49,800 --> 01:01:56,240
results disk the other thing 
safe, and if you do that in the 

754
01:01:56,440 --> 01:01:59,840
correct sequence, you'll get the
same result. 

755
01:02:00,160 --> 01:02:04,560
Slower. 
Or maybe not, because if you're 

756
01:02:04,600 --> 01:02:07,440
you couldn't run it anyway 
beforehand. 

757
01:02:07,880 --> 01:02:09,760
Anything is faster than 
Infinity. 

758
01:02:10,280 --> 01:02:12,400
Yeah, yeah, If you if you kill 
your. 

759
01:02:12,400 --> 01:02:14,480
Resource Infinity time. 
Exactly. 

760
01:02:15,920 --> 01:02:22,520
So yeah, I think sharding and 
partitioning is what starts to 

761
01:02:22,520 --> 01:02:25,680
bring an axe in a different 
direction than what Python is 

762
01:02:25,680 --> 01:02:28,840
going into. 
Yeah, well, it's if it's like, 

763
01:02:28,840 --> 01:02:31,480
at least from my point of view, 
it seems like it makes it a lot 

764
01:02:31,480 --> 01:02:34,720
more accessible to the average 
dev that just wants to play 

765
01:02:34,720 --> 01:02:37,680
around. 
Yeah, but it's not just the 

766
01:02:37,680 --> 01:02:43,000
average dev because you you can 
stern, let's take a small 

767
01:02:43,000 --> 01:02:46,760
company, you can start 
developing on your your dev 

768
01:02:46,760 --> 01:02:49,160
machine. 
And then you would just expose 

769
01:02:49,160 --> 01:02:52,720
that as a service. 
And then you started getting in 

770
01:02:52,720 --> 01:02:56,640
money and you can get like the 
same machine because it's 

771
01:02:56,640 --> 01:03:00,200
probably cheap because you you 
already had that before the 

772
01:03:00,200 --> 01:03:04,920
company. 
So you can buy the same of the 

773
01:03:05,240 --> 01:03:08,640
another of the same machine and 
then run on that and start 

774
01:03:08,640 --> 01:03:13,640
bootstrapping yourself without 
having to increase hardware 

775
01:03:13,640 --> 01:03:17,360
costs exponentially. 
Because if you're doing cloud 

776
01:03:17,360 --> 01:03:23,160
stuff like one month or two of 
cloud costs, if you need to run 

777
01:03:23,160 --> 01:03:29,920
24/7 already, already covers the
cost of having your own hardware

778
01:03:30,600 --> 01:03:33,600
depending on, on what you're 
you're doing. 

779
01:03:34,120 --> 01:03:39,720
And then yeah, a medium sized 
company and oh, I need more 

780
01:03:39,720 --> 01:03:43,680
clients. 
OK, you have the the beam and 

781
01:03:43,680 --> 01:03:48,560
the beam can solve the 
clustering for you and X serving

782
01:03:48,560 --> 01:03:55,040
can do the load balancing. 
So it's easy to start going up 

783
01:03:55,440 --> 01:04:02,440
in size without having to have 
the the the cost rising the same

784
01:04:02,440 --> 01:04:05,320
rate. 
The cost can rise a lot slower 

785
01:04:07,680 --> 01:04:11,600
and that's one of the things 
that churning, partitioning and 

786
01:04:11,600 --> 01:04:15,760
next serving can bring. 
Yeah, like you, it allows you to

787
01:04:15,760 --> 01:04:19,000
do like horizontal scaling at a 
very small scale. 

788
01:04:19,720 --> 01:04:25,440
Yeah, but also if you're going 
into the close the data center 

789
01:04:25,440 --> 01:04:27,920
clustering direction. 
Yeah, yeah. 

790
01:04:28,200 --> 01:04:29,840
It works the. 
Same way, right? 

791
01:04:29,960 --> 01:04:33,720
Exactly because of the beam. 
Yeah, magic. 

792
01:04:33,720 --> 01:04:37,560
And then it's a lot easier for 
us to bring machine learning 

793
01:04:38,040 --> 01:04:43,600
from Python to that then bring 
the Bing to. 

794
01:04:43,760 --> 01:04:47,880
Yeah, that makes sense. 
So with that being said, does 

795
01:04:47,880 --> 01:04:51,160
that mean like the Python has a 
lot of limitations when it comes

796
01:04:51,160 --> 01:04:55,120
to doing doing this that kind of
things where you do need 

797
01:04:55,120 --> 01:04:57,080
sharding and like resource 
splitting? 

798
01:04:57,760 --> 01:05:02,000
It's harder. 
You have Axel Labs that does 

799
01:05:03,400 --> 01:05:05,720
partitioning, maybe sharding as 
well. 

800
01:05:06,120 --> 01:05:13,120
In Python using MLX, they need 
to use GRPC for transferring 

801
01:05:13,120 --> 01:05:17,800
data between nodes. 
We have native RPC. 

802
01:05:19,920 --> 01:05:23,520
That's already a pretty strong 
argument I'd say. 

803
01:05:24,360 --> 01:05:28,000
And the beam distribution is is 
pluggable as well. 

804
01:05:28,160 --> 01:05:32,800
We're talking about configure 
bike ends on Tesla and NX. 

805
01:05:33,320 --> 01:05:37,560
The Beam distribution itself can
be configured in different ways,

806
01:05:38,040 --> 01:05:44,240
so if you have a really specific
network type then maybe the Beam

807
01:05:44,320 --> 01:05:47,960
can leverage that. 
Yeah, that's awesome. 

808
01:05:50,040 --> 01:05:55,720
It's kind of it's kind of like 
the beam was accidentally made 

809
01:05:55,720 --> 01:06:01,720
for machine learning. 
Yeah, but or the joke that 

810
01:06:01,720 --> 01:06:03,720
everything has already been 
invented. 

811
01:06:03,880 --> 01:06:06,240
That too, right? 
Maybe. 

812
01:06:06,800 --> 01:06:12,560
Maybe up until 1986 and then 
everything is just a rehash. 

813
01:06:13,080 --> 01:06:15,400
Yeah, that's true. 
That's probably more likely, 

814
01:06:15,400 --> 01:06:19,200
right? 
Or the simulation got reset 

815
01:06:19,200 --> 01:06:21,080
somewhere and we're just 
starting over. 

816
01:06:22,320 --> 01:06:26,280
Yeah. 
But really, neural networks are 

817
01:06:26,360 --> 01:06:30,880
maybe something that came. 
I'm almost sure that neural 

818
01:06:30,880 --> 01:06:33,680
networks came before Erlink was 
a thing. 

819
01:06:35,160 --> 01:06:39,200
Yeah, I would think so, right. 
Yeah, we just didn't have the 

820
01:06:39,200 --> 01:06:41,040
the compute power. 
Right. 

821
01:06:41,680 --> 01:06:43,600
At least like theoretically, 
they were there. 

822
01:06:44,120 --> 01:06:50,000
Yeah. 
And but then you, you have 

823
01:06:50,000 --> 01:06:54,040
something that's built for 
distributed compute concurrent 

824
01:06:54,040 --> 01:06:59,680
work. 
It, it, it was built to handle 

825
01:07:00,440 --> 01:07:04,800
like as many people as as people
exist, right? 

826
01:07:05,880 --> 01:07:08,920
That's for telephones. 
So it's fear. 

827
01:07:09,880 --> 01:07:14,560
And then that same scale still 
happens. 

828
01:07:14,560 --> 01:07:17,520
It's just that we have more 
people, but it's still scaling 

829
01:07:17,520 --> 01:07:20,600
with the number of people, the 
number of requests that we have 

830
01:07:21,000 --> 01:07:25,800
or OK, we have bots and so on. 
But really the bulk of 

831
01:07:25,800 --> 01:07:30,360
legitimate product requests that
are going to happen is going to 

832
01:07:30,520 --> 01:07:38,120
be scanning with number of 
people and then at that scale or

833
01:07:38,120 --> 01:07:39,720
link shines. 
Yeah. 

834
01:07:41,240 --> 01:07:42,520
Yeah, and we have the same 
power. 

835
01:07:42,880 --> 01:07:48,360
Yeah, it's wild that all of this
was figured out in 1986. 

836
01:07:52,920 --> 01:07:56,600
Yeah. 
That's cool. 

837
01:07:56,600 --> 01:08:02,000
I mean, it just kind of shows 
you that like the we run into 

838
01:08:02,000 --> 01:08:04,880
the same problems throughout 
time, right? 

839
01:08:04,880 --> 01:08:08,680
And it's kind of just the media 
shifts like instead of 

840
01:08:08,680 --> 01:08:12,480
telephones, it's still data over
wires, right? 

841
01:08:12,480 --> 01:08:13,880
It's still kind of the same 
thing. 

842
01:08:13,880 --> 01:08:15,560
It's just a different way we're 
using it. 

843
01:08:17,560 --> 01:08:25,920
Yeah, maybe a nice way to look 
at this is if you're just 

844
01:08:25,920 --> 01:08:29,560
looking from the top down, it 
might look like we're going in 

845
01:08:29,560 --> 01:08:33,479
circles, but it might just be 
spiraling up. 

846
01:08:33,560 --> 01:08:35,800
Yeah, there you go. 
Yeah, that makes sense. 

847
01:08:36,680 --> 01:08:40,240
It it's almost the same thing, 
but it's with more accumulated 

848
01:08:40,240 --> 01:08:43,880
knowledge with different 
resources available. 

849
01:08:46,399 --> 01:08:52,920
One example the the MLX compiler
that I I wrote this week, 3 

850
01:08:52,920 --> 01:08:55,000
weeks ago. 
When I first looked at the 

851
01:08:55,000 --> 01:09:00,160
problem I was going for a 
different type of solution, but 

852
01:09:00,160 --> 01:09:05,359
then there the the NIF call 
library came about and I was 

853
01:09:05,359 --> 01:09:10,399
able to incorporate that into 
the solution space that I could 

854
01:09:10,399 --> 01:09:14,760
leverage. 
And then the the the resulting 

855
01:09:14,760 --> 01:09:19,080
code was a lot simpler and 
didn't require me going in the 

856
01:09:19,080 --> 01:09:25,680
internals of MLX. 
So it really is me going back to

857
01:09:25,680 --> 01:09:30,120
where I started, but with a 
different starting condition. 

858
01:09:31,439 --> 01:09:35,760
Yeah, you a tool was enabled to 
make your life a little easier. 

859
01:09:36,279 --> 01:09:40,720
Yeah, and that made the whole 
difference, but this happens in 

860
01:09:40,760 --> 01:09:44,680
the larger scale as well. 
Yeah. 

861
01:09:45,439 --> 01:09:54,640
Your your phone is maybe maybe, 
you know, it's likely faster 

862
01:09:54,640 --> 01:10:00,240
than the whole the whole world's
computing power at the time that

863
01:10:00,240 --> 01:10:05,120
we we went to the moon. 
The whole world's. 

864
01:10:05,480 --> 01:10:09,960
Yeah, not just like the the the 
rocket computer, I'd say maybe 

865
01:10:09,960 --> 01:10:11,800
all computers. 
For sure. 

866
01:10:11,800 --> 01:10:14,160
Yep. 
And it's just your phone. 

867
01:10:14,160 --> 01:10:16,360
Maybe your Apple Watch? 
Even right? 

868
01:10:16,560 --> 01:10:20,360
Yeah, might be, might be faster.
Not not as much memory, but 

869
01:10:20,720 --> 01:10:25,120
faster, yeah. 
And that's crazy to think about.

870
01:10:25,120 --> 01:10:28,920
That is crazy. 
It's crazy that like our phone 

871
01:10:29,480 --> 01:10:33,440
would not even fit into like a 
huge building. 

872
01:10:34,720 --> 01:10:42,960
Yeah, and fun fact, if you have 
an iPhone and you you're running

873
01:10:42,960 --> 01:10:48,120
live on native, we can run an X 
code in our application. 

874
01:10:49,200 --> 01:10:54,040
Oh, really? 
Yeah, the IT it's still 

875
01:10:54,040 --> 01:10:58,800
unreleased, but the talk that I 
gave in at Elixir Conf was 

876
01:10:58,920 --> 01:11:05,760
compiling NX to to some code 
that we could deploy to the iPad

877
01:11:06,040 --> 01:11:09,200
and run it natively without 
sending data back to the server.

878
01:11:09,560 --> 01:11:13,080
Oh wow, that's cool. 
And I use the iPad because 

879
01:11:13,080 --> 01:11:16,400
that's the iOS device that I 
have, but it should work with 

880
01:11:16,400 --> 01:11:18,840
the iPhone as well. 
Yeah, I would think it'd work 

881
01:11:18,840 --> 01:11:20,560
the same way, right? 
Yeah. 

882
01:11:20,800 --> 01:11:24,600
That's cool, so you can have an 
NX server running on a on an 

883
01:11:24,600 --> 01:11:29,040
iPhone. 
Kind of like that, yeah. 

884
01:11:30,680 --> 01:11:32,400
Think about it in the next 
function. 

885
01:11:32,560 --> 01:11:36,480
Instead. 
OK, that's cool. 

886
01:11:38,480 --> 01:11:42,440
I like that I'm live view native
is a cool project. 

887
01:11:42,480 --> 01:11:44,920
I I need to spend some time with
it now. 

888
01:11:45,360 --> 01:11:50,760
Now that it's, it seems like 
it's in a pretty good spot to 

889
01:11:50,760 --> 01:11:52,640
start playing around with. 
It is. 

890
01:11:52,640 --> 01:11:58,440
It is Dockyard is starting to 
accept contracts for native 

891
01:11:58,600 --> 01:12:00,800
occasions. 
That's great. 

892
01:12:00,840 --> 01:12:03,640
Yeah, Yeah. 
I think it's a game changer for 

893
01:12:03,640 --> 01:12:06,560
at least adoption in the Elixir 
space. 

894
01:12:08,160 --> 01:12:10,760
I'd say that everything that 
brings the elixir into a 

895
01:12:10,760 --> 01:12:15,920
different direction then, or 
into a different space than what

896
01:12:15,920 --> 01:12:20,280
it was already present helps 
with adoption. 

897
01:12:20,600 --> 01:12:26,120
Yeah, absolutely. 
But I, I, I do think that we, we

898
01:12:26,120 --> 01:12:31,640
need to have that. 
We need to think about 

899
01:12:31,640 --> 01:12:35,280
documentation. 
It's not just documenting for 

900
01:12:35,520 --> 01:12:38,120
other Elixir people. 
We need to be able to document 

901
01:12:38,120 --> 01:12:42,680
for people that know the thing 
but don't know Elixir as well. 

902
01:12:43,840 --> 01:12:46,640
I think you need the two, the 
two pillars. 

903
01:12:46,640 --> 01:12:49,480
You need the to have the. 
Documentation and the like. 

904
01:12:49,560 --> 01:12:55,080
Adoption Guides. 
Yeah, maybe that's one way to 

905
01:12:55,240 --> 01:12:59,840
think about that. 
Like, you already know machine 

906
01:12:59,840 --> 01:13:01,840
learning, right? 
But you're coming from Python, 

907
01:13:01,840 --> 01:13:04,640
so here's your adoption guide 
for Elixir. 

908
01:13:05,200 --> 01:13:11,000
Yeah, maybe a CHEAT SHEET 
between numpy, pythorch and an 

909
01:13:11,000 --> 01:13:12,800
X, Yeah. 
Exactly. 

910
01:13:15,040 --> 01:13:16,840
Yeah, that's the hardest part, 
right? 

911
01:13:17,400 --> 01:13:23,080
Adoption, bringing people over 
because I, I mean, I'm a good 

912
01:13:23,080 --> 01:13:25,000
example. 
I had a buddy telling him, 

913
01:13:25,200 --> 01:13:28,800
telling me to check out Elixir 
for like, I want to say like 

914
01:13:28,800 --> 01:13:32,920
four years before I even checked
out Elixir because you're just 

915
01:13:32,920 --> 01:13:36,000
busy learning whatever you're 
currently doing. 

916
01:13:36,000 --> 01:13:41,040
Like I was, you know, head down 
just node JS world and I didn't 

917
01:13:41,040 --> 01:13:43,280
have time. 
And then when I finally made the

918
01:13:43,280 --> 01:13:47,120
time, then I didn't want to 
touch JavaScript anymore. 

919
01:13:52,080 --> 01:13:56,720
Yeah, I mean, comparing to 
JavaScript, it's pretty easy to 

920
01:13:56,720 --> 01:13:58,720
choose. 
Yeah, I agree. 

921
01:14:01,120 --> 01:14:06,800
No brainer, right? 
Yeah, but this was awesome. 

922
01:14:06,920 --> 01:14:11,120
I feel like I have to like 
absorb our conversation for the 

923
01:14:11,120 --> 01:14:16,840
next like day or four days. 
I feel like I learned a lot, but

924
01:14:18,160 --> 01:14:21,320
it was awesome chatting. 
Paulo, I really appreciate your 

925
01:14:21,320 --> 01:14:25,160
time and you're always welcome 
to come back on and we can talk 

926
01:14:25,160 --> 01:14:29,880
about this stuff more. 
And hopefully over the next year

927
01:14:29,880 --> 01:14:34,600
or so, I become a little more 
acclimated to the NX and machine

928
01:14:34,600 --> 01:14:38,120
learning world because I am 
starting to make it a priority 

929
01:14:38,120 --> 01:14:39,320
because. 
It's. 

930
01:14:39,840 --> 01:14:42,040
A lot of cool stuff is happening
in this space. 

931
01:14:43,200 --> 01:14:47,160
Yeah, and lots more to come. 
There are lots of things that we

932
01:14:47,160 --> 01:14:49,320
didn't discuss as well. 
Yeah. 

933
01:14:49,560 --> 01:14:54,960
So hey, it's a pretty, pretty 
interesting space. 

934
01:14:55,480 --> 01:14:58,120
There's a lot going on. 
You're a smart dude and I 

935
01:14:58,120 --> 01:15:01,800
appreciate your time. 
Oh, thank you so much. 

936
01:15:02,560 --> 01:15:04,960
Yeah. 
All right, if you guys need to 

937
01:15:04,960 --> 01:15:09,960
find Paulo, I have all the links
in the description on at least I

938
01:15:09,960 --> 01:15:14,000
don't think X has descriptions, 
but on YouTube and on twitch 

939
01:15:14,000 --> 01:15:20,160
you'll find his his Twitter 
handle and GitHub and all that 

940
01:15:20,160 --> 01:15:23,920
good stuff. 
So definitely check him out and 

941
01:15:23,920 --> 01:15:29,640
I noticed also that the NX 
project is looking for like 

942
01:15:29,640 --> 01:15:34,160
supporters and donations. 
So if you guys Ken, that would 

943
01:15:34,160 --> 01:15:36,720
be a great place to do it 
because it's a really awesome 

944
01:15:36,720 --> 01:15:40,080
project. 
So make sure you guys check out 

945
01:15:40,080 --> 01:15:44,520
Paulo and follow him on Are you 
on Twitter and Blue Sky? 

946
01:15:44,520 --> 01:15:46,640
You're on both, right? 
Yeah, I'm on both. 

947
01:15:46,880 --> 01:15:48,960
OK, cool. 
So make sure you guys give him a

948
01:15:48,960 --> 01:15:52,240
follow and I hope you have a 
good weekend, man. 

949
01:15:52,240 --> 01:15:58,360
Thank you so much Testing.
