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

einsum functor #5985

Closed
wants to merge 3 commits into from
Closed

einsum functor #5985

wants to merge 3 commits into from

Conversation

wangyuyue
Copy link

This enables users to construct complex tensor computations given the text description in Einstein summation format.
TODO: some steps in the current implementation need new operators' support, e.g. diagonal operation for any two dimensions.

@CLAassistant
Copy link

CLAassistant commented Aug 21, 2021

CLA assistant check
All committers have signed the CLA.

out_shape[i] = permuted_operands[dim_last_op[i]]->dim(i);
}
return std::shared_ptr<Tensor>();
// TODO: need function supporting construct zeros tensor with shape
Copy link
Collaborator

Choose a reason for hiding this comment

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

ConstantFunctor 可以吗

@@ -1049,6 +1049,10 @@
SbpList sbp_tuple, DataType dtype=None, Generator generator=None)"
bind_python: True

- name: "einsum"
signature: "Tensor EinSum(String einsum_formula, TensorTuple inputs)"
Copy link
Contributor

Choose a reason for hiding this comment

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

注意一下新版functional接口的规范,https://github.com/Oneflow-Inc/oneflow/wiki/Functional-Interface,改成下面的定义,

  signature: "Tensor (String einsum_formula, TensorTuple inputs) => EinSum"


// Multiply tensors and sum out dimensions in sum_dims
if (sum_dims.empty()) {
result = JUST(Multiply(result, operand));
Copy link
Contributor

Choose a reason for hiding this comment

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

Multiply被重命名为Mul了

@SunDoge
Copy link

SunDoge commented Jan 23, 2022

Is there any progress?

@yuanms2
Copy link
Contributor

yuanms2 commented Jan 28, 2022

我们这个einsum 的完成度怎么样,还差多少工作量,感觉爱因斯坦求和用处还挺多的,alphafold 的实现就用了

@Ldpe2G
Copy link
Contributor

Ldpe2G commented Mar 7, 2022

@SunDoge oneflow already support einsum, you can have a try. #7526

@Ldpe2G Ldpe2G closed this Mar 7, 2022
@SunDoge
Copy link

SunDoge commented Mar 7, 2022

@Ldpe2G hi, I have already noticed your excellent pr yesterday. Nice work!

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.

7 participants