-
Notifications
You must be signed in to change notification settings - Fork 26
feat: 添加嵌入算子 #15
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
base: main
Are you sure you want to change the base?
feat: 添加嵌入算子 #15
Conversation
infiniop/ops/embed/README.md
Outdated
$$ Y = \alpha_1 \cdot table_1[i_1] + \alpha_2 \cdot table_2[i_2] $$ | ||
|
||
- 通常 $α$ 为 1; | ||
- 某一项的 $α$ 为 0、$table$ 为空或 $i$ 为空表示不使用; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table显示不正常。
建议只有table2可以为空
infiniop/ops/embed/README.md
Outdated
`infiniopCreateEmbedDescriptor` 指针,指向将被初始化的算子描述符地址; | ||
- `y_desc` - $\{ dT | (N, D) | (..., 1) \}$: | ||
算子输出 `y` 的张量描述; | ||
- `table1_desc` - $\{ dT | (..., D) | (..., 1) \}$: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个表可以是高维的吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不能,但是我还是不会写你这个语法
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是二维你可以随便写个字母,比如 (B,D)
infiniop/ops/embed/README.md
Outdated
算子输入 `table1` 的张量描述; | ||
- `table2_desc` - $\{ dT | (..., D) | (..., 1) \}$: | ||
算子输入 `table2` 的张量描述; | ||
- `i1_desc` - $\{ dT_i | (N) | (1) \}$: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类型叫dI吧,下标不好看。把可以为nullptr这事说一下,要求alpha2必须为0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那就是要求为空的时候几项必须对应同时表示空?也行
infiniop/ops/embed/README.md
Outdated
|
||
参数限制: | ||
|
||
- $dT$: 任意浮点类型; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是也可以支持其他类型
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只要支持乘加,可能是排除 bool 都行,但是不知道怎么表示
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
任意浮点数、整数、无符号整数类型?我觉得是不是bool也可以有啊
计算输出结果; | ||
- `table1`: | ||
第 1 个嵌入表; | ||
- `table2`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把可以为nullptr说一下
|
||
<div style="background-color: lightblue; padding: 1px;"> 返回值:</div> | ||
|
||
- [`INFINI_STATUS_SUCCESS`], [`INFINI_STATUS_BAD_PARAM`], [`INFINI_STATUS_BAD_TENSOR_SHAPE`], [`INFINI_STATUS_BAD_TENSOR_DTYPE`], [`INFINI_STATUS_BAD_TENSOR_STRIDES`], [`INFINI_STATUS_BAD_DEVICE`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加个 INFINI_STATUS_NULL_POINTER
5095b37
to
e75be11
Compare
infiniop/ops/embedding/README.md
Outdated
$$ Y = \alpha_1 \cdot table_1[i_1] + \alpha_2 \cdot table_2[i_2] $$ | ||
|
||
- 通常 $α$ 为 1; | ||
- $ table2 $ 可以不使用,则公式变为 $ Y = \alpha_1 \cdot table_1[i_1] $; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
显示不正常
infiniop/ops/embedding/README.md
Outdated
`infiniopHandle_t` 类型的硬件控柄。详情请看:[`InfiniopHandle_t`] | ||
- `desc_ptr`: | ||
`infiniopCreateEmbeddingDescriptor` 指针,指向将被初始化的算子描述符地址; | ||
- `y_desc` - $\{ dT | (N, D) | (..., 1) \}$: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个张量格式不需要用数学符号了,正常写就行
infiniop/ops/embed/README.md
Outdated
`infiniopCreateEmbedDescriptor` 指针,指向将被初始化的算子描述符地址; | ||
- `y_desc` - $\{ dT | (N, D) | (..., 1) \}$: | ||
算子输出 `y` 的张量描述; | ||
- `table1_desc` - $\{ dT | (..., D) | (..., 1) \}$: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是二维你可以随便写个字母,比如 (B,D)
infiniop/ops/embed/README.md
Outdated
|
||
参数限制: | ||
|
||
- $dT$: 任意浮点类型; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
任意浮点数、整数、无符号整数类型?我觉得是不是bool也可以有啊
Signed-off-by: YdrMaster <[email protected]>
aec7ab8
to
9bb9ffe
Compare
Signed-off-by: YdrMaster <[email protected]>
No description provided.