forked from chenzomi12/AISystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01.srt
1848 lines (1386 loc) · 28.2 KB
/
01.srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:00,000 --> 00:00:04,560
[字幕生成:BLACK 字幕校对:志宇]
2
00:00:05,320 --> 00:00:06,360
哈喽大家好
3
00:00:06,360 --> 00:00:07,480
我是ZOMI
4
00:00:07,480 --> 00:00:09,520
今天开辟一个新的内容
5
00:00:09,520 --> 00:00:11,280
叫做AI编译器
6
00:00:11,280 --> 00:00:13,600
AI编译器这个内容其实很无聊
7
00:00:13,600 --> 00:00:14,400
哦不
8
00:00:14,400 --> 00:00:16,560
其实它很有意思很有趣
9
00:00:17,000 --> 00:00:19,640
也是非常具有技术含量的
10
00:00:20,320 --> 00:00:21,760
那在这一个系列里面
11
00:00:21,920 --> 00:00:23,800
讲讲一些基本的介绍
12
00:00:23,800 --> 00:00:25,560
首先来了解一下
13
00:00:25,560 --> 00:00:26,960
编译器和解析器
14
00:00:26,960 --> 00:00:27,840
到底是什么
15
00:00:27,840 --> 00:00:29,000
有什么区别
16
00:00:29,360 --> 00:00:30,400
接着看看
17
00:00:30,400 --> 00:00:32,840
JIT和AOT的编译的方式
18
00:00:32,840 --> 00:00:33,800
有什么不一样
19
00:00:34,320 --> 00:00:35,240
在结束之前
20
00:00:35,360 --> 00:00:37,080
看看在编译器里面
21
00:00:37,080 --> 00:00:38,760
很重要的两个小概念
22
00:00:38,760 --> 00:00:39,480
一个是Path
23
00:00:39,480 --> 00:00:40,480
一个是IR
24
00:00:41,160 --> 00:00:42,280
有了对编译器
25
00:00:42,280 --> 00:00:43,560
一个最基础的了解之后
26
00:00:43,560 --> 00:00:45,840
来看看传统的编译器
27
00:00:46,360 --> 00:00:48,000
聊到传统的编译器
28
00:00:48,000 --> 00:00:49,360
很有意思的一个点
29
00:00:49,360 --> 00:00:51,360
就是还是去看看LIS
30
00:00:51,360 --> 00:00:53,040
看看它的发展趋势
31
00:00:53,800 --> 00:00:55,760
接着以两个业界
32
00:00:55,760 --> 00:00:57,280
比较著名的
33
00:00:57,520 --> 00:00:59,600
编译器来去展开一下
34
00:00:59,600 --> 00:01:01,080
去深入的了解
35
00:01:01,080 --> 00:01:03,160
传统编译器到底是什么
36
00:01:03,160 --> 00:01:05,160
那第一个就是GCC
37
00:01:05,160 --> 00:01:06,640
经常用C++写代码
38
00:01:06,640 --> 00:01:08,160
到时候不是经常用到吗
39
00:01:08,160 --> 00:01:11,160
那第二个就是LLVM
40
00:01:11,720 --> 00:01:13,040
如果你跟我一样
41
00:01:13,040 --> 00:01:14,400
用的是苹果电脑
42
00:01:14,400 --> 00:01:17,800
你可能会对这个LLVM特别熟悉
43
00:01:17,800 --> 00:01:19,000
每次编译的时候
44
00:01:19,000 --> 00:01:20,280
都离不开它
45
00:01:21,280 --> 00:01:23,600
第三点就是这个系列的
46
00:01:23,600 --> 00:01:25,200
重点AI编译器
47
00:01:25,200 --> 00:01:25,920
那当然了
48
00:01:25,920 --> 00:01:26,680
这一节课里面
49
00:01:26,680 --> 00:01:28,840
AI编译器只是占了三分之一
50
00:01:28,840 --> 00:01:31,480
但是接下来后面的系列
51
00:01:31,480 --> 00:01:32,720
所有的内容
52
00:01:32,720 --> 00:01:34,360
都是围绕AI编译器
53
00:01:35,160 --> 00:01:36,760
第一个还是去看看
54
00:01:36,760 --> 00:01:38,520
有意思的一些故事
55
00:01:38,520 --> 00:01:40,560
AI编译器的一个发展
56
00:01:41,760 --> 00:01:43,080
接着去看看
57
00:01:43,080 --> 00:01:45,160
AI编译器的一个通用的架构
58
00:01:45,160 --> 00:01:47,280
虽然AI编译器还是快速的发展
59
00:01:47,280 --> 00:01:49,760
但是基本架构已经定型了
60
00:01:49,760 --> 00:01:52,560
可能里面会有非常多的细节去补充
61
00:01:52,560 --> 00:01:54,600
那最后来去看看
62
00:01:54,640 --> 00:01:57,280
AI编译器和传统编译器
63
00:01:57,280 --> 00:01:58,360
有什么区别
64
00:01:58,360 --> 00:01:59,400
它的difference
65
00:01:59,400 --> 00:02:00,800
还有它的challenging
66
00:02:00,800 --> 00:02:03,400
还有未来的发展的一些趋势
67
00:02:03,400 --> 00:02:05,480
这个也是我现在非常关心的
68
00:02:06,200 --> 00:02:10,560
随着公司的芯片硬件越来越多
69
00:02:10,560 --> 00:02:12,440
如果把AI编译器做好了
70
00:02:12,440 --> 00:02:15,080
其实可以接上非常多的人力工作
71
00:02:17,680 --> 00:02:19,240
在正式开始之前
72
00:02:19,240 --> 00:02:20,880
我想抛出两个问题
73
00:02:20,880 --> 00:02:21,720
那第一个就是
74
00:02:21,720 --> 00:02:23,760
为什么需要编译器
75
00:02:23,800 --> 00:02:26,000
编译器能够给解决什么问题呢
76
00:02:26,800 --> 00:02:28,040
第二个点就是
77
00:02:28,040 --> 00:02:30,480
AI框架和AI编译器之间
78
00:02:30,480 --> 00:02:32,240
到底有什么关系呢
79
00:02:32,240 --> 00:02:34,280
AI框架就是AI编译器吗
80
00:02:34,280 --> 00:02:36,760
还是AI框架不是AI编译器呢
81
00:02:36,760 --> 00:02:38,520
它们之间的一个gap
82
00:02:38,520 --> 00:02:40,920
两者之间的边界到底在哪里了
83
00:02:41,680 --> 00:02:42,800
带着这两个问题
84
00:02:42,800 --> 00:02:44,160
继续往下展开
85
00:02:45,600 --> 00:02:46,960
首先第一个概念就是
86
00:02:46,960 --> 00:02:49,680
搞清楚编译器和解析器
87
00:02:49,680 --> 00:02:52,000
编译器传统叫做compiler
88
00:02:52,960 --> 00:02:55,160
解析器叫做interpreter
89
00:02:55,800 --> 00:02:57,720
现在打开一个YouTube的视频
90
00:02:57,720 --> 00:02:58,640
来去了解一下
91
00:02:58,640 --> 00:03:01,200
编译器和解析器之间的区别
92
00:03:22,000 --> 00:03:23,600
将在这段视频中看到的
93
00:03:24,800 --> 00:03:26,240
在开始之前
94
00:03:26,240 --> 00:03:29,680
你应该知道两个重要的词语
95
00:03:29,680 --> 00:03:31,760
之后会使用的
96
00:03:31,760 --> 00:03:33,160
这些词语叫做
97
00:03:33,160 --> 00:03:36,000
高级语言和低级语言
98
00:03:37,040 --> 00:03:39,280
如果你已经知道这些词语的意思
99
00:03:39,280 --> 00:03:41,480
你可以跳过屏幕上的一分钟
100
00:03:44,960 --> 00:03:45,840
不幸的是
101
00:03:45,840 --> 00:03:48,240
设备只能够理解binary
102
00:03:48,240 --> 00:03:50,760
也就是0和1
103
00:03:50,800 --> 00:03:52,160
binary这个词语
104
00:03:52,160 --> 00:03:53,640
是机器语言
105
00:03:53,640 --> 00:03:56,480
它被认为是一个低级语言
106
00:03:56,480 --> 00:03:59,360
因为它比人类
107
00:03:59,360 --> 00:04:00,760
能够理解
108
00:04:02,960 --> 00:04:05,240
因为人类几乎无法
109
00:04:05,240 --> 00:04:09,000
用0和1来写标语
110
00:04:09,000 --> 00:04:12,080
其他互联语语言就出现了
111
00:04:12,080 --> 00:04:14,600
现在人类使用的语言
112
00:04:14,600 --> 00:04:17,120
用来写标语都很接近英语
113
00:04:17,120 --> 00:04:18,920
例如
114
00:04:18,960 --> 00:04:19,800
Python
115
00:04:19,800 --> 00:04:20,480
C
116
00:04:20,480 --> 00:04:22,120
和Java
117
00:04:22,120 --> 00:04:24,400
这些语言被称为高级语言
118
00:04:24,400 --> 00:04:27,480
因为它们比机器语言
119
00:04:27,480 --> 00:04:29,200
更接近人类的理解
120
00:04:31,400 --> 00:04:33,160
但是你可能已经认出
121
00:04:33,160 --> 00:04:35,520
这仍然是个问题
122
00:04:35,520 --> 00:04:38,480
机器语言只能够理解低级语言
123
00:04:38,480 --> 00:04:41,200
而人类却能够提供高级语言
124
00:04:41,200 --> 00:04:43,560
这怎么能够解决呢
125
00:04:43,560 --> 00:04:45,080
为了解决这些问题
126
00:04:45,080 --> 00:04:47,560
需要一个翻译者
127
00:04:47,560 --> 00:04:48,920
正是
128
00:04:48,920 --> 00:04:51,880
这就是使用的翻译者和翻译者
129
00:04:53,880 --> 00:04:55,800
现在,经过这次小旅程
130
00:04:55,800 --> 00:04:58,200
让回到开始的地方
131
00:04:58,200 --> 00:04:59,960
正如之前提到的
132
00:04:59,960 --> 00:05:03,240
翻译者和翻译者都操作为翻译者
133
00:05:03,240 --> 00:05:06,120
从高级语言到低级语言
134
00:05:06,120 --> 00:05:07,200
现在让来看看
135
00:05:07,200 --> 00:05:09,280
哪一位翻译者会做哪一件事
136
00:05:11,760 --> 00:05:12,800
翻译者
137
00:05:12,800 --> 00:05:14,600
把你写的整个程序
138
00:05:14,600 --> 00:05:16,160
翻译到高级语言
139
00:05:16,160 --> 00:05:20,760
然后把整个程序翻译到机器语言
140
00:05:22,280 --> 00:05:24,080
经过这次过程
141
00:05:24,080 --> 00:05:26,440
一个可运行的文件就会准备好运行
142
00:05:27,800 --> 00:05:30,640
翻译有时候需要很多时间
143
00:05:30,640 --> 00:05:32,040
但经过这些过程
144
00:05:32,040 --> 00:05:33,640
运行就变得很快
145
00:05:34,760 --> 00:05:35,760
不幸的是
146
00:05:35,760 --> 00:05:37,040
任何程序中的错误
147
00:05:37,040 --> 00:05:39,600
都会完全阻止它从工作
148
00:05:39,600 --> 00:05:42,560
错误会在组合的结尾显示出来
149
00:05:43,280 --> 00:05:44,360
翻译者
150
00:05:44,360 --> 00:05:46,680
把每一个程序的指示
151
00:05:46,680 --> 00:05:48,320
翻译到机器语言
152
00:05:48,320 --> 00:05:50,080
然后自行运行
153
00:05:52,680 --> 00:05:55,720
翻译程序运行之前的运行步骤
154
00:05:55,720 --> 00:05:56,520
很快
155
00:05:56,520 --> 00:05:58,520
因为程序会立刻开始
156
00:05:58,520 --> 00:06:00,440
但运行会运行得很慢
157
00:06:01,280 --> 00:06:03,240
翻译者的优点是
158
00:06:03,240 --> 00:06:04,920
程序会完全运行
159
00:06:04,920 --> 00:06:06,840
直到出现错误
160
00:06:07,760 --> 00:06:09,200
错误会在
161
00:06:09,400 --> 00:06:10,480
或QO
162
00:06:11,240 --> 00:06:13,240
中的每个指示之后
163
00:06:13,240 --> 00:06:15,920
都会显示出错误
164
00:06:17,960 --> 00:06:19,160
现在让看看
165
00:06:19,160 --> 00:06:22,400
真实的翻译者和翻译者的例子
166
00:06:23,160 --> 00:06:24,920
在第一个例子中
167
00:06:24,920 --> 00:06:26,320
将看到
168
00:06:26,320 --> 00:06:27,440
翻译者创建的
169
00:06:27,440 --> 00:06:30,040
可运行的中间文件
170
00:06:31,120 --> 00:06:32,000
在这个例子中
171
00:06:32,000 --> 00:06:33,520
有一个C语言程序
172
00:06:33,520 --> 00:06:35,720
将尝试翻译它
173
00:06:35,720 --> 00:06:37,600
看看会发生什么
174
00:06:39,200 --> 00:06:42,320
翻译者创建了一个中间文件
175
00:06:42,320 --> 00:06:43,520
试试看
176
00:06:47,520 --> 00:06:50,680
这个文件有一个.exe的延迟
177
00:06:50,680 --> 00:06:51,720
意味着
178
00:06:51,720 --> 00:06:53,720
它是一个可运行的文件
179
00:06:55,040 --> 00:06:56,240
在这个例子中
180
00:06:56,240 --> 00:06:58,720
使用了Python 3.9翻译者
181
00:06:58,720 --> 00:07:00,640
想要使用Python 3.9
182
00:07:00,640 --> 00:07:01,680
来运行
183
00:07:01,680 --> 00:07:02,960
但是需要用到
184
00:07:02,960 --> 00:07:04,720
Python 3.9的翻译程序
185
00:07:04,720 --> 00:07:05,840
来运行
186
00:07:05,840 --> 00:07:07,280
所以需要用到
187
00:07:07,280 --> 00:07:09,120
Python 3.9的翻译程序
188
00:07:09,120 --> 00:07:10,680
来创建一个程序文件
189
00:07:10,680 --> 00:07:12,360
看看会发生什么
190
00:07:13,880 --> 00:07:14,960
如您所见
191
00:07:14,960 --> 00:07:16,160
测试文件创建了
192
00:07:16,160 --> 00:07:18,680
没有任何其他中间文件
193
00:07:18,680 --> 00:07:21,600
这些文件有一个.py的延迟
194
00:07:21,600 --> 00:07:22,200
意味着
195
00:07:22,200 --> 00:07:24,760
它是由翻译者直接打开的
196
00:07:26,480 --> 00:07:27,960
在另一个例子中
197
00:07:27,960 --> 00:07:28,640
将看到
198
00:07:28,640 --> 00:07:30,360
如何展示错误
199
00:07:30,360 --> 00:07:31,360
这将显示
200
00:07:31,360 --> 00:07:32,480
刚才提到的
201
00:07:32,480 --> 00:07:34,560
可运行方式
202
00:07:34,560 --> 00:07:35,400
在这里使用
203
00:07:35,400 --> 00:07:36,760
新的网络组合
204
00:07:36,760 --> 00:07:37,360
它们两个方式
205
00:07:37,360 --> 00:07:38,480
来运行
206
00:07:38,480 --> 00:07:39,720
一步一步
207
00:07:39,720 --> 00:07:40,720
为了简单化
208
00:07:40,720 --> 00:07:42,120
使用.f功能
209
00:07:42,120 --> 00:07:43,920
它在屏幕上展示
210
00:07:43,920 --> 00:07:46,200
翻译中的文字
211
00:07:46,200 --> 00:07:47,160
让做出错误
212
00:07:47,160 --> 00:07:48,560
来看看结果
213
00:07:50,880 --> 00:07:52,080
如您所见
214
00:07:52,080 --> 00:07:53,280
编辑停止了
215
00:07:53,280 --> 00:07:54,160
由于错误
216
00:07:54,160 --> 00:07:56,080
结果无法展示
217
00:07:57,040 --> 00:07:58,120
在这个情况下
218
00:07:58,120 --> 00:07:58,680
使用了
219
00:07:58,680 --> 00:08:00,040
Pash翻译者
220
00:08:00,040 --> 00:08:01,440
而这个Echo功能
221
00:08:01,440 --> 00:08:03,800
是同样的.f
222
00:08:03,800 --> 00:08:05,000
让做出错误
223
00:08:05,000 --> 00:08:06,520
来看看结果
224
00:08:08,360 --> 00:08:09,600
在这个情况下
225
00:08:09,600 --> 00:08:10,200
您可以看到
226
00:08:10,200 --> 00:08:11,520
编辑停止了
227
00:08:11,520 --> 00:08:12,760
第一个表格
228
00:08:12,760 --> 00:08:14,640
并给予第二个表格的错误
229
00:08:14,640 --> 00:08:15,480
这就显示了
230
00:08:15,480 --> 00:08:17,120
编辑停止的方式
231
00:08:17,800 --> 00:08:19,600
看完刚才YouTube的视频
232
00:08:19,600 --> 00:08:20,800
其实大致了解了
233
00:08:20,800 --> 00:08:22,000
解析器和编译器的
234
00:08:22,000 --> 00:08:23,640
一个简单的差异
235
00:08:23,640 --> 00:08:25,280
现在来汇总一下
236
00:08:25,920 --> 00:08:26,840
首先看看
237
00:08:26,840 --> 00:08:28,160
左边的解析器
238
00:08:28,400 --> 00:08:30,000
解析器其实是不产生
239
00:08:30,000 --> 00:08:31,440
任何中间的代码的
240
00:08:31,440 --> 00:08:32,880
而编译器是产生一个
241
00:08:32,880 --> 00:08:34,440
中间的目标代码
242
00:08:35,040 --> 00:08:37,000
解析器在解析程序的时候
243
00:08:37,120 --> 00:08:39,000
是一行一行解析的
244
00:08:39,200 --> 00:08:40,160
在编译器里面
245
00:08:40,520 --> 00:08:42,600
它首先把程序进行编译
246
00:08:42,600 --> 00:08:44,160
编译成一个二进制的包
247
00:08:44,160 --> 00:08:45,920
然后机器再去执行
248
00:08:46,200 --> 00:08:47,320
二进制的包
249
00:08:47,920 --> 00:08:49,160
所以在编译器里面
250
00:08:49,360 --> 00:08:50,960
程序的执行和编译