Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oneembedding concept #502

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Oneembedding concept #502

wants to merge 3 commits into from

Conversation

ShawnXuan
Copy link
Collaborator

在oneembedding的文档里增加了嵌入表和持久化存储概念的解释。

Copy link
Collaborator

@doombeaker doombeaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我总体上觉得新增的内容其实是没有必要的。因为不符合这篇 “how to”类型文章的目的:让用户用起来。

新增的内容多了若干个概念,但是和操作都没有太多关系。不知道是应该不添加它们,还是补充几个代码例子比较好。

PS:因为觉得还在讨论是否新增内容,所以没细致 review 格式,如果确认需要新增这些内容,还有格式问题需要 review 完再合并。

@@ -211,6 +211,62 @@ OneEmbedding 同 OneFlow 的其它模块类似,都原生支持分布式扩展
- `store_options` 配置中参数 `persistent_path` 指定存储的路径。在并行场景中,它既可以是一个表示路径的字符串,也可以是一个 `list`。若配置为一个代表路径的字符串,它代表分布式并行中各 rank 下的根目录。OneFlow 会在这个根路径下,依据各个 rank 的编号创建存储路径,名称格式为 `rank_id-num_rank`。若`persistent_path` 是一个 `list`,则会依据列表中的每项,为 rank 单独配置。
- 在并行场景中,`store_options` 配置中的 `capacity` 代表词表总容量,而不是每个 rank 的容量。`cache_budget_mb` 代表每个 GPU 设备的显存。

### EmbeddingTable与MultiTableEmbedding
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### EmbeddingTable与MultiTableEmbedding
### EmbeddingTable 与 MultiTableEmbedding

### EmbeddingTable与MultiTableEmbedding
在OneEmbedding中嵌入表(EmbeddingTable)既可以是一个从索引映射到稠密向量的查找表,也可以是一个键值对(key value pair)查找表。在一些场景中,可能会用到多个嵌入表,比如在推荐系统中,每一个特征都对应一张嵌入表。如果在模型中使用多张嵌入表,查表的性能一般比较低,OneEmbedding推荐把多张表合成一张表使用的做法,只需要保证多张表的id或者key不重复即可,这里被称为多表嵌入(MultiTableEmbedding)。
用户在使用MultiTableEmbedding的时候,可能与普通的EmbeddingTable有不同,比如:
- 制作数据集的时候要注意不同表的id或者key不能重复;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

多个表的 id 不能重复,和已有的内容是不是重复了。

在OneEmbedding中嵌入表(EmbeddingTable)既可以是一个从索引映射到稠密向量的查找表,也可以是一个键值对(key value pair)查找表。在一些场景中,可能会用到多个嵌入表,比如在推荐系统中,每一个特征都对应一张嵌入表。如果在模型中使用多张嵌入表,查表的性能一般比较低,OneEmbedding推荐把多张表合成一张表使用的做法,只需要保证多张表的id或者key不重复即可,这里被称为多表嵌入(MultiTableEmbedding)。
用户在使用MultiTableEmbedding的时候,可能与普通的EmbeddingTable有不同,比如:
- 制作数据集的时候要注意不同表的id或者key不能重复;
- 不同表所期待的初始化方式可能不同。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上,这个使用的注意事项文中已经提过了。

image

- 不同表所期待的初始化方式可能不同。

### 持久化存储
训练好的嵌入表需要被持久化的保存下来,在配置分层存储时,会被要求配置持久化存储目录(persistent_path),OneEmbedding将模型数据保存到这个目录中,不过保存方式和其他variable有不同。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这篇文章定位是 “how to” 的话,我觉得这节的内容风格更倾向于“介绍概念”,但是我觉得这些概念和操作关系不大。

即,不知道他们,用户也可以用。知道他们后,好像也不能更好的操作什么东西。

我不知道是这一节的内容没有必要添加,还是说这一节内容应该多配些 how to 的例子,才有意义。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants