tensor-compiler / taco

The Tensor Algebra Compiler (taco) computes sparse tensor expressions on CPUs and GPUs
http://tensor-compiler.org
Other
1.23k stars 186 forks source link

Functional Programming #180

Open DJDDDM opened 5 years ago

DJDDDM commented 5 years ago

Just to be sure, I wanted to ask, if Taco supports functional programming in the following sense: I have two equations in a loop like for example: B(i,k)=A(i,j)D(j,k) A(i,j) = B(i,k)C(k,j) will that be the same as having one big equation (using nonindex notation for convenience): A=BCDCDCD*C therefore only when I call A.evaluate() (for example every ten loops (to check convergence for example)) something real happens. So that everything before is just accumulating the equation. This functionality would probably speed up our computations in quantum chemistry a lot. (at least if the current available Dense,Sparse Format is as fast as the usual Block Sparse Matrices. Even so one could probably implement the block sparse version as syntactic sugar based on higher-order tensors.) (I am not sure if I should open another Issue asking: Is it possible to limit a multiplication to a certain range without creating a tensor being a subtensor of the original tensor with that range?)

Oblynx commented 5 years ago

Hello, About multiplying only in a certain range, I was thinking that this should be done with selection matrices S: Let S with S(i,j) in {0,1} be 1 only in the valid combinations of indices (selected areas). Then, the total multiplication A(i,j)=B(i,k)C(k,j) could be restricted to a certain range by transforming it to A(i,j)=(S(i,k).B(i,k))*C(k,j)

On Tue, Jan 8, 2019, 10:21 Daniel Manz <notifications@github.com wrote:

Just to be sure, I wanted to ask, if Taco supports functional programming in the following sense: I have two equations in a loop like for example: B(i,k)=A(i,j)

D(j,k) A(i,j) = B(i,k)C(k,j) will that be the same as having one big equation (using nonindex notation for convenience): A=BCDCDCD*C therefore only when I call A.evaluate() (for example every ten loops (to check convergence for example)) something real happens. So that everything before is just accumulating the equation. This functionality would probably speed up our computations in quantum chemistry a lot. (at least if the current available Dense,Sparse Format is as fast as the usual Block Sparse Matrices. Even so one could probably implement the block sparse version as syntactic sugar based on higher-order tensors.) (I am not sure if I should open another Issue asking: Is it possible to limit a multiplication to a certain range without creating a tensor being a subtensor of the original tensor with that range?)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tensor-compiler/taco/issues/180, or mute the thread https://github.com/notifications/unsubscribe-auth/AE5KrQXYWLm5KGquG_sghhrQ3JOePR2qks5vBI06gaJpZM4Z1Xg_ .