Upgrade to Pro — share decks privately, control downloads, hide ads and more …

疎行列圧縮フォーマットの紹介

 疎行列圧縮フォーマットの紹介

CompML勉強会での発表資料.
- 成分のほとんどがゼロであるような疎行列の圧縮フォーマットの紹介.
- 主要な圧縮フォーマット(CSR)を用いたSparse Matrix Vector Multiplicationの紹介.

ryoherisson

May 28, 2021
Tweet

More Decks by ryoherisson

Other Decks in Research

Transcript

  1. CompML %*"͕ෆద੾ͱͳΔέʔε ҎԼͷΑ͏ͳέʔεͰ͸ɼ%*"͸ෆద੾ͱͳΔɽ 7 0 0 0 0 1 0

    0 0 2 0 0 0 3 0 0 0 4 0 0 0 𝑑𝑎𝑡𝑎 = ∗ 4 ∗ ∗ ∗ ∗ 3 ∗ ∗ 2 ∗ ∗ 1 ∗ ∗ ∗ 𝑜𝑓𝑓𝑠𝑒𝑡 = −2 0 2 4 0 0 1 0 0 0 0 2 0 5 0 3 0 0 0 6 7 0 4 0 𝑑𝑎𝑡𝑎 = 6 ∗ ∗ ∗ ∗ 7 ∗ ∗ ∗ 3 ∗ ∗ ∗ ∗ ∗ 4 ∗ 2 ∗ ∗ 1 ∗ ∗ ∗ ∗ 5 ∗ ∗ 𝑜𝑓𝑓𝑠𝑒𝑡 = −3 −2 −1 0 1 2 3
  2. CompML $4$ $PNQSFTTFE4QBSTF$PMVNO $43ϑΥʔϚοτͰѹॖ͍ͯͨ͠ߦΠϯσοΫεͷ୅ΘΓʹɼྻΠϯσοΫεΛѹॖ͢Δܗࣜɽ 10 0 0 0 0 1

    5 8 0 0 0 0 0 3 0 0 0 6 0 0 1 𝑑𝑎𝑡𝑎 = 5 8 6 3 6 1 1 𝑐𝑜𝑙_𝑝𝑡𝑟 = 0 1 3 4 4 6 𝑟𝑜𝑤_𝑖𝑛𝑑 = 1 1 3 2 0 3   DPM@QUS   
  3. CompML &-- &--1"$, ͕ෆద੾ͱͳΔέʔε ߦ͝ͱͷඇθϩཁૉͷ࠷େ਺͕ฏۉ஋ͱେ͖͘ҟͳΔ৔߹͸ɼ&--͸ෆద੾ͳදݱํ๏ͱͳΔɽ ὎ &--ͱ$00ͷ૊Έ߹Θͤͷ)ZCSJEͱ͍͏ख๏ɽ 12 0 0

    0 0 1 5 8 3 7 2 0 0 4 9 0 0 6 0 0 0 𝑑𝑎𝑡𝑎 = 1 ∗ ∗ ∗ ∗ 5 8 3 7 2 4 9 ∗ ∗ ∗ 6 ∗ ∗ ∗ ∗ 𝑖𝑛𝑑𝑖𝑐𝑒𝑠 = 4 ∗ ∗ ∗ ∗ 0 1 2 3 4 2 3 ∗ ∗ ∗ 1 ∗ ∗ ∗ ∗ L  L  L  L  NBYL,BWFSBHFL
  4. CompML ):# )ZCSJE ඇθϩཁૉͷେ෦෼Λ&--ʹ֨ೲ͠ɼ࢒ΓΛ$00ʹ֨ೲ͢ΔϋΠϒϦουͳϑΥʔϚοτɽ 13 0 0 0 0 1

    5 8 3 7 2 0 0 4 9 0 0 6 0 0 0 𝑑𝑎𝑡𝑎 = 1 ∗ 5 8 4 9 6 ∗ 𝑖𝑛𝑑𝑖𝑐𝑒𝑠 = 4 ∗ 0 1 2 3 1 ∗ L  L  L  L  NBYL,BWFSBHFL ELL COO 𝑑𝑎𝑡𝑎 = 3 7 2 𝑟𝑜𝑤_𝑖𝑛𝑑 = 1 1 1 𝑐𝑜𝑙_𝑖𝑛𝑑 = 2 3 4
  5. CompML #439 &YUFOEFE#43 ͷར఺ CML@SPX@QSUͱCML@FOE@QUSΛมߋ͢Δ͚ͩͰɼݩͷߦྻͷҰ෦ͷϒϩοΫ͚ͩΛ࢒ͨ͠ߦྻΛ࡞Δ͜ͱ ͕Ͱ͖Δɽ 16 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 𝑏𝑙𝑘_𝑟𝑜𝑤_𝑝𝑡𝑟 = 0 2 𝑏𝑙𝑘_𝑐𝑜𝑙_𝑖𝑛𝑑 = 0 2 0 1 𝑑𝑎𝑡𝑎 = 0 0 5 8 1 0 0 2 0 0 0 6 3 0 0 0 𝑏𝑙𝑘_𝑒𝑛𝑑_𝑝𝑡𝑟 = 0 3
  6. CompML $4# $PNQSFTTFE4QBSTF#MPDLT ߦྻΛϒϩοΫʹ෼ׂɽඇθϩཁૉͷ஋͕֨ೲ͞Εͨσʔλ഑ྻɼϒϩοΫ಺ͰͷඇθϩཁૉͷߦΠϯ σοΫεɾྻΠϯσοΫεΛ֨ೲ͢Δ഑ྻɼ֤ϒϩοΫͷ࠷ॳʹग़ͯ͘Δඇθϩཁૉ͕ɼඇθϩཁૉશ ମͷԿ൪໨͔ද͢ΦϑηοτΛ֨ೲͨ͠ϒϩοΫϙΠϯλ഑ྻͰߏ੒͞ΕΔɽ సஔߦྻ΁ͷԠ༻΋Մೳɽ 17 0 0

    0 0 1 0 5 8 0 0 0 2 0 0 3 0 0 0 0 6 0 0 0 0   CML@QUS 𝑑𝑎𝑡𝑎 = 5 8 1 2 6 3 𝑏𝑙𝑘_𝑟𝑜𝑤_𝑖𝑛𝑑 = 1 1 0 1 1 0 𝑏𝑙𝑘_𝑐𝑜𝑙_𝑖𝑛𝑑 = 0 1 0 1 1 0 𝑏𝑙𝑘_𝑝𝑡𝑟 = 0 2 2 4 5 6 6     গͳ͍Ϗοτ਺Ͱ ූ߸Խ
  7. CompML ٖࣅίʔυ 19 #VMVÇ " 'JOFNBO +5 'SJHP . (JMCFSU

    +3 -FJTFSTPO $&  "VHVTU 1BSBMMFMTQBSTFNBUSJYWFDUPSBOENBUSJYUSBOTQPTFWFDUPSNVMUJQMJDBUJPOVTJOHDPNQSFTTFE TQBSTFCMPDLT*O1SPDFFEJOHTPGUIFUXFOUZGJSTUBOOVBMTZNQPTJVNPO1BSBMMFMJTNJOBMHPSJUINTBOEBSDIJUFDUVSFT QQ 
  8. CompML DV4QBSTFΛ࢖ͬͨ4Q.7 21  DV4QBSTFϋϯυϧ࡞੒  σόΠεϝϞϦ֬อ  σεΫϦϓλͷઃఆ 

    ϗετ͔ΒσόΠεʹϝϞϦΛίϐʔ  ඇθϩཁૉͷΧ΢ϯτ  %FOTF͔Β$43ʹม׵  ߦྻϕΫτϧ৐ࢉ  σόΠε͔Βϗετʹసૹʢ͜ͷ࣌఺Ͱ%FOTF ϑΥʔϚοτԽ͞ΕΔʣ  ϝϞϦղ์ ˞ ͸ίʔυলུ δϣϯ νΣϯ ΄͔ גࣜձࣾΫΠʔϒ ༁ $6%"$ϓϩϑΣογϣφϧϓϩάϥϛϯάΠϯϓϨε 
  9. CompML 3FGFSFODF • #FMM / (BSMBOE .  &GGJDJFOUTQBSTFNBUSJYWFDUPSNVMUJQMJDBUJPOPO$6%" 7PM

     /P /WJEJB5FDIOJDBM3FQPSU/73 /WJEJB$PSQPSBUJPO • #VMVÇ " 'JOFNBO +5 'SJHP . (JMCFSU +3 -FJTFSTPO $&  "VHVTU 1BSBMMFM TQBSTFNBUSJYWFDUPSBOENBUSJYUSBOTQPTFWFDUPSNVMUJQMJDBUJPOVTJOHDPNQSFTTFETQBSTF CMPDLT*O1SPDFFEJOHTPGUIFUXFOUZGJSTUBOOVBMTZNQPTJVNPO1BSBMMFMJTNJOBMHPSJUINTBOE BSDIJUFDUVSFT QQ  • +PIO$IFOH .BY(SPTTNBO 5Z.D,FSDIFS  1SPGFTTJPOBM$6%"$1SPHSBNNJOH8SPY δϣϯ νΣϯ ϚοΫε άϩεϚϯ λΠ ϚοΧʔνϟʔ גࣜձࣾΫΠʔϒ ༁   $6%" $ϓϩϑΣογϣφϧϓϩάϥϛϯάגࣜձࣾΠϯϓϨε 24