You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/faq.rst
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Frequently Asked Questions
4
4
How to work around GIL?
5
5
-----------------------
6
6
7
-
In Python, GIL (Global Interpreter Lock) practically prevents the use of multi-threading, however extension modules that are written in low-level languages, such as C, C++ and Rust, can release GIL when executing operations that do not interact with Python interpreter.
7
+
In Python, the GIL (Global Interpreter Lock) practically prevents the use of multi-threading. However, extension modules written in low-level languages such as C, C++, and Rust can release the GIL when executing operations that do not interact with the Python interpreter.
8
8
9
9
Many libraries used for data loading release the GIL. To name a few;
10
10
@@ -13,10 +13,9 @@ Many libraries used for data loading release the GIL. To name a few;
13
13
- Decord
14
14
- tiktoken
15
15
16
-
Typically, the bottleneck of model training in loading and pre-processing the media data.
17
-
So even though there are still parts of pipelines that are constrained by GIL,
18
-
by taking advantage of pre-processing functions that release GIL,
19
-
we can achieve high throughput.
16
+
Typically, the bottleneck in model training is loading and pre-processing media data.
17
+
Even though some parts of pipelines are constrained by the GIL,
18
+
we can achieve high throughput by using pre-processing functions that release the GIL.
20
19
21
20
What if a function does not release GIL?
22
21
----------------------------------------
@@ -59,7 +58,7 @@ This will build pipeline like the following.
59
58
``initializer`` and ``initargs`` arguments.
60
59
61
60
The values passed as ``initializer`` and ``initargs`` must be picklable.
62
-
If constructing an object in a process that does not support picke, then
61
+
If constructing an object in a process that does not support pickle, then
63
62
you can pass constructor arguments instead and store the resulting object
64
63
in global scope. See also https://stackoverflow.com/a/68783184/3670924.
0 commit comments