Skip to content

Commit 601a656

Browse files
authored
Translate torchrec_tutorial #599 (#600)
* Translate torchrec_tutorial #599
1 parent c198460 commit 601a656

1 file changed

Lines changed: 72 additions & 86 deletions

File tree

โ€Žintermediate_source/torchrec_tutorial.rstโ€Ž

Lines changed: 72 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
Introduction to TorchRec
2-
========================
1+
TorchRec ์†Œ๊ฐœ
2+
============
33

44
.. tip::
5-
To get the most of this tutorial, we suggest using this
6-
`Colab Version <https://colab.research.google.com/github/pytorch/torchrec/blob/main/Torchrec_Introduction.ipynb>`__.
7-
This will allow you to experiment with the information presented below.
5+
์ด ํŠœํ† ๋ฆฌ์–ผ์„ ์ตœ๋Œ€ํ•œ ํ™œ์šฉํ•˜๋ ค๋ฉด ์ด
6+
`Colab ๋ฒ„์ „ <https://colab.research.google.com/github/pytorch/torchrec/blob/main/Torchrec_Introduction.ipynb>`__ ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
7+
์ด๋ฅผ ํ†ตํ•ด ์•„๋ž˜์— ์ œ์‹œ๋œ ์ •๋ณด๋ฅผ ์‹คํ—˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
88

9-
Follow along with the video below or on `youtube <https://www.youtube.com/watch?v=cjgj41dvSeQ>`__.
9+
์•„๋ž˜ ๋™์˜์ƒ์ด๋‚˜ `์œ ํŠœ๋ธŒ <https://www.youtube.com/watch?v=cjgj41dvSeQ>`__ ์—์„œ ๋”ฐ๋ผํ•ด๋ณด์„ธ์š”.
1010

1111
.. raw:: html
1212

1313
<div style="margin-top:10px; margin-bottom:10px;">
1414
<iframe width="560" height="315" src="https://www.youtube.com/embed/cjgj41dvSeQ" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
1515
</div>
1616

17-
Frequently, when building recommendation systems, we want to represent
18-
entities like products or pages with embeddings. For example, see Meta
19-
AIโ€™s `Deep learning recommendation
20-
model <https://arxiv.org/abs/1906.00091>`__, or DLRM. As the number of
21-
entities grow, the size of the embedding tables can exceed a single
22-
GPUโ€™s memory. A common practice is to shard the embedding table across
23-
devices, a type of model parallelism. To that end, TorchRec introduces
24-
its primary API
25-
called |DistributedModelParallel|_,
26-
or DMP. Like PyTorchโ€™s DistributedDataParallel, DMP wraps a model to
27-
enable distributed training.
17+
์ถ”์ฒœ ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค ๋•Œ, ์ œํ’ˆ์ด๋‚˜ ํŽ˜์ด์ง€์™€ ๊ฐ™์€ ๊ฐ์ฒด๋ฅผ ์ž„๋ฒ ๋”ฉ์œผ๋กœ ํ‘œํ˜„ํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค.
18+
Meta AI์˜ `๋”ฅ๋Ÿฌ๋‹ ์ถ”์ฒœ ๋ชจ๋ธ <https://arxiv.org/abs/1906.00091>`__ ๋˜๋Š” DLRM์„ ์˜ˆ๋กœ ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
19+
๊ฐ์ฒด์˜ ์ˆ˜๊ฐ€ ์ฆ๊ฐ€ํ•จ์— ๋”ฐ๋ผ, ์ž„๋ฒ ๋”ฉ ํ…Œ์ด๋ธ”์˜ ํฌ๊ธฐ๊ฐ€ ๋‹จ์ผ GPU์˜ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ดˆ๊ณผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
20+
์ผ๋ฐ˜์ ์ธ ๋ฐฉ๋ฒ•์€ ๋ชจ๋ธ ๋ณ‘๋ ฌํ™”์˜ ์ผ์ข…์œผ๋กœ, ์ž„๋ฒ ๋”ฉ ํ…Œ์ด๋ธ”์„ ์—ฌ๋Ÿฌ ๋””๋ฐ”์ด์Šค๋กœ ์ƒค๋”ฉ(shard)ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
21+
์ด๋ฅผ ์œ„ํ•ด, TorchRec์€ |DistributedModelParallel|_ ๋˜๋Š” DMP๋กœ ๋ถˆ๋ฆฌ๋Š” ์ฃผ์š”ํ•œ API๋ฅผ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค.
22+
PyTorch์˜ DistributedDataParallel์™€ ๊ฐ™์ด, DMP๋Š” ๋ถ„์‚ฐ ํ•™์Šต์„ ๊ฐ€๋Šฅํ•˜๊ฒŒํ•˜๊ธฐ ์œ„ํ•ด ๋ชจ๋ธ์„ ํฌ์žฅํ•ฉ๋‹ˆ๋‹ค.
2823

29-
Installation
30-
------------
24+
์„ค์น˜
25+
----
3126

32-
Requirements: python >= 3.7
27+
์š”๊ตฌ ์‚ฌํ•ญ: python >= 3.7
3328

34-
We highly recommend CUDA when using TorchRec. If using CUDA: cuda >= 11.0
29+
TorchRec์„ ์‚ฌ์šฉํ•  ๋•Œ๋Š” CUDA๋ฅผ ์ ๊ทน ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค. CUDA๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ: cuda >= 11.0
3530

3631

3732
.. code:: shell
@@ -42,22 +37,20 @@ We highly recommend CUDA when using TorchRec. If using CUDA: cuda >= 11.0
4237
pip3 install torchrec-nightly
4338
4439
45-
Overview
46-
--------
40+
๊ฐœ์š”
41+
----
4742

48-
This tutorial will cover three pieces of TorchRec: the ``nn.module`` |EmbeddingBagCollection|_, the |DistributedModelParallel|_ API, and
49-
the datastructure |KeyedJaggedTensor|_.
43+
์ด ํŠœํ† ๋ฆฌ์–ผ์—์„œ๋Š” TorchRec์˜ ``nn.module`` |EmbeddingBagCollection|_, |DistributedModelParallel|_ API,
44+
๋ฐ์ดํ„ฐ ๊ตฌ์กฐ |KeyedJaggedTensor|_ 3๊ฐ€์ง€ ๋‚ด์šฉ์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค.
5045

5146

52-
Distributed Setup
53-
~~~~~~~~~~~~~~~~~
47+
๋ถ„์‚ฐ ์„ค์ •
48+
~~~~~~~
5449

55-
We setup our environment with torch.distributed. For more info on
56-
distributed, see this
57-
`tutorial <https://pytorch.org/tutorials/beginner/dist_overview.html>`__.
50+
torch.distributed๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ™˜๊ฒฝ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๋ถ„์‚ฐ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ด
51+
`ํŠœํ† ๋ฆฌ์–ผ <https://pytorch.org/tutorials/beginner/dist_overview.html>`__ ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.
5852

59-
Here, we use one rank (the colab process) corresponding to our 1 colab
60-
GPU.
53+
์—ฌ๊ธฐ์„œ๋Š” 1๊ฐœ์˜ colab GPU์— ๋Œ€์‘ํ•˜๋Š” 1๊ฐœ์˜ ๋žญํฌ(colab ํ”„๋กœ์„ธ์Šค)๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
6154

6255
.. code:: python
6356
@@ -71,26 +64,25 @@ GPU.
7164
os.environ["MASTER_ADDR"] = "localhost"
7265
os.environ["MASTER_PORT"] = "29500"
7366
74-
# Note - you will need a V100 or A100 to run tutorial as as!
75-
# If using an older GPU (such as colab free K80),
76-
# you will need to compile fbgemm with the appripriate CUDA architecture
77-
# or run with "gloo" on CPUs
67+
# ์ฐธ๊ณ  - ํŠœํ† ๋ฆฌ์–ผ์„ ์‹คํ–‰ํ•˜๋ ค๋ฉด V100 ๋˜๋Š” A100์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค!
68+
# colab free K80๊ณผ ๊ฐ™์€ ์˜ค๋ž˜๋œ GPU๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด,
69+
# ์ ์ ˆํ•œ CUDA ์•„ํ‚คํ…์ฒ˜๋กœ fbgemm๋ฅผ ์ปดํŒŒ์ผํ•˜๊ฑฐ๋‚˜,
70+
# CPU์—์„œ "gloo"๋กœ ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
7871
dist.init_process_group(backend="nccl")
7972
8073
81-
From EmbeddingBag to EmbeddingBagCollection
82-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74+
EmbeddingBag์—์„œ EmbeddingBagCollection์œผ๋กœ
75+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8376

84-
PyTorch represents embeddings through |torch.nn.Embedding|_ and |torch.nn.EmbeddingBag|_.
85-
EmbeddingBag is a pooled version of Embedding.
77+
PyTorch๋Š” |torch.nn.Embedding|_ ์™€ |torch.nn.EmbeddingBag|_ ๋ฅผ ํ†ตํ•ด ์ž„๋ฒ ๋”ฉ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
78+
EmbeddingBag์€ ์ž„๋ฒ ๋”ฉ์˜ ํ’€(pool) ๋ฒ„์ „์ž…๋‹ˆ๋‹ค.
8679

87-
TorchRec extends these modules by creating collections of embeddings. We
88-
will use |EmbeddingBagCollection|_ to represent a group of EmbeddingBags.
80+
TorchRec์€ ์ž„๋ฒ ๋”ฉ ์ปฌ๋ ‰์…˜์„ ์ƒ์„ฑํ•˜์—ฌ ์ด ๋ชจ๋“ˆ๋“ค์„ ํ™•์žฅํ•ฉ๋‹ˆ๋‹ค.
81+
EmbeddingBag ๊ทธ๋ฃน์„ ๋‚˜ํƒ€๋‚ด๊ณ ์ž |EmbeddingBagCollection|_ ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
8982

90-
Here, we create an EmbeddingBagCollection (EBC) with two embedding bags.
91-
Each table, ``product_table`` and ``user_table``, is represented by a 64
92-
dimension embedding of size 4096. Note how we initially allocate the EBC
93-
on device โ€œmetaโ€. This will tell EBC to not allocate memory yet.
83+
์—ฌ๊ธฐ์„œ๋Š”, 2๊ฐœ์˜ EmbeddingBag์„ ๊ฐ€์ง€๋Š” EmbeddingBagCollection (EBC)์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
84+
๊ฐ ํ…Œ์ด๋ธ” ``product_table`` ๊ณผ ``user_table`` ๋Š” 4096 ํฌ๊ธฐ์˜ 64 ์ฐจ์› ์ž„๋ฒ ๋”ฉ์œผ๋กœ ํ‘œํ˜„๋ฉ๋‹ˆ๋‹ค.
85+
โ€œmetaโ€ ๋””๋ฐ”์ด์Šค์—์„œ EBC๋ฅผ ์ดˆ๊ธฐ์— ํ• ๋‹นํ•˜๋Š” ๋ฐฉ๋ฒ•์— ์ฃผ์˜ํ•˜์„ธ์š”. EBC์—๊ฒŒ ์•„์ง ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ํ• ๋‹น๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
9486

9587
.. code:: python
9688
@@ -118,16 +110,15 @@ on device โ€œmetaโ€. This will tell EBC to not allocate memory yet.
118110
DistributedModelParallel
119111
~~~~~~~~~~~~~~~~~~~~~~~~
120112

121-
Now, weโ€™re ready to wrap our model with |DistributedModelParallel|_ (DMP). Instantiating DMP will:
113+
์ด์ œ ๋ชจ๋ธ์„ |DistributedModelParallel|_ (DMP)๋กœ ๊ฐ์Œ€ ์ค€๋น„๊ฐ€ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
114+
DMP์˜ ์ธ์Šคํ„ด์Šคํ™”๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
122115

123-
1. Decide how to shard the model. DMP will collect the available
124-
โ€˜shardersโ€™ and come up with a โ€˜planโ€™ of the optimal way to shard the
125-
embedding table(s) (i.e., the EmbeddingBagCollection).
126-
2. Actually shard the model. This includes allocating memory for each
127-
embedding table on the appropriate device(s).
116+
1. ๋ชจ๋ธ์„ ์ƒค๋”ฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค. DMP๋Š” ์ด์šฉ ๊ฐ€๋Šฅํ•œ โ€˜shardersโ€™๋ฅผ ์ˆ˜์ง‘ํ•˜๊ณ 
117+
์ž„๋ฒ ๋”ฉ ํ…Œ์ด๋ธ”์„ ์ƒค๋”ฉํ•˜๋Š” ์ตœ์ ์˜ ๋ฐฉ๋ฒ• (์ฆ‰, the EmbeddingBagCollection)์˜ โ€˜planโ€™์„ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.
118+
2. ๋ชจ๋ธ์„ ์ƒค๋”ฉํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ณผ์ •์€ ๊ฐ ์ž„๋ฒ ๋”ฉ ํ…Œ์ด๋ธ”์„ ์ ์ ˆํ•œ ์žฅ์น˜๋กœ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ํ• ๋‹นํ•˜๋Š” ๊ฒƒ์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
128119

129-
In this toy example, since we have two EmbeddingTables and one GPU,
130-
TorchRec will place both on the single GPU.
120+
์ด ์˜ˆ์ œ์—์„œ๋Š” 2๊ฐœ์˜ EmbeddingTables๊ณผ ํ•˜๋‚˜์˜ GPU๊ฐ€ ์žˆ๊ธฐ ๋•Œ๋ฌธ์—,
121+
TorchRec์€ ๋ชจ๋‘ ๋‹จ์ผ GPU์— ๋ฐฐ์น˜ํ•ฉ๋‹ˆ๋‹ค.
131122

132123
.. code:: python
133124
@@ -136,15 +127,14 @@ TorchRec will place both on the single GPU.
136127
print(model.plan)
137128
138129
139-
Query vanilla nn.EmbeddingBag with input and offsets
140-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130+
์ž…๋ ฅ๊ณผ ์˜คํ”„์…‹์ด ์žˆ๋Š” ๊ธฐ๋ณธ nn.EmbeddingBag ์งˆ์˜
131+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141132

142-
We query |nn.Embedding|_ and |nn.EmbeddingBag|_
143-
with ``input`` and ``offsets``. Input is a 1-D tensor containing the
144-
lookup values. Offsets is a 1-D tensor where the sequence is a
145-
cumulative sum of the number of values to pool per example.
133+
``input`` ๊ณผ ``offsets`` ์ด ์žˆ๋Š” |nn.Embedding|_ ๊ณผ |nn.EmbeddingBag|_ ๋ฅผ ์งˆ์˜ํ•ฉ๋‹ˆ๋‹ค.
134+
์ž…๋ ฅ์€ lookup ๊ฐ’์„ ํฌํ•จํ•˜๋Š” 1-D ํ…์„œ์ž…๋‹ˆ๋‹ค.
135+
์˜คํ”„์…‹์€ ์‹œํ€€์Šค๊ฐ€ ๊ฐ ์˜ˆ์ œ์—์„œ ๊ฐ€์ ธ์˜ค๋Š” ๊ฐ’์˜ ์ˆ˜์˜ ํ•ฉ์ธ 1-D ํ…์„œ์ž…๋‹ˆ๋‹ค.
146136

147-
Letโ€™s look at an example, recreating the product EmbeddingBag above:
137+
์œ„์˜ EmbeddingBag์„ ๋‹ค์‹œ ๋งŒ๋“ค์–ด๋ณด๋Š” ์˜ˆ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
148138

149139
::
150140

@@ -162,18 +152,15 @@ Letโ€™s look at an example, recreating the product EmbeddingBag above:
162152
product_eb(input=torch.tensor([101, 202, 303]), offsets=torch.tensor([0, 2, 2]))
163153
164154
165-
Representing minibatches with KeyedJaggedTensor
166-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155+
KeyedJaggedTensor๋กœ ๋ฏธ๋‹ˆ ๋ฐฐ์น˜ ํ‘œํ˜„ํ•˜๊ธฐ
156+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167157

168-
We need an efficient representation of multiple examples of an arbitrary
169-
number of entity IDs per feature per example. In order to enable this
170-
โ€œjaggedโ€ representation, we use the TorchRec datastructure
171-
|KeyedJaggedTensor|_ (KJT).
158+
์˜ˆ์ œ ๋ฐ ๊ธฐ๋Šฅ๋ณ„๋กœ ๊ฐ์ฒด ID๊ฐ€ ์ž„์˜์˜ ์ˆ˜์ธ ๋‹ค์–‘ํ•œ ์˜ˆ์ œ๋ฅผ ํšจ์œจ์ ์œผ๋กœ ๋‚˜ํƒ€๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
159+
๋‹ค์–‘ํ•œ ํ‘œํ˜„์ด ๊ฐ€๋Šฅํ•˜๋„๋ก, TorchRec ๋ฐ์ดํ„ฐ๊ตฌ์กฐ |KeyedJaggedTensor|_ (KJT)๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
172160

173-
Letโ€™s take a look at how to lookup a collection of two embedding
174-
bags, โ€œproductโ€ and โ€œuserโ€. Assume the minibatch is made up of three
175-
examples for three users. The first of which has two product IDs, the
176-
second with none, and the third with one product ID.
161+
โ€œproductโ€ ์™€ โ€œuserโ€, 2๊ฐœ์˜ EmbeddingBag์˜ ์ปฌ๋ ‰์…˜์„ ์ฐธ์กฐํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค.
162+
๋ฏธ๋‹ˆ๋ฐฐ์น˜๊ฐ€ 3๋ช…์˜ ์‚ฌ์šฉ์ž์™€ 3๊ฐœ์˜ ์˜ˆ์ œ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค.
163+
์ฒซ ๋ฒˆ์งธ๋Š” 2๊ฐœ์˜ product ID๋ฅผ ๊ฐ€์ง€๊ณ , ๋‘ ๋ฒˆ์งธ๋Š” ์•„๋ฌด๊ฒƒ๋„ ๊ฐ€์ง€์ง€ ์•Š๊ณ , ์„ธ ๋ฒˆ์งธ๋Š” ํ•˜๋‚˜์˜ product ID๋ฅผ ๊ฐ€์ง‘๋‹ˆ๋‹ค.
177164

178165
::
179166

@@ -185,7 +172,7 @@ second with none, and the third with one product ID.
185172
| [303] | [606] |
186173
|------------|------------|
187174

188-
The query should be:
175+
์งˆ์˜๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
189176

190177
.. code:: python
191178
@@ -198,34 +185,33 @@ The query should be:
198185
print(mb.to(torch.device("cpu")))
199186
200187
201-
Note that the KJT batch size is
202-
``batch_size = len(lengths)//len(keys)``. In the above example,
203-
batch_size is 3.
188+
KJT ๋ฐฐ์น˜ ํฌ๊ธฐ๋Š” ``batch_size = len(lengths)//len(keys)`` ์ธ ๊ฒƒ์„ ๋ˆˆ์—ฌ๊ฒจ๋ด ์ฃผ์„ธ์š”.
189+
์œ„ ์˜ˆ์ œ์—์„œ batch_size๋Š” 3์ž…๋‹ˆ๋‹ค.
204190

205191

206192

207-
Putting it all together, querying our distributed model with a KJT minibatch
208-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
193+
์ด์ •๋ฆฌํ•˜์—ฌ, KJT ๋ฏธ๋‹ˆ๋ฐฐ์น˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ถ„์‚ฐ ๋ชจ๋ธ ์งˆ์˜ํ•˜๊ธฐ
194+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209195

210-
Finally, we can query our model using our minibatch of products and
211-
users.
196+
๋งˆ์ง€๋ง‰์œผ๋กœ ์ œํ’ˆ๊ณผ ์‚ฌ์šฉ์ž์˜ ๋ฏธ๋‹ˆ๋ฐฐ์น˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋ธ์„ ์งˆ์˜ํ•ฉ๋‹ˆ๋‹ค.
212197

213-
The resulting lookup will contain a KeyedTensor, where each key (or
214-
feature) contains a 2D tensor of size 3x64 (batch_size x embedding_dim).
198+
๊ฒฐ๊ณผ ์กฐํšŒ๋Š” KeyedTensor๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
199+
๊ฐ ํ‚ค(key) ๋˜๋Š” ํŠน์ง•(feature)์€ ํฌ๊ธฐ๊ฐ€ 3x64 (batch_size x embedding_dim)์ธ
200+
2D ํ…์„œ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
215201

216202
.. code:: python
217203
218204
pooled_embeddings = model(mb)
219205
print(pooled_embeddings)
220206
221207
222-
More resources
223-
--------------
208+
์ถ”๊ฐ€ ์ž๋ฃŒ
209+
---------
224210

225-
For more information, please see our
211+
์ž์„ธํ•œ ๋‚ด์šฉ์€
226212
`dlrm <https://github.com/pytorch/torchrec/tree/main/examples/dlrm>`__
227-
example, which includes multinode training on the criteo terabyte
228-
dataset, using Metaโ€™s `DLRM <https://arxiv.org/abs/1906.00091>`__.
213+
์˜ˆ์ œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”. ์ด ์˜ˆ์ œ๋Š” Meta์˜ `DLRM <https://arxiv.org/abs/1906.00091>`__ ์„ ์‚ฌ์šฉํ•˜์—ฌ
214+
1ํ…Œ๋ผ๋ฐ”์ดํŠธ ๋ฐ์ดํ„ฐ์…‹์— ๋Œ€ํ•œ ๋ฉ€ํ‹ฐ ๋…ธ๋“œ ํ•™์Šต์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
229215

230216

231217
.. |DistributedModelParallel| replace:: ``DistributedModelParallel``

0 commit comments

Comments
ย (0)