跟讀練習: Mind-bending new programming language for GPUs just dropped... - 通過影片學習英語口語

選擇練習模式

每種模式都會開啟全屏練習室。

60 句
如果句子過短或過長,請點選 Edit 進行調整。
1
Yesterday, the clouds opened up, and a weird new programming language came down to Earth, with a promise of parallelism for all thou who writeth code.
2
This is big if true, because parallel computing is a superpower.
3
It allows a programmer to take a problem that could be solved in a week, and instead solve it in seven days using seven different computers.
4
Unfortunately, running code in parallel is like conducting a symphony.
5
One wrong note, and the entire thing becomes a total disaster.
6
But luckily, Bend offers hope by making a bold promise.
7
Everything that can run in parallel, will run in parallel.
8
You don't need to know anything about CUDA, blocks, locks, mutexes, or regexes to write algorithms that take advantage of all 24 of your CPU cores,
9
or even all 16 ,000 of your GPU cores.
10
You just write some high -level
11
Python -looking code, and the rest is magic.
12
It is May 17th, 2024, and you're watching the Code Report.
13
When you write code in a language like
14
Python, your code runs on a single thread.
15
That means only one thing can happen at a time.
16
It's like going to a KFC with only one employee who takes the order, cleans the toilets, and cooks the food in that order.
17
Now, on a modern CPU, you might have a clock cycle around 4 gigahertz, and if it's handling one instruction per cycle,
18
you're only able to perform 4 billion instructions per second.
19
Now, if 4 Gips is not enough, you can modify your Python code to take advantage of multiple threads,
20
but it adds a lot of complexity to your code.
21
And there's all kinds of gotchas, like race conditions, deadlocks, thread starvation, and may even lead to conflicts with demons.
22
Even if you do manage to get it working, you might find that your CPU just doesn't have enough juice at
23
which point you look into using the thousands of CUDA cores on your GPU.
24
But now you'll need to write some C++ code and likely blow your leg off in the process.
25
Well, what if there is a language that just knew how to run things in parallel by default?
26
That's the promise of Bend.
27
Imagine we have a computation that adds two completely random numbers together.
28
In Python, the interpreter is going to convert this into bytecode, and then eventually run it on the Python virtual machine.
29
Pretty simple, but in Bend, things are a little more complex.
30
The elements of the computation are structured into a graph, which are called interaction combinators.
31
You can think of it as a big network of all the computations that need to be done.
32
When two nodes run into each other, the computation progresses by following a simple set of rules
33
that rewrite the computation in a way that can be done in parallel.
34
It continues this pattern until all computations are done, then merges the result back into whatever expression was returned from the function.
35
This concept of interaction combinators goes all the way back to the 1990s, and is implemented in a runtime called the higher -order virtual machine.
36
HVM is not meant to be used directly, and that's why they built
37
Bend, a high -level language, to interface with it.
38
And the language itself is implemented in Rust.
39
Its syntax is very similar to Python, and we can write a hello world by defining a main function that returns a string.
40
Now to execute this code, we can pull up the terminal and use the ben run command.
41
By default, this is going to use the Rust interpreter, which will execute it sequentially, just like any other boring language.
42
But now here's where things get interesting.
43
Imagine we have an algorithm that needs to count a bunch of numbers and then add them together.
44
The first thing that might blow your mind is that bend does not have loops.
45
Like, we can't just do a for loop like we would in Python.
46
Instead, bend has something entirely different called a fold that works like a search and replace for data types.
47
And any algorithm that requires a loop can be replaced with a fold.
48
Basically, a fold allows you to consume recursive data types in parallel, like a list or a tree.
49
But first, we need to construct a recursive data type.
50
And for that, we have the bend keyword, which is like the opposite of fold.
51
Now, if that's a little too mind -bending, maybe check out my back catalog for recursion in 100 seconds.
52
But now let's see what this looks like from a performance standpoint.
53
When I try to run this algorithm on a single thread, it takes forever, like 10 minutes or more.
54
However, I can run the same code without any modification whatsoever with the bend run C command.
55
When I do that, it's now utilizing all 24 threads on my CPU.
56
And now it only takes about 30 seconds to run the computation.
57
That's a huge improvement, but I think we can still do better.
58
Because I'm a baller, I have an NVIDIA RTX 4090, and once again, I can run this code without any modification on CUDA with bendrun -cu.
59
And now this code only takes one and a half seconds to run, and I'll just go ahead and drop the mic right there.
60
This has been the Code Report, thanks for watching, and I will see you in the next one.

下載應用

流利口語所需的一切

AI 發音評分逐句打分
音標練習掌握每個音
詞彙學習建立你的詞庫
詞彙遊戲邊玩邊學

同頻道

FOR YOU

推薦影片

本課的詞彙與口語要點

這節口語課以影片“Mind-bending new programming language for GPUs just dropped..”為素材。 影片中反覆出現的詞有:code, bend, computation, Python, parallel。 這段影片共有 60 個句子、904 個單詞可供跟讀。 講話部分時長為 4:00。 說話人語速較快,每分鐘約 226 個詞,會出現較多連讀和弱讀。 只有 77% 的單詞屬於英語最常用的 3,000 詞,詞彙難度較高。

影片中的重點詞彙

影片中 15 個值得學習的單詞,附發音和釋義:

單詞發音釋義
bend 動詞/bɛnd/彎 /彎
parallel 形容詞/ˈpæ.ɹəˌlɛl/平行的
thread 名詞/ˈθɹɛd/線 /線
fold 動詞/ˈfəʊld/摺 /折, 折疊 /摺疊
algorithm 名詞/ˈælɡəɹɪðm̩/演算法, 演算法
loop 名詞/luːp/圈, 環 /環
solve 動詞/sɒlv/解決 /解決
default 名詞/dɪˈfɔlt/違約 /違約, 暴雷
interaction 名詞/ˌɪn.təˈɹæk.ʃən/相互作用
implement 動詞/ˈɪmpləmənt/實施 /實施, 執行 /執行
instruction 名詞/ɪnˈstɹʌkʃən/教導 /教導
execute 動詞/ˈɛksɪˌkjuːt/處決 /處決, 處死 /處死
cloud 名詞/ˈklaʊ̯d/йүн, 雲 /雲
element 名詞/ˈɛləmənt/要素
string 名詞/stɹɪŋ/線 /線

影片中出現的短語動詞

單詞發音釋義
check out 動詞退房
go ahead 動詞/ˌɡoʊ əˈhɛd/請便 /請便

影片中的語法

說話人最常用的結構,並附上影片中的原話:

結構影片中的用法
被動語態 be + 過去分詞 — 強調發生了什麼,而不是誰做的could be solved · are structured · be done
定語從句 who / which + 從句 — 補充說明人或事物graph, which are · interpreter, which will · keyword, which is

需要注意的發音

說話人用了 8 次縮略和弱讀形式,例如 you're, can't, doesn't。請按聽到的簡短形式來說。

  • “th” 音: thread /ˈθɹɛd/, algorithm /ˈælɡəɹɪðm̩/
  • “sh” 和 “zh” 音: interaction /ˌɪn.təˈɹæk.ʃən/, instruction /ɪnˈstɹʌkʃən/, modification /ˌmɑdɪfɪˈkeɪʃən/, starvation /stɑɹˈveɪʃən/, computation /ˌkɑmpjʊˈteɪʃn̩/
  • 長單詞——注意重音位置: interaction /ˌɪn.təˈɹæk.ʃən/, modification /ˌmɑdɪfɪˈkeɪʃən/, interpreter /ɪnˈtɝ.pɹɪ.tɚ/, complexity /kəmˈplɛk.sɪ.ti/, whatsoever /ˌ(h)wʌtsoʊˈɛvɚ/

中文母語者容易讀錯的音:

  • /v/ — 不要讀成 /w/,上齒輕觸下唇: solve /sɒlv/, virtual /ˈvɜɹt͡ʃuəl/, convert /kənˈvɝt/, whatsoever /ˌ(h)wʌtsoʊˈɛvɚ/, starvation /stɑɹˈveɪʃən/
  • 詞尾子音 — 要讀清楚,後面不要加母音: bend /bɛnd/, thread /ˈθɹɛd/, fold /ˈfəʊld/, loop /luːp/, solve /sɒlv/
  • /r/ 和 /l/ 的區別: parallel /ˈpæ.ɹəˌlɛl/, algorithm /ˈælɡəɹɪðm̩/, virtual /ˈvɜɹt͡ʃuəl/, parallelism /ˈpaɹəlɛlɪz(ə)m/

如何用這段影片練習

  1. 先完整聽一遍影片,不要開口,記下不認識的單詞。
  2. 先用 0.75 倍速逐句跟讀,熟練之後再回到正常速度。
  3. 錄下自己的聲音並與原聲對比,特別注意 bend, parallel, thread 這類單詞。

什麼是跟讀法?

跟讀法 (Shadowing) 是一種有科學依據的語言學習技巧,最初開發用於專業口譯員的培訓,並由多語言者Alexander Arguelles博士普及。這個方法簡單而強大:您在聽英語母語原聲的同時立即大聲重複——就像是一個延遲1-2秒緊跟說話者的影子。與被動聽力或語法練習不同,跟讀法強迫您的大腦和口腔肌肉同時處理並模模擬實的講話模式。研究表明它能顯著提高發音準確性,語調,節奏,連讀,聽力理解和口語流利度——使其成為雅思口語備考和真實英語交流最有效的方法之一。

影子跟讀法: 閱讀完整分步指南 →