tensor matrix products with a compressed sparse tensor
play

Tensor-Matrix Products with a Compressed Sparse Tensor Shaden Smith - PowerPoint PPT Presentation

Tensor-Matrix Products with a Compressed Sparse Tensor Shaden Smith George Karypis University of Minnesota Department of Computer Science & Engineering shaden@cs.umn.edu Tensor-Matrix Products with a Compressed Sparse Tensor 1 / 47


  1. Tensor-Matrix Products with a Compressed Sparse Tensor Shaden Smith George Karypis University of Minnesota Department of Computer Science & Engineering shaden@cs.umn.edu Tensor-Matrix Products with a Compressed Sparse Tensor 1 / 47 http://cs.umn.edu/~splatt/

  2. Tensor Introduction Tensors are the generalization of matrices to ≥ 3 D Tensors have m dimensions (or modes ) and are I 1 × . . . × I m . users items words Tensor-Matrix Products with a Compressed Sparse Tensor 2 / 47 http://cs.umn.edu/~splatt/

  3. Canonical Polyadic Decomposition (CPD) The CPD is an extension of the SVD to tensors We compute matrices A 1 , . . . , A m , each with F columns and λ , a vector of weights λ 1 λ F + · · · + ≈ Usually computed via alternating least squares (ALS) Tensor-Matrix Products with a Compressed Sparse Tensor 3 / 47 http://cs.umn.edu/~splatt/

  4. MTTKRP Matricized Tensor Times Khatri-Rao Product (MTTKRP) MTTKRP is the core computation of each iteration A 1 = X (1) ( A m � · · · � A 2 ) I 1 I 2 F X (1) I 1 I 1 I 2 ( A 3 � A 2 ) Tensor-Matrix Products with a Compressed Sparse Tensor 4 / 47 http://cs.umn.edu/~splatt/

  5. Related Work Tensor-Matrix Products with a Compressed Sparse Tensor 5 / 47 http://cs.umn.edu/~splatt/

  6. Uncompressed Tensors Stored as a list of coordinates ( i , j , k ) = v represents one nonzero ← A 1 ( i , :) ← A 1 ( i , :) + X ( i , j , k ) [ A 2 ( j , :) ∗ A 3 ( k , :)] Tensor-Matrix Products with a Compressed Sparse Tensor 6 / 47 http://cs.umn.edu/~splatt/

  7. Compressed Tensors SPLATT SPLATT uses a hierarchical storage scheme for 3D tensors This allows for operation reduction and coarse-grained parallelism ← Tensor-Matrix Products with a Compressed Sparse Tensor 7 / 47 http://cs.umn.edu/~splatt/

  8. Contributions Tensor-Matrix Products with a Compressed Sparse Tensor 8 / 47 http://cs.umn.edu/~splatt/

  9. Compressed Sparse Fiber (CSF) 1 2  i j k l  i 1 1 1 2     1 1 1 3 j 1 2 2     1 2 1 3   →   1 2 2 1 k 1 1 2 1 2     2 2 1 1     2 2 1 3 2 3 3 1 1 3 2   l 2 2 2 2 Tensor-Matrix Products with a Compressed Sparse Tensor 9 / 47 http://cs.umn.edu/~splatt/

  10. MTTKRP with a CSF Tensor Objective We want to perform MTTKRP on each tensor mode with only one CSF representation There are three types of nodes in a tree: root , internal , and leaf ◮ Each will have a tailored algorithm Tensor-Matrix Products with a Compressed Sparse Tensor 10 / 47 http://cs.umn.edu/~splatt/

  11. CSF-ROOT We do a depth-first traversal on the CSF structure Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 11 / 47 http://cs.umn.edu/~splatt/

  12. CSF-ROOT Inner products are accumulated in a buffer Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 12 / 47 http://cs.umn.edu/~splatt/

  13. CSF-ROOT Inner products are accumulated in a buffer Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 13 / 47 http://cs.umn.edu/~splatt/

  14. CSF-ROOT Hadamard products are then propagated up the CSF tree Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 14 / 47 http://cs.umn.edu/~splatt/

  15. CSF-ROOT Hadamard products are then propagated up the CSF tree Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 15 / 47 http://cs.umn.edu/~splatt/

  16. CSF-ROOT Results are accumulated when we reach the top Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 16 / 47 http://cs.umn.edu/~splatt/

  17. CSF-ROOT The traversal continues... Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 17 / 47 http://cs.umn.edu/~splatt/

  18. CSF-ROOT The traversal continues... Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 18 / 47 http://cs.umn.edu/~splatt/

  19. CSF-ROOT Partial results are kept in buffer Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 19 / 47 http://cs.umn.edu/~splatt/

  20. CSF-ROOT Inner products are accumulated in a buffer Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 20 / 47 http://cs.umn.edu/~splatt/

  21. CSF-ROOT Inner products are accumulated in a buffer Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 21 / 47 http://cs.umn.edu/~splatt/

  22. CSF-LEAF This time, Hadamard products are pushed down the tree Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 22 / 47 http://cs.umn.edu/~splatt/

  23. CSF-LEAF This time, Hadamard products are pushed down the tree Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 23 / 47 http://cs.umn.edu/~splatt/

  24. CSF-LEAF This time, Hadamard products are pushed down the tree Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 24 / 47 http://cs.umn.edu/~splatt/

  25. CSF-LEAF This time, Hadamard products are pushed down the tree Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 25 / 47 http://cs.umn.edu/~splatt/

  26. CSF-LEAF Leaves designate write locations Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 26 / 47 http://cs.umn.edu/~splatt/

  27. CSF-LEAF Leaves designate write locations Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 27 / 47 http://cs.umn.edu/~splatt/

  28. CSF-LEAF The traversal continues... Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 28 / 47 http://cs.umn.edu/~splatt/

  29. CSF-LEAF The traversal continues... Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 29 / 47 http://cs.umn.edu/~splatt/

  30. CSF-LEAF The traversal continues... Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 30 / 47 http://cs.umn.edu/~splatt/

  31. CSF-LEAF The traversal continues... Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 31 / 47 http://cs.umn.edu/~splatt/

  32. CSF-LEAF The traversal continues... Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 32 / 47 http://cs.umn.edu/~splatt/

  33. CSF-INTERNAL Internal nodes use a combination of CSF-ROOT and CSF-LEAF Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 33 / 47 http://cs.umn.edu/~splatt/

  34. CSF-INTERNAL Hadamard products are pushed down to the output level Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 34 / 47 http://cs.umn.edu/~splatt/

  35. CSF-INTERNAL CSF-ROOT next pulls up to the output level Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 35 / 47 http://cs.umn.edu/~splatt/

  36. CSF-INTERNAL CSF-ROOT next pulls up to the output level Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 36 / 47 http://cs.umn.edu/~splatt/

  37. CSF-INTERNAL CSF-ROOT next pulls up to the output level Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 37 / 47 http://cs.umn.edu/~splatt/

  38. CSF-INTERNAL CSF-ROOT next pulls up to the output level Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 38 / 47 http://cs.umn.edu/~splatt/

  39. CSF-INTERNAL CSF-ROOT next pulls up to the output level Z 1 A 1 A 2 A 3 A 4 1 2 1 1 2 2 3 3 1 Tensor-Matrix Products with a Compressed Sparse Tensor 39 / 47 http://cs.umn.edu/~splatt/

  40. Parallelism – Tiling A 1 A 3 A 2 Tensor-Matrix Products with a Compressed Sparse Tensor 40 / 47 http://cs.umn.edu/~splatt/

  41. Datasets Dataset I 1 I 2 I 3 nnz NELL-2 12K 9K 28K 77M Beer 33K 66K 960K 94M Netflix 480K 18K 2K 100M Delicious 532K 17M 3M 140M NELL-1 3M 2M 25M 143M Amazon 5M 18M 2M 1.7B Tensor-Matrix Products with a Compressed Sparse Tensor 41 / 47 http://cs.umn.edu/~splatt/

  42. Storage Comparison SPLATT COORD CSF-M CSF-T 99.3 10 2 51.9 47.5 36.4 Tensor storage (GB) 10 1 8.8 8.2 5.0 4.5 4.2 4.3 4.0 3.7 3.6 3.0 2.8 2.6 2.4 2.3 2.1 1.8 1.6 1.4 1.2 1.1 10 0 NELL-2 Beer Netflix Delicious NELL-1 Amazon Dataset Tensor-Matrix Products with a Compressed Sparse Tensor 42 / 47 http://cs.umn.edu/~splatt/

  43. CSF-ROOT 90 SPLATT CSF-M CSF-T 80 Speedup over COORD with 16 threads 70 60 50 40 30 20 10 0 NELL-2 Beer Netflix Delicious NELL-1 Amazon Dataset Tensor-Matrix Products with a Compressed Sparse Tensor 43 / 47 http://cs.umn.edu/~splatt/

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend