實際影片長度:12:44.000。原文、繁中、雙語可點擊句子跳轉影片。
0:00.000–0:01.267
enHi guys, welcome back.
0:01.540–0:02.665
enIn this video,
0:02.665–0:04.447
enwe'll be talking about
0:04.447–0:06.134
enhow you can run a QN 3.8
0:06.134–0:07.822
en27 billion parameter
0:07.822–0:09.603
enmodel in an Apple M4 Mac
0:09.603–0:11.385
enMini machine with just
0:11.385–0:13.260
en24 GB of unified memory.
0:13.260–0:15.013
enWe know that QN 3.8 27
0:15.013–0:17.179
enbillion parameter model
0:17.179–0:19.860
enwill be of at least 15 GB of size.
0:19.860–0:21.918
enand loading the entire
0:21.918–0:23.760
enmodel in the unified
0:23.760–0:25.602
enmemory will not only
0:25.602–0:27.660
enload the model but also
0:27.660–0:29.098
enloads the kvcache
0:29.098–0:30.631
enruntime and the mac
0:30.631–0:32.356
enoperating system all
0:32.356–0:35.040
entogether and while you load all of
0:35.040–0:36.568
enthem in the vram it is
0:36.568–0:38.365
endefinitely going to hit
0:38.365–0:40.073
enthe memory ceiling for
0:40.073–0:41.780
enyou and it is going to be
0:41.780–0:43.280
engetting you the out of
0:43.280–0:44.947
enmemory exception so how
0:44.947–0:46.447
encan we even handle the
0:46.447–0:48.280
ensituation of these kind of
0:48.280–0:49.935
enmemory problem and can
0:49.935–0:51.415
enwe even run a QUEN 3.8
0:51.415–0:52.983
en27 billion parameter
0:52.983–0:55.160
enmodel in this machine and is it
0:55.160–0:56.689
enjust the problem with
0:56.689–0:58.218
enthe model itself or is
0:58.218–0:59.831
enit the problem with the
0:59.831–1:01.700
enquantization that we have
1:01.700–1:03.178
enbut what if we have a
1:03.178–1:05.117
enquantization of the same
1:05.117–1:06.779
enexact model with just
1:06.779–1:09.180
entwo-bit quantization instead
1:09.180–1:10.413
enof the four-bit
1:10.413–1:12.311
enquantization can we run
1:12.311–1:14.208
enthat at all well welcome
1:14.208–1:16.580
ento the QUEN model quantized to
1:16.580–1:19.263
en2-bit called as the
1:19.263–1:22.617
enQEN3.827BGSQRCOIQ2QS
1:22.617–1:25.971
enmodel and this model can
1:25.971–1:29.660
enload in the 24GB of unified
1:29.660–1:32.460
enmachine and it can support a full GPU
1:32.460–1:34.327
enoffloading as well as it
1:34.327–1:35.633
enhas multi-token
1:35.633–1:37.220
enprediction enabled
1:37.220–1:39.443
enas well and this model
1:39.443–1:41.418
encan easily fit in an
1:41.418–1:43.888
enApple M4 machine of 24GB
1:43.888–1:45.740
enof unified memory
1:45.740–1:47.415
enwhich includes the model
1:47.415–1:49.010
enkv cache runtime and mac
1:49.010–1:50.764
enoperating system without
1:50.764–1:52.040
enhitting the memory
1:52.040–1:54.312
enceiling as well so it can easily load
1:54.312–1:55.525
eneverything for you
1:55.525–1:56.661
enwithin your apple
1:56.661–1:58.100
enmachine which is quite
1:58.100–1:59.300
enamazing so the memory
1:59.300–2:00.633
enrequirement is going to
2:00.633–2:01.900
enbe so much less because
2:01.900–2:03.500
enof the two-bit quantization
2:03.500–2:04.567
enthat you have got in
2:04.567–2:05.967
enthis particular model so
2:05.967–2:07.033
enhow exactly is this
2:07.033–2:09.080
enpossible will the quen 3.8 right
2:09.080–2:10.297
ennow will lose its
2:10.297–2:12.123
enintelligence ability or
2:12.123–2:13.601
enthe output will be of
2:13.601–2:15.600
enless quality or how exactly
2:15.600–2:16.911
enis this happening what
2:16.911–2:18.015
enexactly is this new
2:18.015–2:19.050
enmodel of a two-bit
2:19.050–2:21.120
enquantization well this particular
2:21.120–2:22.760
enquen model is a standard
2:22.760–2:24.317
enquen model but instead
2:24.317–2:25.711
enof applying the same
2:25.711–2:27.760
enquantization everywhere the
2:27.760–2:29.254
entechnique will determine
2:29.254–2:30.544
enwhich tensor deserves
2:30.544–2:31.970
enmore precision and which
2:31.970–2:33.600
encan tolerate the aggressive
2:33.600–2:34.733
encompression that's
2:34.733–2:35.733
enexactly what this
2:35.733–2:37.000
enparticular technique
2:37.000–2:38.333
endoes and what exactly is
2:38.333–2:39.200
enthis technique
2:39.200–2:40.600
enthat we're talking about
2:40.600–2:42.171
enthe gsq rco or otherwise
2:42.171–2:43.677
encalled as the gumbel
2:43.677–2:45.360
ensoftmax quantization
2:45.360–2:47.982
enwhich intelligently optimizes the
2:47.982–2:49.905
enquantization value while
2:49.905–2:52.440
enRCO intelligently decide where to
2:52.440–2:54.446
enallocate more or fewer
2:54.446–2:57.613
enbits across the models or tens are so
2:57.613–3:00.780
enessentially even if the model sizes
3:00.780–3:02.758
enis going to be reduced
3:02.758–3:04.845
enfrom the 16 bpw which is
3:04.845–3:07.043
ena 16-bit original model
3:07.043–3:09.240
ento a 2-bit quantization
3:09.240–3:10.978
enmodel it is going to be
3:10.978–3:12.812
enof almost 6.4 times of a
3:12.812–3:14.742
ensize lower but still the
3:14.742–3:16.480
enmodel is going to give
3:16.480–3:18.128
enyou an amazing precision
3:18.128–3:19.462
enover here that is the
3:19.462–3:21.110
enpower of this particular
3:21.110–3:22.680
enmodel itself and that's
3:22.680–3:23.869
enthe reason why even
3:23.869–3:25.206
enthough the size of the
3:25.206–3:26.691
enmodel is so much smaller
3:26.691–3:28.400
enthe quality of the output is
3:28.400–3:29.908
enstill going to be way
3:29.908–3:31.504
enmore same like how you
3:31.504–3:32.746
encan expect with a
3:32.746–3:35.140
enquantization 4 model of the same
3:35.140–3:36.340
enQN model that you have
3:36.340–3:37.673
engot that's exactly what
3:37.673–3:39.073
enthis particular model is
3:39.073–3:40.273
enand we are going to see
3:40.273–3:42.307
enin this particular video
3:42.307–3:44.439
enhow we can run the same
3:44.439–3:46.690
enexact QN 2-bit model in
3:46.690–3:48.940
enthe Mac Mini M4 machine
3:48.940–3:50.693
enand we're also going to
3:50.693–3:52.446
ensee how fast it is going
3:52.446–3:53.553
ento be doing the
3:53.553–3:55.860
eninferencing for us and what it
3:55.860–3:57.225
enmeans with different
3:57.225–3:58.514
ensizes of the KV cache
3:58.514–3:59.803
enadjustment that I'm
3:59.803–4:01.320
engoing to be doing in this
4:01.320–4:02.958
enparticular video and i
4:02.958–4:04.510
enwill show you how it is
4:04.510–4:06.062
engoing to be affecting
4:06.062–4:07.700
enthe the speed as well as
4:07.700–4:09.068
enthe number of tokens per
4:09.068–4:10.162
ensecond as well so in
4:10.162–4:11.599
enthis particular video we
4:11.599–4:13.240
enare going to see which kv size
4:13.240–4:14.736
enor which kv cache is
4:14.736–4:16.513
engoing to be faster like
4:16.513–4:18.103
en16 bit or 4 bit or 8 bit
4:18.103–4:20.160
enquantization and which is
4:20.160–4:21.531
engoing to take more time
4:21.531–4:22.758
enand what is the total
4:22.758–4:23.985
ennumber of tokens per
4:23.985–4:25.500
ensecond that you are going
4:25.500–4:26.633
ento be getting uh with
4:26.633–4:27.700
endifferent kinds of
4:27.700–4:28.900
ensettings that you are
4:28.900–4:30.700
engoing to be doing in the lm studio
4:30.700–4:31.900
enand one more time this
4:31.900–4:33.160
enparticular model is
4:33.160–4:34.657
enactually not available
4:34.657–4:35.780
enin the mlx format i
4:35.780–4:37.113
enunfortunately have got
4:37.113–4:38.380
enonly the ggf format and
4:38.380–4:39.647
eni am going to be running
4:39.647–4:40.913
enthis particular model
4:40.913–4:42.047
enin the lm studio and i
4:42.047–4:43.180
enwill show you how the
4:43.180–4:44.527
entps is going to be for
4:44.527–4:46.520
enthe different kv cache that we
4:46.520–4:47.853
enare going to be setting
4:47.853–4:49.957
enand running it but you know what this
4:49.957–4:51.780
enparticular model is not really
4:51.780–4:53.085
engoing to hit the out of
4:53.085–4:54.535
enmemory exception based
4:54.535–4:55.695
enon the different kv
4:55.695–4:57.580
encache setting you can actually
4:57.580–4:58.780
ensee that this model is
4:58.780–4:59.913
enactually going to be
4:59.913–5:01.180
enperformant as well and
5:01.180–5:02.513
enthis is the good news for
5:02.513–5:03.780
enthis particular model
5:03.780–5:05.047
enwell as that said let's
5:05.047–5:06.380
enstart doing the testing
5:06.380–5:07.913
enof the model with different
5:07.913–5:09.247
enquantization so you can
5:09.247–5:10.380
ensee that i have got my
5:10.380–5:11.447
enmac mini m4 machine
5:11.447–5:12.847
entotal number of physical
5:12.847–5:14.066
enthat you can see over
5:14.066–5:15.632
enhere is 24 gig and i'm
5:15.632–5:17.382
engoing to be loading the
5:17.382–5:19.500
enuh the quen model uh in the lm
5:19.500–5:21.790
enstudio and i'm going to
5:21.790–5:24.081
enset the context length
5:24.081–5:26.371
enover here uh to at least
5:26.371–5:28.300
enlike a 30 31 or 32 000
5:28.300–5:29.567
enuh over here and you can
5:29.567–5:30.633
ensee that this is the
5:30.633–5:31.767
enmaximum concurrent
5:31.767–5:33.433
enprediction or instead of four
5:33.433–5:34.700
eni'm going to be setting
5:34.700–5:35.900
enit to one because it's
5:35.900–5:37.233
engoing to be reducing the
5:37.233–5:38.433
entotal lump compute as
5:38.433–5:39.700
enwell and i'm also going
5:39.700–5:40.986
ento change the kv cache
5:40.986–5:43.146
enquantization type there
5:43.146–5:45.100
enso instead of using the
5:45.100–5:46.367
endefault i'm going to be
5:46.367–5:47.567
ensetting the fp16 this
5:47.567–5:48.833
entime and i'm going to be
5:48.833–5:50.567
enloading this particular model
5:50.567–5:51.900
enand the moment i'm going
5:51.900–5:53.233
ento load this particular
5:53.233–5:54.433
enmodel you can see that
5:54.433–5:55.900
enit is going to be consuming
5:55.900–5:57.100
enaround 20 gig or 21 gig
5:57.100–5:59.340
enof the total memory uh
5:59.340–6:01.700
enin my uh in my ram there
6:01.700–6:04.060
enand now i'm going to be
6:04.060–6:05.000
enrunning the the
6:05.000–6:06.301
enquestions over there
6:06.301–6:07.747
eninferencing it without
6:07.747–6:09.193
enthe thinking enabled so
6:09.193–6:10.060
enthe moment i'm
6:10.060–6:11.558
engoing to run let's say
6:11.558–6:13.223
enhi over here i'm getting
6:13.223–6:14.805
enaround 4.57 tokens per
6:14.805–6:16.220
ensecond and now if i'm
6:16.220–6:17.884
engoing to say again like
6:17.884–6:19.460
enhi again it is going to
6:19.460–6:20.774
engive me around 4.9
6:20.774–6:22.700
entokens per second this is a
6:22.700–6:23.967
endense model that we're
6:23.967–6:25.300
entalking about guys look
6:25.300–6:26.433
enat that and now if i'm
6:26.433–6:27.900
engoing to pass a long prompt
6:27.900–6:29.033
ento write a selenium c
6:29.033–6:30.375
ensharp dot net code for
6:30.375–6:32.099
engoogle search operation
6:32.099–6:33.660
enwith page object model
6:33.660–6:35.127
enand dependency injection
6:35.127–6:36.327
enand if i'm going to run
6:36.327–6:37.460
enit i'm going to start
6:37.460–6:38.793
enthe timer as well just in
6:38.793–6:40.060
encase and if i'm going to
6:40.060–6:41.127
enshow you the memory
6:41.127–6:42.460
enspike there you see that
6:42.460–6:43.927
enthe memory pressure is not
6:43.927–6:45.327
enincreasing because it's
6:45.327–6:46.660
ena two-bit quantization
6:46.660–6:47.793
enmodel and at the same
6:47.793–6:49.127
entime you can see that i'm
6:49.127–6:50.327
enactually getting the
6:50.327–6:51.527
enoutput over here it is
6:51.527–6:52.660
ennot as fast as you can
6:52.660–6:54.193
enimagine it is not super fast
6:54.193–6:55.393
enlike how we can expect
6:55.393–6:56.460
enwith a like an m5 max
6:56.460–6:57.727
enmachine but you can see
6:57.727–6:59.127
enthat within four minutes
6:59.127–7:00.700
eni got the output with a
7:00.700–7:02.558
en5.67 tokens per second
7:02.558–7:04.122
enthis is not bad to be
7:04.122–7:05.980
enhonest this is working
7:05.980–7:07.313
enit's not really hitting
7:07.313–7:08.647
enthat memory ceiling and
7:08.647–7:09.580
enif you try to run a
7:09.580–7:11.313
enfour-bit quantization this is
7:11.313–7:12.247
ennever going to be
7:12.247–7:13.580
enrunning for you and four
7:13.580–7:14.847
enminutes is not that bad
7:14.847–7:16.647
enat all now i'm going to change the
7:16.647–7:18.047
enquantization to uh eight
7:18.047–7:19.313
enjust the quantization
7:19.313–7:20.513
eneight there for the kv
7:20.513–7:21.913
encache alone and i'm going
7:21.913–7:22.913
ento be loading this
7:22.913–7:24.446
enparticular model and i'm
7:24.446–7:25.875
engoing to ask the same
7:25.875–7:28.060
enexact prompt there sending a hi
7:28.060–7:29.681
enmessage and i'm going to
7:29.681–7:31.301
ensay hi again i'm getting
7:31.301–7:32.922
en5.47 token and i'm going
7:32.922–7:34.380
ento send the same exact
7:34.380–7:35.768
enSedium code prompt and
7:35.768–7:37.083
enI'm going to start the
7:37.083–7:38.545
entimer over there you can
7:38.545–7:39.860
ensee that this time the
7:39.860–7:41.211
entime is going to be a
7:41.211–7:42.983
enbit higher than compared
7:42.983–7:44.418
ento the FP16 there the
7:44.418–7:46.360
enreason is because actually
7:46.360–7:47.895
enit's not that even if
7:47.895–7:49.430
enyou try to reduce the
7:49.430–7:51.326
enquantization the things
7:51.326–7:52.680
enwill be faster the
7:52.680–7:54.473
eninferencing will exactly
7:54.473–7:56.102
enbe the same exact tokens
7:56.102–7:57.569
enper second because it
7:57.569–7:59.280
enalso need to de-quantize
7:59.280–7:59.840
zh安安
8:02.400–8:05.900
zh然後它會不會有更快。
8:05.900–8:09.700
zh所以,它會不會有更快。
8:09.700–8:14.900
zh所以,它會不會有更快。
8:14.900–8:19.160
enthan compared to the FP16 for you over there.
8:19.260–8:20.043
enSee now,
8:20.043–8:23.960
enthis is going to be the FP4 that we have got.
8:24.060–8:25.260
enI'm going to be asking
8:25.260–8:26.660
enthe same exact question.
8:26.660–8:27.727
enThe total number of
8:27.727–8:29.060
entokens per second is not
8:29.060–8:29.993
enchanging at all.
8:29.993–8:31.193
enAnd now if I'm going to
8:31.193–8:33.060
enbe running the same exact prompt,
8:33.060–8:34.393
enthe Serenium WebDriver
8:34.393–8:35.793
enquestion over there with
8:35.793–8:37.260
enthe quantization 4 there,
8:37.260–8:38.860
eninstead of the 4.04 minutes,
8:38.860–8:40.940
enwhich was taking in FP16,
8:41.160–8:43.940
enit is 4.46 as you can see here.
8:43.940–8:44.740
enso based on the
8:44.740–8:46.073
enquantization change it
8:46.073–8:47.407
enis also obviously going
8:47.407–8:49.007
ento change the time over there
8:49.007–8:50.477
enso this proves the point
8:50.477–8:51.950
enthat the inferencing
8:51.950–8:53.505
enactually works even in
8:53.505–8:55.060
enLM studio for us and you
8:55.060–8:56.327
encan see that the output
8:56.327–8:57.660
enhas got no compromise as
8:57.660–8:58.860
enwell the output looks
8:58.860–9:00.193
enpretty much exactly the
9:00.193–9:01.393
ensame and I can see that
9:01.393–9:02.527
enit is still working I
9:02.527–9:03.727
enmean there is a change
9:03.727–9:04.993
enin the output of course
9:04.993–9:06.127
enin the web driver for
9:06.127–9:07.593
enthe dependency injection
9:07.593–9:08.927
enit's there over here but
9:08.927–9:10.193
enin here you can see that
9:10.193–9:11.660
enthe dependency injection
9:11.660–9:12.660
ensetup has got a bit
9:12.660–9:13.793
endifferent with like
9:13.793–9:15.327
endriver factory class there
9:15.327–9:16.193
enthat's the only
9:16.193–9:17.593
endifference between both
9:17.593–9:18.727
enof them but overall i
9:18.727–9:20.660
encan actually see that it is working
9:20.660–9:21.993
enpretty much as expected
9:21.993–9:23.127
enthe last test which i
9:23.127–9:24.260
enwanted to do with the
9:24.260–9:25.460
enfp16 of the same exact
9:25.460–9:26.727
enmodel is by connecting
9:26.727–9:27.864
ento a pi coding agent i
9:27.864–9:29.330
enwant to really see if
9:29.330–9:31.400
enthis is going to work or not so
9:31.400–9:33.152
eni have set the fp16 over
9:33.152–9:34.904
enhere i'm running it and
9:34.904–9:36.656
eni'm going to be opening
9:36.656–9:38.500
enthe pi coding agent over
9:38.500–9:39.705
enhere and i'm going to
9:39.705–9:41.052
enchoose the model as you
9:41.052–9:42.328
encan see i'm going to be
9:42.328–9:44.100
enchasing choosing that gsq rco
9:44.100–9:46.053
enunsloth mtp model there
9:46.053–9:47.909
enand i'm going to be just
9:47.909–9:49.569
ensaying hi over there
9:49.569–9:51.620
eneven for a high message it
9:51.620–9:53.143
enwas taking a long time
9:53.143–9:54.581
enit's not very fast as
9:54.581–9:56.104
enyou can imagine it was
9:56.104–9:57.880
entaking a long time and the
9:57.880–9:59.193
enoutput you can see that
9:59.193–10:00.505
enit is going to be giving
10:00.505–10:01.818
enyou very very slow here
10:01.818–10:03.200
enwhich is quite expected
10:03.200–10:04.515
enbecause this is a dense
10:04.515–10:05.623
enmodel and now i have
10:05.623–10:06.869
entold it to analyze the
10:06.869–10:08.600
encode for me in this particular
10:08.600–10:10.875
enrepository and that took
10:10.875–10:12.932
enme more than 27 minutes
10:12.932–10:15.099
enjust to analyze the code
10:15.099–10:16.940
eni mean it went so deep
10:16.940–10:18.207
ento be honest like going
10:18.207–10:19.473
enthrough each and every
10:19.473–10:20.473
enfile even start to
10:20.473–10:21.940
enfigure out what exactly is
10:21.940–10:22.940
enthe problem in the
10:22.940–10:24.073
enparticular code but
10:24.073–10:25.473
enactually took 27 minutes
10:25.473–10:27.073
ento give me the output which is
10:27.073–10:28.273
enwhat really happened
10:28.273–10:29.540
enover here as you can see
10:29.540–10:30.917
enso long story short you
10:30.917–10:32.940
encan run a two-bit quantization
10:32.940–10:34.659
enQUEN 3.8 27 billion
10:34.659–10:36.593
enparameter model in an
10:36.593–10:38.097
enapple m4 mac mini
10:38.097–10:41.320
enmachine without hitting the memory
10:41.320–10:43.035
enceiling but what is the
10:43.035–10:44.840
enactual technique which
10:44.840–10:46.104
enmakes the two big
10:46.104–10:48.360
enquantization which helps you
10:48.360–10:49.360
enrun in a mac mini m4
10:49.360–10:50.693
enmachine is actually the
10:50.693–10:51.827
enmost important part
10:51.827–10:53.627
enthat's the reason why i actually
10:53.627–10:54.627
enwanted to show you
10:54.627–10:56.027
enwhat's really happening
10:56.027–10:57.093
enover here and other
10:57.093–10:58.893
enthing is you may ask what happens
10:58.893–11:00.024
enif you try to run the
11:00.024–11:01.881
ensame exact model in the
11:01.881–11:03.543
enApple M5 Max machine
11:03.543–11:05.400
enright so I'm going to be
11:05.400–11:07.153
enloading the same exact
11:07.153–11:08.629
enmodel as you can see
11:08.629–11:10.382
enover here and I'm going
11:10.382–11:12.320
ento be doing an FP16 here as
11:12.320–11:13.833
enwell so FP16 Max current
11:13.833–11:15.271
enprediction is going to
11:15.271–11:16.708
enbe one as well I'm going
11:16.708–11:18.600
ento be loading this particular
11:18.600–11:19.800
enmodel and let's try to
11:19.800–11:20.800
enask the same exact
11:20.800–11:22.067
enquestion over here and
11:22.067–11:23.867
ensee how this is actually going to
11:23.867–11:25.920
zh在我的 Apple M5 Max machine
11:25.920–11:28.120
zh所以这个是128GB machine
11:28.120–11:29.360
zh所以你可能会被担心
11:29.360–11:31.000
zh要是转买它快速
11:31.000–11:32.160
zh你会被担心
11:32.160–11:34.120
zh要是100兆兆的
11:34.120–11:35.400
zh如果我会被担心
11:35.400–11:36.720
zh但如果我会被担心
11:36.720–11:39.000
zh同样的同样
11:39.000–11:40.320
zh在这个机器
11:40.320–11:42.600
zh你能看到它是
11:42.600–11:45.600
zh连接到27兆兆的
11:45.600–11:48.320
zh它是127兆兆的
11:48.320–11:49.960
zh所以它试试了
11:49.960–11:51.783
enpoint that it's not just
11:51.783–11:53.150
enabout the two-bit
11:53.150–11:55.155
enquantization model which
11:55.155–11:56.340
encan run way more
11:56.340–11:57.861
enfaster in an apple m5
11:57.861–11:59.741
enmax machine because it's
11:59.741–12:01.351
eneven running in the m4
12:01.351–12:03.320
enmini machine but the thing
12:03.320–12:04.602
enis even though it is a
12:04.602–12:06.260
entwo-bit quantization the
12:06.260–12:07.617
enquality of the output
12:07.617–12:09.200
enstill remains and that's
12:09.200–12:10.556
enthe reason the the
12:10.556–12:12.363
entechnique of the gsq rco
12:12.363–12:13.809
ensits in so it safely
12:13.809–12:16.340
enchooses the best tensor which can
0:00.000–0:01.267
Hi guys, welcome back.
0:01.540–0:02.665
In this video,
0:02.665–0:04.447
we'll be talking about
0:04.447–0:06.134
how you can run a QN 3.8
0:06.134–0:07.822
27 billion parameter
0:07.822–0:09.603
model in an Apple M4 Mac
0:09.603–0:11.385
Mini machine with just
0:11.385–0:13.260
24 GB of unified memory.
0:13.260–0:15.013
We know that QN 3.8 27
0:15.013–0:17.179
billion parameter model
0:17.179–0:19.860
will be of at least 15 GB of size.
0:19.860–0:21.918
and loading the entire
0:21.918–0:23.760
model in the unified
0:23.760–0:25.602
memory will not only
0:25.602–0:27.660
load the model but also
0:27.660–0:29.098
loads the kvcache
0:29.098–0:30.631
runtime and the mac
0:30.631–0:32.356
operating system all
0:32.356–0:35.040
together and while you load all of
0:35.040–0:36.568
them in the vram it is
0:36.568–0:38.365
definitely going to hit
0:38.365–0:40.073
the memory ceiling for
0:40.073–0:41.780
you and it is going to be
0:41.780–0:43.280
getting you the out of
0:43.280–0:44.947
memory exception so how
0:44.947–0:46.447
can we even handle the
0:46.447–0:48.280
situation of these kind of
0:48.280–0:49.935
memory problem and can
0:49.935–0:51.415
we even run a QUEN 3.8
0:51.415–0:52.983
27 billion parameter
0:52.983–0:55.160
model in this machine and is it
0:55.160–0:56.689
just the problem with
0:56.689–0:58.218
the model itself or is
0:58.218–0:59.831
it the problem with the
0:59.831–1:01.700
quantization that we have
1:01.700–1:03.178
but what if we have a
1:03.178–1:05.117
quantization of the same
1:05.117–1:06.779
exact model with just
1:06.779–1:09.180
two-bit quantization instead
1:09.180–1:10.413
of the four-bit
1:10.413–1:12.311
quantization can we run
1:12.311–1:14.208
that at all well welcome
1:14.208–1:16.580
to the QUEN model quantized to
1:16.580–1:19.263
2-bit called as the
1:19.263–1:22.617
QEN3.827BGSQRCOIQ2QS
1:22.617–1:25.971
model and this model can
1:25.971–1:29.660
load in the 24GB of unified
1:29.660–1:32.460
machine and it can support a full GPU
1:32.460–1:34.327
offloading as well as it
1:34.327–1:35.633
has multi-token
1:35.633–1:37.220
prediction enabled
1:37.220–1:39.443
as well and this model
1:39.443–1:41.418
can easily fit in an
1:41.418–1:43.888
Apple M4 machine of 24GB
1:43.888–1:45.740
of unified memory
1:45.740–1:47.415
which includes the model
1:47.415–1:49.010
kv cache runtime and mac
1:49.010–1:50.764
operating system without
1:50.764–1:52.040
hitting the memory
1:52.040–1:54.312
ceiling as well so it can easily load
1:54.312–1:55.525
everything for you
1:55.525–1:56.661
within your apple
1:56.661–1:58.100
machine which is quite
1:58.100–1:59.300
amazing so the memory
1:59.300–2:00.633
requirement is going to
2:00.633–2:01.900
be so much less because
2:01.900–2:03.500
of the two-bit quantization
2:03.500–2:04.567
that you have got in
2:04.567–2:05.967
this particular model so
2:05.967–2:07.033
how exactly is this
2:07.033–2:09.080
possible will the quen 3.8 right
2:09.080–2:10.297
now will lose its
2:10.297–2:12.123
intelligence ability or
2:12.123–2:13.601
the output will be of
2:13.601–2:15.600
less quality or how exactly
2:15.600–2:16.911
is this happening what
2:16.911–2:18.015
exactly is this new
2:18.015–2:19.050
model of a two-bit
2:19.050–2:21.120
quantization well this particular
2:21.120–2:22.760
quen model is a standard
2:22.760–2:24.317
quen model but instead
2:24.317–2:25.711
of applying the same
2:25.711–2:27.760
quantization everywhere the
2:27.760–2:29.254
technique will determine
2:29.254–2:30.544
which tensor deserves
2:30.544–2:31.970
more precision and which
2:31.970–2:33.600
can tolerate the aggressive
2:33.600–2:34.733
compression that's
2:34.733–2:35.733
exactly what this
2:35.733–2:37.000
particular technique
2:37.000–2:38.333
does and what exactly is
2:38.333–2:39.200
this technique
2:39.200–2:40.600
that we're talking about
2:40.600–2:42.171
the gsq rco or otherwise
2:42.171–2:43.677
called as the gumbel
2:43.677–2:45.360
softmax quantization
2:45.360–2:47.982
which intelligently optimizes the
2:47.982–2:49.905
quantization value while
2:49.905–2:52.440
RCO intelligently decide where to
2:52.440–2:54.446
allocate more or fewer
2:54.446–2:57.613
bits across the models or tens are so
2:57.613–3:00.780
essentially even if the model sizes
3:00.780–3:02.758
is going to be reduced
3:02.758–3:04.845
from the 16 bpw which is
3:04.845–3:07.043
a 16-bit original model
3:07.043–3:09.240
to a 2-bit quantization
3:09.240–3:10.978
model it is going to be
3:10.978–3:12.812
of almost 6.4 times of a
3:12.812–3:14.742
size lower but still the
3:14.742–3:16.480
model is going to give
3:16.480–3:18.128
you an amazing precision
3:18.128–3:19.462
over here that is the
3:19.462–3:21.110
power of this particular
3:21.110–3:22.680
model itself and that's
3:22.680–3:23.869
the reason why even
3:23.869–3:25.206
though the size of the
3:25.206–3:26.691
model is so much smaller
3:26.691–3:28.400
the quality of the output is
3:28.400–3:29.908
still going to be way
3:29.908–3:31.504
more same like how you
3:31.504–3:32.746
can expect with a
3:32.746–3:35.140
quantization 4 model of the same
3:35.140–3:36.340
QN model that you have
3:36.340–3:37.673
got that's exactly what
3:37.673–3:39.073
this particular model is
3:39.073–3:40.273
and we are going to see
3:40.273–3:42.307
in this particular video
3:42.307–3:44.439
how we can run the same
3:44.439–3:46.690
exact QN 2-bit model in
3:46.690–3:48.940
the Mac Mini M4 machine
3:48.940–3:50.693
and we're also going to
3:50.693–3:52.446
see how fast it is going
3:52.446–3:53.553
to be doing the
3:53.553–3:55.860
inferencing for us and what it
3:55.860–3:57.225
means with different
3:57.225–3:58.514
sizes of the KV cache
3:58.514–3:59.803
adjustment that I'm
3:59.803–4:01.320
going to be doing in this
4:01.320–4:02.958
particular video and i
4:02.958–4:04.510
will show you how it is
4:04.510–4:06.062
going to be affecting
4:06.062–4:07.700
the the speed as well as
4:07.700–4:09.068
the number of tokens per
4:09.068–4:10.162
second as well so in
4:10.162–4:11.599
this particular video we
4:11.599–4:13.240
are going to see which kv size
4:13.240–4:14.736
or which kv cache is
4:14.736–4:16.513
going to be faster like
4:16.513–4:18.103
16 bit or 4 bit or 8 bit
4:18.103–4:20.160
quantization and which is
4:20.160–4:21.531
going to take more time
4:21.531–4:22.758
and what is the total
4:22.758–4:23.985
number of tokens per
4:23.985–4:25.500
second that you are going
4:25.500–4:26.633
to be getting uh with
4:26.633–4:27.700
different kinds of
4:27.700–4:28.900
settings that you are
4:28.900–4:30.700
going to be doing in the lm studio
4:30.700–4:31.900
and one more time this
4:31.900–4:33.160
particular model is
4:33.160–4:34.657
actually not available
4:34.657–4:35.780
in the mlx format i
4:35.780–4:37.113
unfortunately have got
4:37.113–4:38.380
only the ggf format and
4:38.380–4:39.647
i am going to be running
4:39.647–4:40.913
this particular model
4:40.913–4:42.047
in the lm studio and i
4:42.047–4:43.180
will show you how the
4:43.180–4:44.527
tps is going to be for
4:44.527–4:46.520
the different kv cache that we
4:46.520–4:47.853
are going to be setting
4:47.853–4:49.957
and running it but you know what this
4:49.957–4:51.780
particular model is not really
4:51.780–4:53.085
going to hit the out of
4:53.085–4:54.535
memory exception based
4:54.535–4:55.695
on the different kv
4:55.695–4:57.580
cache setting you can actually
4:57.580–4:58.780
see that this model is
4:58.780–4:59.913
actually going to be
4:59.913–5:01.180
performant as well and
5:01.180–5:02.513
this is the good news for
5:02.513–5:03.780
this particular model
5:03.780–5:05.047
well as that said let's
5:05.047–5:06.380
start doing the testing
5:06.380–5:07.913
of the model with different
5:07.913–5:09.247
quantization so you can
5:09.247–5:10.380
see that i have got my
5:10.380–5:11.447
mac mini m4 machine
5:11.447–5:12.847
total number of physical
5:12.847–5:14.066
that you can see over
5:14.066–5:15.632
here is 24 gig and i'm
5:15.632–5:17.382
going to be loading the
5:17.382–5:19.500
uh the quen model uh in the lm
5:19.500–5:21.790
studio and i'm going to
5:21.790–5:24.081
set the context length
5:24.081–5:26.371
over here uh to at least
5:26.371–5:28.300
like a 30 31 or 32 000
5:28.300–5:29.567
uh over here and you can
5:29.567–5:30.633
see that this is the
5:30.633–5:31.767
maximum concurrent
5:31.767–5:33.433
prediction or instead of four
5:33.433–5:34.700
i'm going to be setting
5:34.700–5:35.900
it to one because it's
5:35.900–5:37.233
going to be reducing the
5:37.233–5:38.433
total lump compute as
5:38.433–5:39.700
well and i'm also going
5:39.700–5:40.986
to change the kv cache
5:40.986–5:43.146
quantization type there
5:43.146–5:45.100
so instead of using the
5:45.100–5:46.367
default i'm going to be
5:46.367–5:47.567
setting the fp16 this
5:47.567–5:48.833
time and i'm going to be
5:48.833–5:50.567
loading this particular model
5:50.567–5:51.900
and the moment i'm going
5:51.900–5:53.233
to load this particular
5:53.233–5:54.433
model you can see that
5:54.433–5:55.900
it is going to be consuming
5:55.900–5:57.100
around 20 gig or 21 gig
5:57.100–5:59.340
of the total memory uh
5:59.340–6:01.700
in my uh in my ram there
6:01.700–6:04.060
and now i'm going to be
6:04.060–6:05.000
running the the
6:05.000–6:06.301
questions over there
6:06.301–6:07.747
inferencing it without
6:07.747–6:09.193
the thinking enabled so
6:09.193–6:10.060
the moment i'm
6:10.060–6:11.558
going to run let's say
6:11.558–6:13.223
hi over here i'm getting
6:13.223–6:14.805
around 4.57 tokens per
6:14.805–6:16.220
second and now if i'm
6:16.220–6:17.884
going to say again like
6:17.884–6:19.460
hi again it is going to
6:19.460–6:20.774
give me around 4.9
6:20.774–6:22.700
tokens per second this is a
6:22.700–6:23.967
dense model that we're
6:23.967–6:25.300
talking about guys look
6:25.300–6:26.433
at that and now if i'm
6:26.433–6:27.900
going to pass a long prompt
6:27.900–6:29.033
to write a selenium c
6:29.033–6:30.375
sharp dot net code for
6:30.375–6:32.099
google search operation
6:32.099–6:33.660
with page object model
6:33.660–6:35.127
and dependency injection
6:35.127–6:36.327
and if i'm going to run
6:36.327–6:37.460
it i'm going to start
6:37.460–6:38.793
the timer as well just in
6:38.793–6:40.060
case and if i'm going to
6:40.060–6:41.127
show you the memory
6:41.127–6:42.460
spike there you see that
6:42.460–6:43.927
the memory pressure is not
6:43.927–6:45.327
increasing because it's
6:45.327–6:46.660
a two-bit quantization
6:46.660–6:47.793
model and at the same
6:47.793–6:49.127
time you can see that i'm
6:49.127–6:50.327
actually getting the
6:50.327–6:51.527
output over here it is
6:51.527–6:52.660
not as fast as you can
6:52.660–6:54.193
imagine it is not super fast
6:54.193–6:55.393
like how we can expect
6:55.393–6:56.460
with a like an m5 max
6:56.460–6:57.727
machine but you can see
6:57.727–6:59.127
that within four minutes
6:59.127–7:00.700
i got the output with a
7:00.700–7:02.558
5.67 tokens per second
7:02.558–7:04.122
this is not bad to be
7:04.122–7:05.980
honest this is working
7:05.980–7:07.313
it's not really hitting
7:07.313–7:08.647
that memory ceiling and
7:08.647–7:09.580
if you try to run a
7:09.580–7:11.313
four-bit quantization this is
7:11.313–7:12.247
never going to be
7:12.247–7:13.580
running for you and four
7:13.580–7:14.847
minutes is not that bad
7:14.847–7:16.647
at all now i'm going to change the
7:16.647–7:18.047
quantization to uh eight
7:18.047–7:19.313
just the quantization
7:19.313–7:20.513
eight there for the kv
7:20.513–7:21.913
cache alone and i'm going
7:21.913–7:22.913
to be loading this
7:22.913–7:24.446
particular model and i'm
7:24.446–7:25.875
going to ask the same
7:25.875–7:28.060
exact prompt there sending a hi
7:28.060–7:29.681
message and i'm going to
7:29.681–7:31.301
say hi again i'm getting
7:31.301–7:32.922
5.47 token and i'm going
7:32.922–7:34.380
to send the same exact
7:34.380–7:35.768
Sedium code prompt and
7:35.768–7:37.083
I'm going to start the
7:37.083–7:38.545
timer over there you can
7:38.545–7:39.860
see that this time the
7:39.860–7:41.211
time is going to be a
7:41.211–7:42.983
bit higher than compared
7:42.983–7:44.418
to the FP16 there the
7:44.418–7:46.360
reason is because actually
7:46.360–7:47.895
it's not that even if
7:47.895–7:49.430
you try to reduce the
7:49.430–7:51.326
quantization the things
7:51.326–7:52.680
will be faster the
7:52.680–7:54.473
inferencing will exactly
7:54.473–7:56.102
be the same exact tokens
7:56.102–7:57.569
per second because it
7:57.569–7:59.280
also need to de-quantize
7:59.280–7:59.840
安安
8:02.400–8:05.900
然後它會不會有更快。
8:05.900–8:09.700
所以,它會不會有更快。
8:09.700–8:14.900
所以,它會不會有更快。
8:14.900–8:19.160
than compared to the FP16 for you over there.
8:19.260–8:20.043
See now,
8:20.043–8:23.960
this is going to be the FP4 that we have got.
8:24.060–8:25.260
I'm going to be asking
8:25.260–8:26.660
the same exact question.
8:26.660–8:27.727
The total number of
8:27.727–8:29.060
tokens per second is not
8:29.060–8:29.993
changing at all.
8:29.993–8:31.193
And now if I'm going to
8:31.193–8:33.060
be running the same exact prompt,
8:33.060–8:34.393
the Serenium WebDriver
8:34.393–8:35.793
question over there with
8:35.793–8:37.260
the quantization 4 there,
8:37.260–8:38.860
instead of the 4.04 minutes,
8:38.860–8:40.940
which was taking in FP16,
8:41.160–8:43.940
it is 4.46 as you can see here.
8:43.940–8:44.740
so based on the
8:44.740–8:46.073
quantization change it
8:46.073–8:47.407
is also obviously going
8:47.407–8:49.007
to change the time over there
8:49.007–8:50.477
so this proves the point
8:50.477–8:51.950
that the inferencing
8:51.950–8:53.505
actually works even in
8:53.505–8:55.060
LM studio for us and you
8:55.060–8:56.327
can see that the output
8:56.327–8:57.660
has got no compromise as
8:57.660–8:58.860
well the output looks
8:58.860–9:00.193
pretty much exactly the
9:00.193–9:01.393
same and I can see that
9:01.393–9:02.527
it is still working I
9:02.527–9:03.727
mean there is a change
9:03.727–9:04.993
in the output of course
9:04.993–9:06.127
in the web driver for
9:06.127–9:07.593
the dependency injection
9:07.593–9:08.927
it's there over here but
9:08.927–9:10.193
in here you can see that
9:10.193–9:11.660
the dependency injection
9:11.660–9:12.660
setup has got a bit
9:12.660–9:13.793
different with like
9:13.793–9:15.327
driver factory class there
9:15.327–9:16.193
that's the only
9:16.193–9:17.593
difference between both
9:17.593–9:18.727
of them but overall i
9:18.727–9:20.660
can actually see that it is working
9:20.660–9:21.993
pretty much as expected
9:21.993–9:23.127
the last test which i
9:23.127–9:24.260
wanted to do with the
9:24.260–9:25.460
fp16 of the same exact
9:25.460–9:26.727
model is by connecting
9:26.727–9:27.864
to a pi coding agent i
9:27.864–9:29.330
want to really see if
9:29.330–9:31.400
this is going to work or not so
9:31.400–9:33.152
i have set the fp16 over
9:33.152–9:34.904
here i'm running it and
9:34.904–9:36.656
i'm going to be opening
9:36.656–9:38.500
the pi coding agent over
9:38.500–9:39.705
here and i'm going to
9:39.705–9:41.052
choose the model as you
9:41.052–9:42.328
can see i'm going to be
9:42.328–9:44.100
chasing choosing that gsq rco
9:44.100–9:46.053
unsloth mtp model there
9:46.053–9:47.909
and i'm going to be just
9:47.909–9:49.569
saying hi over there
9:49.569–9:51.620
even for a high message it
9:51.620–9:53.143
was taking a long time
9:53.143–9:54.581
it's not very fast as
9:54.581–9:56.104
you can imagine it was
9:56.104–9:57.880
taking a long time and the
9:57.880–9:59.193
output you can see that
9:59.193–10:00.505
it is going to be giving
10:00.505–10:01.818
you very very slow here
10:01.818–10:03.200
which is quite expected
10:03.200–10:04.515
because this is a dense
10:04.515–10:05.623
model and now i have
10:05.623–10:06.869
told it to analyze the
10:06.869–10:08.600
code for me in this particular
10:08.600–10:10.875
repository and that took
10:10.875–10:12.932
me more than 27 minutes
10:12.932–10:15.099
just to analyze the code
10:15.099–10:16.940
i mean it went so deep
10:16.940–10:18.207
to be honest like going
10:18.207–10:19.473
through each and every
10:19.473–10:20.473
file even start to
10:20.473–10:21.940
figure out what exactly is
10:21.940–10:22.940
the problem in the
10:22.940–10:24.073
particular code but
10:24.073–10:25.473
actually took 27 minutes
10:25.473–10:27.073
to give me the output which is
10:27.073–10:28.273
what really happened
10:28.273–10:29.540
over here as you can see
10:29.540–10:30.917
so long story short you
10:30.917–10:32.940
can run a two-bit quantization
10:32.940–10:34.659
QUEN 3.8 27 billion
10:34.659–10:36.593
parameter model in an
10:36.593–10:38.097
apple m4 mac mini
10:38.097–10:41.320
machine without hitting the memory
10:41.320–10:43.035
ceiling but what is the
10:43.035–10:44.840
actual technique which
10:44.840–10:46.104
makes the two big
10:46.104–10:48.360
quantization which helps you
10:48.360–10:49.360
run in a mac mini m4
10:49.360–10:50.693
machine is actually the
10:50.693–10:51.827
most important part
10:51.827–10:53.627
that's the reason why i actually
10:53.627–10:54.627
wanted to show you
10:54.627–10:56.027
what's really happening
10:56.027–10:57.093
over here and other
10:57.093–10:58.893
thing is you may ask what happens
10:58.893–11:00.024
if you try to run the
11:00.024–11:01.881
same exact model in the
11:01.881–11:03.543
Apple M5 Max machine
11:03.543–11:05.400
right so I'm going to be
11:05.400–11:07.153
loading the same exact
11:07.153–11:08.629
model as you can see
11:08.629–11:10.382
over here and I'm going
11:10.382–11:12.320
to be doing an FP16 here as
11:12.320–11:13.833
well so FP16 Max current
11:13.833–11:15.271
prediction is going to
11:15.271–11:16.708
be one as well I'm going
11:16.708–11:18.600
to be loading this particular
11:18.600–11:19.800
model and let's try to
11:19.800–11:20.800
ask the same exact
11:20.800–11:22.067
question over here and
11:22.067–11:23.867
see how this is actually going to
11:23.867–11:25.920
在我的 Apple M5 Max machine
11:25.920–11:28.120
所以这个是128GB machine
11:28.120–11:29.360
所以你可能会被担心
11:29.360–11:31.000
要是转买它快速
11:31.000–11:32.160
你会被担心
11:32.160–11:34.120
要是100兆兆的
11:34.120–11:35.400
如果我会被担心
11:35.400–11:36.720
但如果我会被担心
11:36.720–11:39.000
同样的同样
11:39.000–11:40.320
在这个机器
11:40.320–11:42.600
你能看到它是
11:42.600–11:45.600
连接到27兆兆的
11:45.600–11:48.320
它是127兆兆的
11:48.320–11:49.960
所以它试试了
11:49.960–11:51.783
point that it's not just
11:51.783–11:53.150
about the two-bit
11:53.150–11:55.155
quantization model which
11:55.155–11:56.340
can run way more
11:56.340–11:57.861
faster in an apple m5
11:57.861–11:59.741
max machine because it's
11:59.741–12:01.351
even running in the m4
12:01.351–12:03.320
mini machine but the thing
12:03.320–12:04.602
is even though it is a
12:04.602–12:06.260
two-bit quantization the
12:06.260–12:07.617
quality of the output
12:07.617–12:09.200
still remains and that's
12:09.200–12:10.556
the reason the the
12:10.556–12:12.363
technique of the gsq rco
12:12.363–12:13.809
sits in so it safely
12:13.809–12:16.340
chooses the best tensor which can
0:00.000–0:01.267
enHi guys, welcome back.
Hi guys, welcome back.
0:01.540–0:02.665
enIn this video,
In this video,
0:02.665–0:04.447
enwe'll be talking about
we'll be talking about
0:04.447–0:06.134
enhow you can run a QN 3.8
how you can run a QN 3.8
0:06.134–0:07.822
en27 billion parameter
27 billion parameter
0:07.822–0:09.603
enmodel in an Apple M4 Mac
model in an Apple M4 Mac
0:09.603–0:11.385
enMini machine with just
Mini machine with just
0:11.385–0:13.260
en24 GB of unified memory.
24 GB of unified memory.
0:13.260–0:15.013
enWe know that QN 3.8 27
We know that QN 3.8 27
0:15.013–0:17.179
enbillion parameter model
billion parameter model
0:17.179–0:19.860
enwill be of at least 15 GB of size.
will be of at least 15 GB of size.
0:19.860–0:21.918
enand loading the entire
and loading the entire
0:21.918–0:23.760
enmodel in the unified
model in the unified
0:23.760–0:25.602
enmemory will not only
memory will not only
0:25.602–0:27.660
enload the model but also
load the model but also
0:27.660–0:29.098
enloads the kvcache
loads the kvcache
0:29.098–0:30.631
enruntime and the mac
runtime and the mac
0:30.631–0:32.356
enoperating system all
operating system all
0:32.356–0:35.040
entogether and while you load all of
together and while you load all of
0:35.040–0:36.568
enthem in the vram it is
them in the vram it is
0:36.568–0:38.365
endefinitely going to hit
definitely going to hit
0:38.365–0:40.073
enthe memory ceiling for
the memory ceiling for
0:40.073–0:41.780
enyou and it is going to be
you and it is going to be
0:41.780–0:43.280
engetting you the out of
getting you the out of
0:43.280–0:44.947
enmemory exception so how
memory exception so how
0:44.947–0:46.447
encan we even handle the
can we even handle the
0:46.447–0:48.280
ensituation of these kind of
situation of these kind of
0:48.280–0:49.935
enmemory problem and can
memory problem and can
0:49.935–0:51.415
enwe even run a QUEN 3.8
we even run a QUEN 3.8
0:51.415–0:52.983
en27 billion parameter
27 billion parameter
0:52.983–0:55.160
enmodel in this machine and is it
model in this machine and is it
0:55.160–0:56.689
enjust the problem with
just the problem with
0:56.689–0:58.218
enthe model itself or is
the model itself or is
0:58.218–0:59.831
enit the problem with the
it the problem with the
0:59.831–1:01.700
enquantization that we have
quantization that we have
1:01.700–1:03.178
enbut what if we have a
but what if we have a
1:03.178–1:05.117
enquantization of the same
quantization of the same
1:05.117–1:06.779
enexact model with just
exact model with just
1:06.779–1:09.180
entwo-bit quantization instead
two-bit quantization instead
1:09.180–1:10.413
enof the four-bit
of the four-bit
1:10.413–1:12.311
enquantization can we run
quantization can we run
1:12.311–1:14.208
enthat at all well welcome
that at all well welcome
1:14.208–1:16.580
ento the QUEN model quantized to
to the QUEN model quantized to
1:16.580–1:19.263
en2-bit called as the
2-bit called as the
1:19.263–1:22.617
enQEN3.827BGSQRCOIQ2QS
QEN3.827BGSQRCOIQ2QS
1:22.617–1:25.971
enmodel and this model can
model and this model can
1:25.971–1:29.660
enload in the 24GB of unified
load in the 24GB of unified
1:29.660–1:32.460
enmachine and it can support a full GPU
machine and it can support a full GPU
1:32.460–1:34.327
enoffloading as well as it
offloading as well as it
1:34.327–1:35.633
enhas multi-token
has multi-token
1:35.633–1:37.220
enprediction enabled
prediction enabled
1:37.220–1:39.443
enas well and this model
as well and this model
1:39.443–1:41.418
encan easily fit in an
can easily fit in an
1:41.418–1:43.888
enApple M4 machine of 24GB
Apple M4 machine of 24GB
1:43.888–1:45.740
enof unified memory
of unified memory
1:45.740–1:47.415
enwhich includes the model
which includes the model
1:47.415–1:49.010
enkv cache runtime and mac
kv cache runtime and mac
1:49.010–1:50.764
enoperating system without
operating system without
1:50.764–1:52.040
enhitting the memory
hitting the memory
1:52.040–1:54.312
enceiling as well so it can easily load
ceiling as well so it can easily load
1:54.312–1:55.525
eneverything for you
everything for you
1:55.525–1:56.661
enwithin your apple
within your apple
1:56.661–1:58.100
enmachine which is quite
machine which is quite
1:58.100–1:59.300
enamazing so the memory
amazing so the memory
1:59.300–2:00.633
enrequirement is going to
requirement is going to
2:00.633–2:01.900
enbe so much less because
be so much less because
2:01.900–2:03.500
enof the two-bit quantization
of the two-bit quantization
2:03.500–2:04.567
enthat you have got in
that you have got in
2:04.567–2:05.967
enthis particular model so
this particular model so
2:05.967–2:07.033
enhow exactly is this
how exactly is this
2:07.033–2:09.080
enpossible will the quen 3.8 right
possible will the quen 3.8 right
2:09.080–2:10.297
ennow will lose its
now will lose its
2:10.297–2:12.123
enintelligence ability or
intelligence ability or
2:12.123–2:13.601
enthe output will be of
the output will be of
2:13.601–2:15.600
enless quality or how exactly
less quality or how exactly
2:15.600–2:16.911
enis this happening what
is this happening what
2:16.911–2:18.015
enexactly is this new
exactly is this new
2:18.015–2:19.050
enmodel of a two-bit
model of a two-bit
2:19.050–2:21.120
enquantization well this particular
quantization well this particular
2:21.120–2:22.760
enquen model is a standard
quen model is a standard
2:22.760–2:24.317
enquen model but instead
quen model but instead
2:24.317–2:25.711
enof applying the same
of applying the same
2:25.711–2:27.760
enquantization everywhere the
quantization everywhere the
2:27.760–2:29.254
entechnique will determine
technique will determine
2:29.254–2:30.544
enwhich tensor deserves
which tensor deserves
2:30.544–2:31.970
enmore precision and which
more precision and which
2:31.970–2:33.600
encan tolerate the aggressive
can tolerate the aggressive
2:33.600–2:34.733
encompression that's
compression that's
2:34.733–2:35.733
enexactly what this
exactly what this
2:35.733–2:37.000
enparticular technique
particular technique
2:37.000–2:38.333
endoes and what exactly is
does and what exactly is
2:38.333–2:39.200
enthis technique
this technique
2:39.200–2:40.600
enthat we're talking about
that we're talking about
2:40.600–2:42.171
enthe gsq rco or otherwise
the gsq rco or otherwise
2:42.171–2:43.677
encalled as the gumbel
called as the gumbel
2:43.677–2:45.360
ensoftmax quantization
softmax quantization
2:45.360–2:47.982
enwhich intelligently optimizes the
which intelligently optimizes the
2:47.982–2:49.905
enquantization value while
quantization value while
2:49.905–2:52.440
enRCO intelligently decide where to
RCO intelligently decide where to
2:52.440–2:54.446
enallocate more or fewer
allocate more or fewer
2:54.446–2:57.613
enbits across the models or tens are so
bits across the models or tens are so
2:57.613–3:00.780
enessentially even if the model sizes
essentially even if the model sizes
3:00.780–3:02.758
enis going to be reduced
is going to be reduced
3:02.758–3:04.845
enfrom the 16 bpw which is
from the 16 bpw which is
3:04.845–3:07.043
ena 16-bit original model
a 16-bit original model
3:07.043–3:09.240
ento a 2-bit quantization
to a 2-bit quantization
3:09.240–3:10.978
enmodel it is going to be
model it is going to be
3:10.978–3:12.812
enof almost 6.4 times of a
of almost 6.4 times of a
3:12.812–3:14.742
ensize lower but still the
size lower but still the
3:14.742–3:16.480
enmodel is going to give
model is going to give
3:16.480–3:18.128
enyou an amazing precision
you an amazing precision
3:18.128–3:19.462
enover here that is the
over here that is the
3:19.462–3:21.110
enpower of this particular
power of this particular
3:21.110–3:22.680
enmodel itself and that's
model itself and that's
3:22.680–3:23.869
enthe reason why even
the reason why even
3:23.869–3:25.206
enthough the size of the
though the size of the
3:25.206–3:26.691
enmodel is so much smaller
model is so much smaller
3:26.691–3:28.400
enthe quality of the output is
the quality of the output is
3:28.400–3:29.908
enstill going to be way
still going to be way
3:29.908–3:31.504
enmore same like how you
more same like how you
3:31.504–3:32.746
encan expect with a
can expect with a
3:32.746–3:35.140
enquantization 4 model of the same
quantization 4 model of the same
3:35.140–3:36.340
enQN model that you have
QN model that you have
3:36.340–3:37.673
engot that's exactly what
got that's exactly what
3:37.673–3:39.073
enthis particular model is
this particular model is
3:39.073–3:40.273
enand we are going to see
and we are going to see
3:40.273–3:42.307
enin this particular video
in this particular video
3:42.307–3:44.439
enhow we can run the same
how we can run the same
3:44.439–3:46.690
enexact QN 2-bit model in
exact QN 2-bit model in
3:46.690–3:48.940
enthe Mac Mini M4 machine
the Mac Mini M4 machine
3:48.940–3:50.693
enand we're also going to
and we're also going to
3:50.693–3:52.446
ensee how fast it is going
see how fast it is going
3:52.446–3:53.553
ento be doing the
to be doing the
3:53.553–3:55.860
eninferencing for us and what it
inferencing for us and what it
3:55.860–3:57.225
enmeans with different
means with different
3:57.225–3:58.514
ensizes of the KV cache
sizes of the KV cache
3:58.514–3:59.803
enadjustment that I'm
adjustment that I'm
3:59.803–4:01.320
engoing to be doing in this
going to be doing in this
4:01.320–4:02.958
enparticular video and i
particular video and i
4:02.958–4:04.510
enwill show you how it is
will show you how it is
4:04.510–4:06.062
engoing to be affecting
going to be affecting
4:06.062–4:07.700
enthe the speed as well as
the the speed as well as
4:07.700–4:09.068
enthe number of tokens per
the number of tokens per
4:09.068–4:10.162
ensecond as well so in
second as well so in
4:10.162–4:11.599
enthis particular video we
this particular video we
4:11.599–4:13.240
enare going to see which kv size
are going to see which kv size
4:13.240–4:14.736
enor which kv cache is
or which kv cache is
4:14.736–4:16.513
engoing to be faster like
going to be faster like
4:16.513–4:18.103
en16 bit or 4 bit or 8 bit
16 bit or 4 bit or 8 bit
4:18.103–4:20.160
enquantization and which is
quantization and which is
4:20.160–4:21.531
engoing to take more time
going to take more time
4:21.531–4:22.758
enand what is the total
and what is the total
4:22.758–4:23.985
ennumber of tokens per
number of tokens per
4:23.985–4:25.500
ensecond that you are going
second that you are going
4:25.500–4:26.633
ento be getting uh with
to be getting uh with
4:26.633–4:27.700
endifferent kinds of
different kinds of
4:27.700–4:28.900
ensettings that you are
settings that you are
4:28.900–4:30.700
engoing to be doing in the lm studio
going to be doing in the lm studio
4:30.700–4:31.900
enand one more time this
and one more time this
4:31.900–4:33.160
enparticular model is
particular model is
4:33.160–4:34.657
enactually not available
actually not available
4:34.657–4:35.780
enin the mlx format i
in the mlx format i
4:35.780–4:37.113
enunfortunately have got
unfortunately have got
4:37.113–4:38.380
enonly the ggf format and
only the ggf format and
4:38.380–4:39.647
eni am going to be running
i am going to be running
4:39.647–4:40.913
enthis particular model
this particular model
4:40.913–4:42.047
enin the lm studio and i
in the lm studio and i
4:42.047–4:43.180
enwill show you how the
will show you how the
4:43.180–4:44.527
entps is going to be for
tps is going to be for
4:44.527–4:46.520
enthe different kv cache that we
the different kv cache that we
4:46.520–4:47.853
enare going to be setting
are going to be setting
4:47.853–4:49.957
enand running it but you know what this
and running it but you know what this
4:49.957–4:51.780
enparticular model is not really
particular model is not really
4:51.780–4:53.085
engoing to hit the out of
going to hit the out of
4:53.085–4:54.535
enmemory exception based
memory exception based
4:54.535–4:55.695
enon the different kv
on the different kv
4:55.695–4:57.580
encache setting you can actually
cache setting you can actually
4:57.580–4:58.780
ensee that this model is
see that this model is
4:58.780–4:59.913
enactually going to be
actually going to be
4:59.913–5:01.180
enperformant as well and
performant as well and
5:01.180–5:02.513
enthis is the good news for
this is the good news for
5:02.513–5:03.780
enthis particular model
this particular model
5:03.780–5:05.047
enwell as that said let's
well as that said let's
5:05.047–5:06.380
enstart doing the testing
start doing the testing
5:06.380–5:07.913
enof the model with different
of the model with different
5:07.913–5:09.247
enquantization so you can
quantization so you can
5:09.247–5:10.380
ensee that i have got my
see that i have got my
5:10.380–5:11.447
enmac mini m4 machine
mac mini m4 machine
5:11.447–5:12.847
entotal number of physical
total number of physical
5:12.847–5:14.066
enthat you can see over
that you can see over
5:14.066–5:15.632
enhere is 24 gig and i'm
here is 24 gig and i'm
5:15.632–5:17.382
engoing to be loading the
going to be loading the
5:17.382–5:19.500
enuh the quen model uh in the lm
uh the quen model uh in the lm
5:19.500–5:21.790
enstudio and i'm going to
studio and i'm going to
5:21.790–5:24.081
enset the context length
set the context length
5:24.081–5:26.371
enover here uh to at least
over here uh to at least
5:26.371–5:28.300
enlike a 30 31 or 32 000
like a 30 31 or 32 000
5:28.300–5:29.567
enuh over here and you can
uh over here and you can
5:29.567–5:30.633
ensee that this is the
see that this is the
5:30.633–5:31.767
enmaximum concurrent
maximum concurrent
5:31.767–5:33.433
enprediction or instead of four
prediction or instead of four
5:33.433–5:34.700
eni'm going to be setting
i'm going to be setting
5:34.700–5:35.900
enit to one because it's
it to one because it's
5:35.900–5:37.233
engoing to be reducing the
going to be reducing the
5:37.233–5:38.433
entotal lump compute as
total lump compute as
5:38.433–5:39.700
enwell and i'm also going
well and i'm also going
5:39.700–5:40.986
ento change the kv cache
to change the kv cache
5:40.986–5:43.146
enquantization type there
quantization type there
5:43.146–5:45.100
enso instead of using the
so instead of using the
5:45.100–5:46.367
endefault i'm going to be
default i'm going to be
5:46.367–5:47.567
ensetting the fp16 this
setting the fp16 this
5:47.567–5:48.833
entime and i'm going to be
time and i'm going to be
5:48.833–5:50.567
enloading this particular model
loading this particular model
5:50.567–5:51.900
enand the moment i'm going
and the moment i'm going
5:51.900–5:53.233
ento load this particular
to load this particular
5:53.233–5:54.433
enmodel you can see that
model you can see that
5:54.433–5:55.900
enit is going to be consuming
it is going to be consuming
5:55.900–5:57.100
enaround 20 gig or 21 gig
around 20 gig or 21 gig
5:57.100–5:59.340
enof the total memory uh
of the total memory uh
5:59.340–6:01.700
enin my uh in my ram there
in my uh in my ram there
6:01.700–6:04.060
enand now i'm going to be
and now i'm going to be
6:04.060–6:05.000
enrunning the the
running the the
6:05.000–6:06.301
enquestions over there
questions over there
6:06.301–6:07.747
eninferencing it without
inferencing it without
6:07.747–6:09.193
enthe thinking enabled so
the thinking enabled so
6:09.193–6:10.060
enthe moment i'm
the moment i'm
6:10.060–6:11.558
engoing to run let's say
going to run let's say
6:11.558–6:13.223
enhi over here i'm getting
hi over here i'm getting
6:13.223–6:14.805
enaround 4.57 tokens per
around 4.57 tokens per
6:14.805–6:16.220
ensecond and now if i'm
second and now if i'm
6:16.220–6:17.884
engoing to say again like
going to say again like
6:17.884–6:19.460
enhi again it is going to
hi again it is going to
6:19.460–6:20.774
engive me around 4.9
give me around 4.9
6:20.774–6:22.700
entokens per second this is a
tokens per second this is a
6:22.700–6:23.967
endense model that we're
dense model that we're
6:23.967–6:25.300
entalking about guys look
talking about guys look
6:25.300–6:26.433
enat that and now if i'm
at that and now if i'm
6:26.433–6:27.900
engoing to pass a long prompt
going to pass a long prompt
6:27.900–6:29.033
ento write a selenium c
to write a selenium c
6:29.033–6:30.375
ensharp dot net code for
sharp dot net code for
6:30.375–6:32.099
engoogle search operation
google search operation
6:32.099–6:33.660
enwith page object model
with page object model
6:33.660–6:35.127
enand dependency injection
and dependency injection
6:35.127–6:36.327
enand if i'm going to run
and if i'm going to run
6:36.327–6:37.460
enit i'm going to start
it i'm going to start
6:37.460–6:38.793
enthe timer as well just in
the timer as well just in
6:38.793–6:40.060
encase and if i'm going to
case and if i'm going to
6:40.060–6:41.127
enshow you the memory
show you the memory
6:41.127–6:42.460
enspike there you see that
spike there you see that
6:42.460–6:43.927
enthe memory pressure is not
the memory pressure is not
6:43.927–6:45.327
enincreasing because it's
increasing because it's
6:45.327–6:46.660
ena two-bit quantization
a two-bit quantization
6:46.660–6:47.793
enmodel and at the same
model and at the same
6:47.793–6:49.127
entime you can see that i'm
time you can see that i'm
6:49.127–6:50.327
enactually getting the
actually getting the
6:50.327–6:51.527
enoutput over here it is
output over here it is
6:51.527–6:52.660
ennot as fast as you can
not as fast as you can
6:52.660–6:54.193
enimagine it is not super fast
imagine it is not super fast
6:54.193–6:55.393
enlike how we can expect
like how we can expect
6:55.393–6:56.460
enwith a like an m5 max
with a like an m5 max
6:56.460–6:57.727
enmachine but you can see
machine but you can see
6:57.727–6:59.127
enthat within four minutes
that within four minutes
6:59.127–7:00.700
eni got the output with a
i got the output with a
7:00.700–7:02.558
en5.67 tokens per second
5.67 tokens per second
7:02.558–7:04.122
enthis is not bad to be
this is not bad to be
7:04.122–7:05.980
enhonest this is working
honest this is working
7:05.980–7:07.313
enit's not really hitting
it's not really hitting
7:07.313–7:08.647
enthat memory ceiling and
that memory ceiling and
7:08.647–7:09.580
enif you try to run a
if you try to run a
7:09.580–7:11.313
enfour-bit quantization this is
four-bit quantization this is
7:11.313–7:12.247
ennever going to be
never going to be
7:12.247–7:13.580
enrunning for you and four
running for you and four
7:13.580–7:14.847
enminutes is not that bad
minutes is not that bad
7:14.847–7:16.647
enat all now i'm going to change the
at all now i'm going to change the
7:16.647–7:18.047
enquantization to uh eight
quantization to uh eight
7:18.047–7:19.313
enjust the quantization
just the quantization
7:19.313–7:20.513
eneight there for the kv
eight there for the kv
7:20.513–7:21.913
encache alone and i'm going
cache alone and i'm going
7:21.913–7:22.913
ento be loading this
to be loading this
7:22.913–7:24.446
enparticular model and i'm
particular model and i'm
7:24.446–7:25.875
engoing to ask the same
going to ask the same
7:25.875–7:28.060
enexact prompt there sending a hi
exact prompt there sending a hi
7:28.060–7:29.681
enmessage and i'm going to
message and i'm going to
7:29.681–7:31.301
ensay hi again i'm getting
say hi again i'm getting
7:31.301–7:32.922
en5.47 token and i'm going
5.47 token and i'm going
7:32.922–7:34.380
ento send the same exact
to send the same exact
7:34.380–7:35.768
enSedium code prompt and
Sedium code prompt and
7:35.768–7:37.083
enI'm going to start the
I'm going to start the
7:37.083–7:38.545
entimer over there you can
timer over there you can
7:38.545–7:39.860
ensee that this time the
see that this time the
7:39.860–7:41.211
entime is going to be a
time is going to be a
7:41.211–7:42.983
enbit higher than compared
bit higher than compared
7:42.983–7:44.418
ento the FP16 there the
to the FP16 there the
7:44.418–7:46.360
enreason is because actually
reason is because actually
7:46.360–7:47.895
enit's not that even if
it's not that even if
7:47.895–7:49.430
enyou try to reduce the
you try to reduce the
7:49.430–7:51.326
enquantization the things
quantization the things
7:51.326–7:52.680
enwill be faster the
will be faster the
7:52.680–7:54.473
eninferencing will exactly
inferencing will exactly
7:54.473–7:56.102
enbe the same exact tokens
be the same exact tokens
7:56.102–7:57.569
enper second because it
per second because it
7:57.569–7:59.280
enalso need to de-quantize
also need to de-quantize
7:59.280–7:59.840
zh安安
安安
8:02.400–8:05.900
zh然後它會不會有更快。
然後它會不會有更快。
8:05.900–8:09.700
zh所以,它會不會有更快。
所以,它會不會有更快。
8:09.700–8:14.900
zh所以,它會不會有更快。
所以,它會不會有更快。
8:14.900–8:19.160
enthan compared to the FP16 for you over there.
than compared to the FP16 for you over there.
8:19.260–8:20.043
enSee now,
See now,
8:20.043–8:23.960
enthis is going to be the FP4 that we have got.
this is going to be the FP4 that we have got.
8:24.060–8:25.260
enI'm going to be asking
I'm going to be asking
8:25.260–8:26.660
enthe same exact question.
the same exact question.
8:26.660–8:27.727
enThe total number of
The total number of
8:27.727–8:29.060
entokens per second is not
tokens per second is not
8:29.060–8:29.993
enchanging at all.
changing at all.
8:29.993–8:31.193
enAnd now if I'm going to
And now if I'm going to
8:31.193–8:33.060
enbe running the same exact prompt,
be running the same exact prompt,
8:33.060–8:34.393
enthe Serenium WebDriver
the Serenium WebDriver
8:34.393–8:35.793
enquestion over there with
question over there with
8:35.793–8:37.260
enthe quantization 4 there,
the quantization 4 there,
8:37.260–8:38.860
eninstead of the 4.04 minutes,
instead of the 4.04 minutes,
8:38.860–8:40.940
enwhich was taking in FP16,
which was taking in FP16,
8:41.160–8:43.940
enit is 4.46 as you can see here.
it is 4.46 as you can see here.
8:43.940–8:44.740
enso based on the
so based on the
8:44.740–8:46.073
enquantization change it
quantization change it
8:46.073–8:47.407
enis also obviously going
is also obviously going
8:47.407–8:49.007
ento change the time over there
to change the time over there
8:49.007–8:50.477
enso this proves the point
so this proves the point
8:50.477–8:51.950
enthat the inferencing
that the inferencing
8:51.950–8:53.505
enactually works even in
actually works even in
8:53.505–8:55.060
enLM studio for us and you
LM studio for us and you
8:55.060–8:56.327
encan see that the output
can see that the output
8:56.327–8:57.660
enhas got no compromise as
has got no compromise as
8:57.660–8:58.860
enwell the output looks
well the output looks
8:58.860–9:00.193
enpretty much exactly the
pretty much exactly the
9:00.193–9:01.393
ensame and I can see that
same and I can see that
9:01.393–9:02.527
enit is still working I
it is still working I
9:02.527–9:03.727
enmean there is a change
mean there is a change
9:03.727–9:04.993
enin the output of course
in the output of course
9:04.993–9:06.127
enin the web driver for
in the web driver for
9:06.127–9:07.593
enthe dependency injection
the dependency injection
9:07.593–9:08.927
enit's there over here but
it's there over here but
9:08.927–9:10.193
enin here you can see that
in here you can see that
9:10.193–9:11.660
enthe dependency injection
the dependency injection
9:11.660–9:12.660
ensetup has got a bit
setup has got a bit
9:12.660–9:13.793
endifferent with like
different with like
9:13.793–9:15.327
endriver factory class there
driver factory class there
9:15.327–9:16.193
enthat's the only
that's the only
9:16.193–9:17.593
endifference between both
difference between both
9:17.593–9:18.727
enof them but overall i
of them but overall i
9:18.727–9:20.660
encan actually see that it is working
can actually see that it is working
9:20.660–9:21.993
enpretty much as expected
pretty much as expected
9:21.993–9:23.127
enthe last test which i
the last test which i
9:23.127–9:24.260
enwanted to do with the
wanted to do with the
9:24.260–9:25.460
enfp16 of the same exact
fp16 of the same exact
9:25.460–9:26.727
enmodel is by connecting
model is by connecting
9:26.727–9:27.864
ento a pi coding agent i
to a pi coding agent i
9:27.864–9:29.330
enwant to really see if
want to really see if
9:29.330–9:31.400
enthis is going to work or not so
this is going to work or not so
9:31.400–9:33.152
eni have set the fp16 over
i have set the fp16 over
9:33.152–9:34.904
enhere i'm running it and
here i'm running it and
9:34.904–9:36.656
eni'm going to be opening
i'm going to be opening
9:36.656–9:38.500
enthe pi coding agent over
the pi coding agent over
9:38.500–9:39.705
enhere and i'm going to
here and i'm going to
9:39.705–9:41.052
enchoose the model as you
choose the model as you
9:41.052–9:42.328
encan see i'm going to be
can see i'm going to be
9:42.328–9:44.100
enchasing choosing that gsq rco
chasing choosing that gsq rco
9:44.100–9:46.053
enunsloth mtp model there
unsloth mtp model there
9:46.053–9:47.909
enand i'm going to be just
and i'm going to be just
9:47.909–9:49.569
ensaying hi over there
saying hi over there
9:49.569–9:51.620
eneven for a high message it
even for a high message it
9:51.620–9:53.143
enwas taking a long time
was taking a long time
9:53.143–9:54.581
enit's not very fast as
it's not very fast as
9:54.581–9:56.104
enyou can imagine it was
you can imagine it was
9:56.104–9:57.880
entaking a long time and the
taking a long time and the
9:57.880–9:59.193
enoutput you can see that
output you can see that
9:59.193–10:00.505
enit is going to be giving
it is going to be giving
10:00.505–10:01.818
enyou very very slow here
you very very slow here
10:01.818–10:03.200
enwhich is quite expected
which is quite expected
10:03.200–10:04.515
enbecause this is a dense
because this is a dense
10:04.515–10:05.623
enmodel and now i have
model and now i have
10:05.623–10:06.869
entold it to analyze the
told it to analyze the
10:06.869–10:08.600
encode for me in this particular
code for me in this particular
10:08.600–10:10.875
enrepository and that took
repository and that took
10:10.875–10:12.932
enme more than 27 minutes
me more than 27 minutes
10:12.932–10:15.099
enjust to analyze the code
just to analyze the code
10:15.099–10:16.940
eni mean it went so deep
i mean it went so deep
10:16.940–10:18.207
ento be honest like going
to be honest like going
10:18.207–10:19.473
enthrough each and every
through each and every
10:19.473–10:20.473
enfile even start to
file even start to
10:20.473–10:21.940
enfigure out what exactly is
figure out what exactly is
10:21.940–10:22.940
enthe problem in the
the problem in the
10:22.940–10:24.073
enparticular code but
particular code but
10:24.073–10:25.473
enactually took 27 minutes
actually took 27 minutes
10:25.473–10:27.073
ento give me the output which is
to give me the output which is
10:27.073–10:28.273
enwhat really happened
what really happened
10:28.273–10:29.540
enover here as you can see
over here as you can see
10:29.540–10:30.917
enso long story short you
so long story short you
10:30.917–10:32.940
encan run a two-bit quantization
can run a two-bit quantization
10:32.940–10:34.659
enQUEN 3.8 27 billion
QUEN 3.8 27 billion
10:34.659–10:36.593
enparameter model in an
parameter model in an
10:36.593–10:38.097
enapple m4 mac mini
apple m4 mac mini
10:38.097–10:41.320
enmachine without hitting the memory
machine without hitting the memory
10:41.320–10:43.035
enceiling but what is the
ceiling but what is the
10:43.035–10:44.840
enactual technique which
actual technique which
10:44.840–10:46.104
enmakes the two big
makes the two big
10:46.104–10:48.360
enquantization which helps you
quantization which helps you
10:48.360–10:49.360
enrun in a mac mini m4
run in a mac mini m4
10:49.360–10:50.693
enmachine is actually the
machine is actually the
10:50.693–10:51.827
enmost important part
most important part
10:51.827–10:53.627
enthat's the reason why i actually
that's the reason why i actually
10:53.627–10:54.627
enwanted to show you
wanted to show you
10:54.627–10:56.027
enwhat's really happening
what's really happening
10:56.027–10:57.093
enover here and other
over here and other
10:57.093–10:58.893
enthing is you may ask what happens
thing is you may ask what happens
10:58.893–11:00.024
enif you try to run the
if you try to run the
11:00.024–11:01.881
ensame exact model in the
same exact model in the
11:01.881–11:03.543
enApple M5 Max machine
Apple M5 Max machine
11:03.543–11:05.400
enright so I'm going to be
right so I'm going to be
11:05.400–11:07.153
enloading the same exact
loading the same exact
11:07.153–11:08.629
enmodel as you can see
model as you can see
11:08.629–11:10.382
enover here and I'm going
over here and I'm going
11:10.382–11:12.320
ento be doing an FP16 here as
to be doing an FP16 here as
11:12.320–11:13.833
enwell so FP16 Max current
well so FP16 Max current
11:13.833–11:15.271
enprediction is going to
prediction is going to
11:15.271–11:16.708
enbe one as well I'm going
be one as well I'm going
11:16.708–11:18.600
ento be loading this particular
to be loading this particular
11:18.600–11:19.800
enmodel and let's try to
model and let's try to
11:19.800–11:20.800
enask the same exact
ask the same exact
11:20.800–11:22.067
enquestion over here and
question over here and
11:22.067–11:23.867
ensee how this is actually going to
see how this is actually going to
11:23.867–11:25.920
zh在我的 Apple M5 Max machine
在我的 Apple M5 Max machine
11:25.920–11:28.120
zh所以这个是128GB machine
所以这个是128GB machine
11:28.120–11:29.360
zh所以你可能会被担心
所以你可能会被担心
11:29.360–11:31.000
zh要是转买它快速
要是转买它快速
11:31.000–11:32.160
zh你会被担心
你会被担心
11:32.160–11:34.120
zh要是100兆兆的
要是100兆兆的
11:34.120–11:35.400
zh如果我会被担心
如果我会被担心
11:35.400–11:36.720
zh但如果我会被担心
但如果我会被担心
11:36.720–11:39.000
zh同样的同样
同样的同样
11:39.000–11:40.320
zh在这个机器
在这个机器
11:40.320–11:42.600
zh你能看到它是
你能看到它是
11:42.600–11:45.600
zh连接到27兆兆的
连接到27兆兆的
11:45.600–11:48.320
zh它是127兆兆的
它是127兆兆的
11:48.320–11:49.960
zh所以它试试了
所以它试试了
11:49.960–11:51.783
enpoint that it's not just
point that it's not just
11:51.783–11:53.150
enabout the two-bit
about the two-bit
11:53.150–11:55.155
enquantization model which
quantization model which
11:55.155–11:56.340
encan run way more
can run way more
11:56.340–11:57.861
enfaster in an apple m5
faster in an apple m5
11:57.861–11:59.741
enmax machine because it's
max machine because it's
11:59.741–12:01.351
eneven running in the m4
even running in the m4
12:01.351–12:03.320
enmini machine but the thing
mini machine but the thing
12:03.320–12:04.602
enis even though it is a
is even though it is a
12:04.602–12:06.260
entwo-bit quantization the
two-bit quantization the
12:06.260–12:07.617
enquality of the output
quality of the output
12:07.617–12:09.200
enstill remains and that's
still remains and that's
12:09.200–12:10.556
enthe reason the the
the reason the the
12:10.556–12:12.363
entechnique of the gsq rco
technique of the gsq rco
12:12.363–12:13.809
ensits in so it safely
sits in so it safely
12:13.809–12:16.340
enchooses the best tensor which can
chooses the best tensor which can

影片筆記:How I Ran Qwen3.8-27B GSQ-RCO on a 24GB Mac Mini !

<!-- VIDEONOTE_PUBLICATION_WARNINGS_BEGIN -->

⚠️ 可先使用,仍有待修正項目

本筆記已完成可閱讀的逐字稿與時間跳轉;下列為待處理問題,建議播放原片確認。

  • 待修正:Whisper 幻覺段落已切除(已移除 1 段幻覺內容,其餘逐字稿保留使用。;原始 Whisper 證據保留在 transcript.whisper.raw.json。)
  • 待修正:診斷筆記:目前沒有可可靠理解的逐字稿(asr_language_failure;wrong_language_after_segmented_asr)
  • 待修正:逐字稿品質檢核未完全通過(requested_language_repair_inconclusive;保留 133 段 Whisper 逐字稿,已先行發布。)
  • 待修正:逐字稿語言與宣告語言不一致(已保留來源字幕/Whisper 內容並繼續產生筆記;請確認影片語言。;若語音辨識輸出英文,也會被語言檢查標記,不會覆蓋日文底稿。)
  • 待修正:逐字稿全文快速校讀未完成(已保留自動字幕/原始逐字稿並繼續生成筆記。;未完成的全文速讀項目可在精進模式回聽確認。)
  • 尚有 2 項待修正細節,請查看工作清單。

<!-- VIDEONOTE_PUBLICATION_WARNINGS_END -->

一句話總結

影片演示如何在配備 24GB 統一記憶體的 Apple M4 Mac Mini 上,透過 2-bit 量化(結合 GSQ 與 RCO 技術)成功運行參數量為 270 億的 Qwen 3.8 模型,在維持與 4-bit 模型相當的輸出品質下,解決記憶體不足問題並支援完整 GPU Offloading。

核心重點

  1. 硬體與模型挑戰:Apple M4 Mac Mini 僅有 24GB 統一記憶體,常規 4-bit 量化的 Qwen 3.8 27B 模型(約 15GB)加上 KV Cache、Runtime 及 macOS 系統後,會觸發記憶體上限導致 Out of Memory。
  2. 2-bit 量化解決方案:採用 GSQ (Gumbel Softmax Quantization) 與 RCO (Residual Codebook Optimization) 技術,將模型體積從 16-bit 縮減約 6.4 倍,使模型能在 24GB 記憶體中完整載入。
  3. 性能與品質:
  • 輸出品質與 4-bit 量化模型相當,未出現明顯智力或品質下降。
  • 支援完整 GPU Offloading 及 Multi-token Prediction (MTP)。
  • 降低 KV Cache 量化(從 FP16 降至 8-bit 或 4-bit)並未顯著提升推理速度(TPS),因為仍需進行去量化(de-quantize)處理。
  1. 實際應用驗證:在 LM Studio 中測試長提示(Selenium C# .NET 程式碼生成)及 Pi Coding Agent 程式碼分析,確認功能正常且品質穩定。

詳細大綱

A. 問題背景與挑戰

  • 硬體限制:Apple M4 Mac Mini 配備 24GB 統一記憶體。
  • 常規困境:
  • Qwen 3.8 27B 模型(4-bit 量化)大小至少需 15GB。
  • 若完整載入模型、KV Cache、Runtime 及 macOS 作業系統,將超過記憶體上限,導致 Out of Memory 異常。
  • 核心疑問:能否透過更激進的量化(如 2-bit)解決此問題,且不犧牲模型品質?

B. 解決方案:2-bit 量化模型技術

  • 模型名稱:Qwen 3.8 27B GSQ RCO IQ2QS(或稱 QEN3.827BGSQRCOIQ2QS)。
  • 技術核心原理:
  • GSQ (Gumbel Softmax Quantization):智能優化量化值。
  • RCO (Residual Codebook Optimization):智能決定在哪些張量(Tensor)分配更多或更少位元。
  • 非均勻量化:並非在所有地方應用相同量化,而是決定哪些張量需要高精度,哪些可容忍激進壓縮。
  • 技術優勢:
  • 體積從 16-bit 原版縮減約 6.4 倍。
  • 能在 24GB 記憶體中完整載入(含模型、KV Cache、Runtime、OS)。
  • 支援完整 GPU Offloading。
  • 啟用 Multi-token Prediction (MTP)。
  • 輸出品質與 4-bit 模型相當,未損失智力能力。

C. LM Studio 實測與性能分析

  • 測試環境:Apple M4 Mac Mini (24GB RAM),使用 LM Studio。
  • 設定調整:
  • Context Length:設為 30,000 - 32,000。
  • Concurrent Prediction:設為 1(減少總體計算負載)。
  • KV Cache Quantization:分別測試 FP16、8-bit、4-bit。
  • 測試結果比較:
  • FP16 KV Cache:
  • 記憶體佔用:約 20-21 GB。
  • 簡單提示(Hi):約 4.57 - 4.9 TPS。
  • 長提示(Selenium C# .NET 程式碼生成):約 5.67 TPS,耗時約 4 分鐘。
  • 記憶體壓力穩定,未觸發上限。
  • 8-bit KV Cache:
  • 簡單提示:約 5.47 TPS。
  • 長提示:耗時比 FP16 更長(約 4.46 分鐘)。
  • 結論:降低 KV Cache 量化並未加速推理,因為仍需去量化。
  • 4-bit KV Cache:
  • TPS 與上述設定無顯著變化。
  • 長提示耗時約 4.46 分鐘。
  • 品質觀察:不同量化設定下,輸出內容基本一致,僅在依賴注入(Dependency Injection)的程式碼結構上有微小差異,但功能正常。

D. 進階應用與硬體對比

  • Pi Coding Agent 測試:
  • 連接 LM Studio 進行程式碼分析。
  • 分析整個儲存庫程式碼耗時超過 27 分鐘。
  • 推理速度較慢,符合密集模型(Dense Model)特性。
  • Apple M5 Max 對比:
  • 測試環境:128GB 記憶體的 Apple M5 Max。
  • 同樣運行 2-bit 量化模型。
  • 目的:證明此技術不僅適用於 M4 Mini,在更高階硬體上也能運行,且重點在於「即使量化至 2-bit,輸出品質依然保持」。

工具 / 模型 / 名詞整理

  • 硬體設備:
  • Apple M4 Mac Mini
  • Apple M5 Max (提及用於對比)
  • 模型名稱:
  • Qwen 3.8 27B (逐字稿中多次誤聽為 QN 3.8 或 QUEN 3.8)
  • Qwen 3.8 27B GSQ RCO IQ2QS (或 QEN3.827BGSQRCOIQ2QS)
  • GSQ RCO Unsloth MTP Model
  • 軟體/平台:
  • LM Studio
  • Pi Coding Agent
  • macOS (Mac Operating System)
  • 技術/格式:
  • Unified Memory (統一記憶體)
  • KV Cache (Key-Value Cache)
  • GPU Offloading
  • Multi-token Prediction (MTP)
  • GSQ (Gumbel Softmax Quantization)
  • RCO (Residual Codebook Optimization)
  • 2-bit Quantization
  • 4-bit Quantization
  • 8-bit Quantization
  • FP16 (Float 16)
  • GGF Format (逐字稿提及模型格式為 ggf,非 mlx)
  • MLX Format (提及模型不可用此格式)
  • Selenium C# .NET (程式碼範例語言)
  • WebDriver
  • Dependency Injection (依賴注入)
  • Driver Factory Class

操作流程整理

  1. 準備硬體與環境:確認使用 Apple M4 Mac Mini (24GB RAM)。
  2. 載入模型:使用 LM Studio 載入 Qwen 3.8 27B GSQ RCO IQ2QS 模型。
  3. 調整推理設定:
  • 設定 Context Length 為 30,000 - 32,000。
  • 設定 Concurrent Prediction 為 1。
  • 選擇 KV Cache Quantization 設定(測試 FP16、8-bit、4-bit)。
  1. 執行測試:
  • 發送簡單提示(如 "Hi")測試基礎 TPS。
  • 發送長提示(Selenium C# .NET 程式碼生成)測試長上下文處理能力與耗時。
  1. 驗證品質:比較不同量化設定下的輸出內容,確認依賴注入結構等功能是否正常。
  2. 進階應用:連接 Pi Coding Agent 進行完整儲存庫程式碼分析,觀察推理速度與品質。
  3. 硬體對比:在 Apple M5 Max (128GB) 上重複測試,驗證技術的通用性。

值得注意的限制或風險

  • 推理速度未顯著提升:降低 KV Cache 量化(從 FP16 降至 8-bit 或 4-bit)並未顯著提升推理速度(TPS),因為仍需進行去量化(de-quantize)處理。
  • 長提示處理時間:處理長提示(如 Selenium C# .NET 程式碼生成)耗時約 4 分鐘以上;進行完整儲存庫程式碼分析耗時超過 27 分鐘,顯示密集模型在低配備硬體上的計算負荷較高。
  • 記憶體壓力:即使使用 2-bit 量化,在 24GB 記憶體上運行仍佔用約 20-21 GB,接近記憶體上限,需精確調整設定以避免 Out of Memory。

逐字稿辨識疑點

  • 模型名稱聽寫錯誤:
  • 逐字稿中多次出現 "QN 3.8"、"QUEN 3.8"、"QEN3.827BGSQRCOIQ2QS"。根據上下文推測應為 Qwen 3.8,但依規則標記為疑點。
  • "QEN3.827BGSQRCOIQ2QS" 可能是特定權重檔名稱或聽寫錯誤,無法確認標準命名。
  • 技術術語聽寫:
  • "gsq rco":應指 GSQ (Gumbel Softmax Quantization) 與 RCO (Residual Codebook Optimization) 的組合技術,但逐字稿拼寫不標準。
  • "de-quantize 安安":口語贅字或聽寫錯誤。
  • "Sedium code" / "Serenium WebDriver":應指 Selenium,但逐字稿拼寫為 Sedium/Serenium。
  • 數據與邏輯矛盾:
  • 關於 8-bit KV Cache 的測試時間:講者提到 "this time the time is going to be a bit higher than compared to the FP16"(時間比 FP16 長),但隨後說 "instead of the 4.04 minutes... it is 4.46"。若 FP16 是 4 分鐘,8-bit 變慢是合理的,但講者前文暗示降低量化可能不會變快,這裡的數據對比稍顯混亂,標記為需查證。
  • "27 兆兆" / "127 兆兆":在描述 M5 Max 時,講者口誤將 "GB" 聽寫或口說為 "兆兆" (Tera/Tera?),實際應為 GB,但依規則保留原樣或標記疑點。
  • 格式名稱:
  • "ggf format":常見 LLM 格式為 GGUF 或 GGML,"ggf" 可能是聽寫錯誤,標記為需查證。
  • "mlx format":MLX 是 Apple 的機器學習框架,通常不直接作為模型權重文件格式名稱(除非指特定轉換格式),標記為需查證。
  • segment 305:adjacent_duplicate — 與前一段完全重複,可能是滾動字幕或 ASR 重複。

可延伸追問

  • GSQ 與 RCO 技術在 2-bit 量化下的具體數學原理為何?
  • 為何降低 KV Cache 量化並未提升 TPS?去量化過程的計算開銷是否超過了記憶體頻寬的節省?
  • 在 Pi Coding Agent 中分析完整儲存庫時,是否有方法可以優化推理速度或分階段處理?
  • 該 2-bit 量化模型在其他非 Apple 硬體(如 NVIDIA GPU)上的表現如何?

生字列表

生字讀音類型中文
unified memoryunified memorynoun統一記憶體
parameterparameternoun參數
quantizationquantizationnoun量化
ceilingceilingnoun上限
offloadingoffloadingnoun卸載
inferencinginferencingnoun推論
precisionprecisionnoun精確度
tensortensornoun張量
compressioncompressionnoun壓縮
promptpromptnoun提示詞
tokentokennoun詞元
dependency injectiondependency injectionnoun phrase依賴注入
repositoryrepositorynoun程式碼倉庫
dense modeldense modelnoun phrase稠密模型
fp16fp16noun16 位浮點數
context lengthcontext lengthnoun phrase上下文長度

生字解說

unified memory unified memory

noun · C1

意思:統一記憶體

解說:Apple Silicon 架構特有的記憶體架構,CPU、GPU 和其他處理器共用同一塊記憶體池,無需複製資料,提升效率。

影片原句
24 GB of unified memory.
24 GB 的統一記憶體。
延伸例句
The M4 chip utilizes unified memory to enhance performance.
M4 晶片利用統一記憶體來提升效能。

parameter parameter

noun · C1

意思:參數

解說:在機器學習模型中,指模型內部用於學習和做出預測的可變數值。

影片原句
27 billion parameter model
270 億參數模型
延伸例句
Larger models with more parameters generally understand language better.
擁有更多參數的大型模型通常能更好地理解語言。

quantization quantization

noun · C1

意思:量化

解說:一種技術,通過降低模型權重的數值精度(如從 16 位降至 2 位)來減少模型大小和計算需求。

影片原句
quantization that we have
我們擁有的量化
延伸例句
Quantization allows large models to run on consumer hardware.
量化允許大型模型在消費級硬體上運行。

ceiling ceiling

noun · B2

意思:上限

解說:比喻意義上的極限或最高限度,此處指記憶體容量的極限。

影片原句
hit the memory ceiling
觸及記憶體上限
延伸例句
We have reached the ceiling of our current storage capacity.
我們已達到目前儲存容量的上限。

offloading offloading

noun · C1

意思:卸載

解說:將計算任務或資料從一個處理器(如 CPU)轉移至另一個處理器(如 GPU)以優化效能。

影片原句
support a full GPU offloading
支援完整的 GPU 卸載
延伸例句
GPU offloading significantly speeds up deep learning training.
GPU 卸載顯著加快了深度學習的訓練速度。

inferencing inferencing

noun · C1

意思:推論

解說:指模型在訓練完成後,使用訓練好的參數對新輸入資料進行預測或生成輸出的過程。

影片原句
doing the inferencing for us
為我們進行推論
延伸例句
The server handles inferencing requests from multiple users.
伺服器處理來自多個使用者的推論請求。

precision precision

noun · B2

意思:精確度

解說:在此語境下,指模型在量化後仍能保持的準確性和細節保留程度。

影片原句
amazing precision over here
這裡令人驚嘆的精確度
延伸例句
High precision is crucial for medical diagnostic models.
高精確度對於醫療診斷模型至關重要。

tensor tensor

noun · C1

意思:張量

解說:機器學習中用於表示多維陣列的數據結構,是神經網路計算的基本單元。

影片原句
which tensor deserves more precision
哪個張量值得更多精確度
延伸例句
Tensor operations are optimized for parallel processing.
張量運算針對平行處理進行了優化。

compression compression

noun · B2

意思:壓縮

解說:減少數據大小的過程,此處指通過量化技術減少模型佔用的空間。

影片原句
tolerate the aggressive compression
容忍激進的壓縮
延伸例句
Video compression reduces file size without losing much quality.
影片壓縮在不損失太多品質的情況下減少了檔案大小。

prompt prompt

noun · B2

意思:提示詞

解說:輸入給大型語言模型的指令或問題,用於引導模型生成回應。

影片原句
pass a long prompt
傳遞一個長提示詞
延伸例句
Crafting a clear prompt is essential for getting accurate answers.
撰寫清晰的提示詞對於獲得準確答案至關重要。

token token

noun · C1

意思:詞元

解說:語言模型處理文本的基本單位,通常對應一個字、字詞或部分字。

影片原句
number of tokens per second
每秒詞元數
延伸例句
The model generates 50 tokens per second on average.
該模型平均每秒生成 50 個詞元。

dependency injection dependency injection

noun phrase · C1

意思:依賴注入

解說:一種軟體設計模式,用於實現控制反轉(IoC),將依賴對象傳遞給類而非由類內部創建。

影片原句
dependency injection
依賴注入
延伸例句
Dependency injection makes unit testing easier by allowing mock objects.
依賴注入通過允許模擬對象使單元測試更容易。

repository repository

noun · B2

意思:程式碼倉庫

解說:用於儲存和管理程式碼專案的目錄或系統,通常使用 Git 進行版本控制。

影片原句
analyze the code in this particular repository
分析這個特定程式碼倉庫中的程式碼
延伸例句
I pushed the latest changes to the GitHub repository.
我將最新更改推送到 GitHub 程式碼倉庫。

dense model dense model

noun phrase · C1

意思:稠密模型

解說:指所有參數都參與計算的模型,與稀疏模型相對,通常計算量較大。

影片原句
dense model that we're talking about
我們正在討論的稠密模型
延伸例句
Dense models often require more computational resources than sparse ones.
稠密模型通常比稀疏模型需要更多的計算資源。

fp16 fp16

noun · C1

意思:16 位浮點數

解說:一種數據精度格式,使用 16 位來表示浮點數,平衡了精度和效能。

影片原句
setting the fp16 this time
這次設定為 fp16
延伸例句
Using fp16 can double the training speed on supported GPUs.
在支援的 GPU 上使用 fp16 可以將訓練速度加倍。

context length context length

noun phrase · C1

意思:上下文長度

解說:模型在一次處理中能記住和考慮的最大輸入文本長度。

影片原句
set the context length
設定上下文長度
延伸例句
Increasing the context length allows the model to process longer documents.
增加上下文長度允許模型處理更長的文件。

句型解說(含實例)

how you can [verb]

意思:你如何能 [動詞]

接續:how + you + can + base verb

解說:用於引導說明或解釋某個動作或過程的方法,常見於教學或技術演示開頭。

影片原句
we'll be talking about how you can run a QN 3.8
我們將討論你如何運行 QN 3.8
實例
  1. I will show you how you can optimize your code.
    我將向你展示你如何優化你的程式碼。
  2. This guide explains how you can secure your network.
    本指南解釋了你如何保護你的網路。

not only [verb] but also [verb]

意思:不僅 [動詞] 而且 [動詞]

接續:not only + verb phrase + but also + verb phrase

解說:連接兩個並列的動詞短語,強調兩者同時發生或存在,後者往往更重要或更具影響性。

影片原句
will not only load the model but also loads the kvcache
不僅會載入模型,還會載入 kv 快取
實例
  1. The new feature not only improves speed but also enhances security.
    新功能不僅提高了速度,還增強了安全性。
  2. He not only finished the project but also helped his colleagues.
    他不僅完成了專案,還幫助了他的同事。

what if [clause]

意思:如果 [子句] 會怎樣

接續:what if + subject + verb + ...

解說:用於提出假設性情況,探討某種條件下可能發生的結果或問題。

影片原句
but what if we have a quantization of the same exact model
但如果我們對完全相同的模型進行量化會怎樣
實例
  1. What if we change the strategy to focus on quality?
    如果我們改變策略以專注於品質會怎樣?
  2. What if the server goes down during the update?
    如果伺服器在更新期間宕機會怎樣?

instead of [noun/gerund]

意思:代替 [名詞/動名詞]

接續:instead of + noun/gerund

解說:表示選擇前者而非後者,用於對比兩種選項或方法。

影片原句
instead of the four-bit quantization
代替四比特量化
實例
  1. We should use open source libraries instead of building from scratch.
    我們應該使用開源庫,而不是從頭開始構建。
  2. He chose to walk instead of driving to save fuel.
    他選擇步行而不是開車以節省燃料。

the reason why [clause]

意思:[子句] 的原因

接續:the reason why + subject + verb

解說:用於解釋某個結果或情況發生的原因,後面接解釋性子句。

影片原句
that's the reason why even though the size of the model is so much smaller
這就是為什麼即使模型大小小得多的原因
實例
  1. That is the reason why we need to update the database.
    那就是我們需要更新資料庫的原因。
  2. The reason why the test failed is unclear.
    測試失敗的原因尚不清楚。

based on [noun]

意思:基於 [名詞]

接續:based on + noun phrase

解說:表示某事是根據某個標準、數據或情況得出的結論或進行的操作。

影片原句
based on the different kv cache setting
基於不同的 kv 快取設定
實例
  1. The decision was based on extensive market research.
    該決定是基於廣泛的市場研究做出的。
  2. Prices are based on the current exchange rate.
    價格基於當前匯率。

even though [clause]

意思:即使 [子句]

接續:even though + subject + verb

解說:引導轉折關係的子句,表示儘管存在某種情況,主句的情況依然成立。

影片原句
even though the size of the model is so much smaller
即使模型大小小得多
實例
  1. Even though it was raining, we went for a walk.
    即使下著雨,我們還是去散步了。
  2. Even though the code is complex, it works perfectly.
    即使程式碼很複雜,它也能完美運行。

as well as [noun/verb]

意思:以及 [名詞/動詞]

接續:as well as + noun/verb phrase

解說:用於添加額外的資訊或項目,表示「也」或「還有」。

影片原句
support a full GPU offloading as well as it has multi-token prediction
支援完整的 GPU 卸載,以及它擁有多詞元預測
實例
  1. She speaks French as well as Spanish.
    她說法語,也說西班牙語。
  2. The package includes the software as well as the manual.
    該套件包含軟體以及手冊。