Skip to content

[doc] Generate IR conversion flow examples - #2665

Merged
antiagainst merged 4 commits into
iree-org:mainfrom
antiagainst:gen-flow-doc
Aug 6, 2020
Merged

antiagainst merged 4 commits into
iree-org:mainfrom
antiagainst:gen-flow-doc

Conversation

@antiagainst

Copy link
Copy Markdown
Member

This commit add IR conversion example generation to the doc
update bash script. It invokes iree-opt on selected IR inputs
and prints IR after each pass. This gives us a nice way to
understand how the pipeline works on real examples.

Closes #1586

This commit add IR conversion example generation to the doc
update bash script. It invokes iree-opt on selected IR inputs
and prints IR after each pass. This gives us a nice way to
understand how the pipeline works on real examples.
@antiagainst

Copy link
Copy Markdown
Member Author

@antiagainst antiagainst added the documentation ✏️ Improvements or additions to documentation label Jul 25, 2020
Comment thread iree/samples/ops/mhlo-dot.mlir Resolved
Comment thread iree/samples/ops/mhlo-conv.mlir Resolved
@hanhanW

hanhanW commented Jul 27, 2020

Copy link
Copy Markdown
Contributor

See an example here: https://antiagainst.github.io/iree/ir-examples/mhlo-dot-vulkan-spirv

This is awesome! One question, do we expect blank lines before and after the IR? I noticed that there are some blank lines right before the start of IR, eg,

IR Dump After mlir::iree_compiler::Shape::{anonymous}::ConvertShapeToShapex



module {
  func @dot(%arg0: tensor<32x1024xf32>, %arg1: tensor<1024x64xf32>) attributes {iree.module.export} {
    %cst = constant dense<4.095960e+02> : tensor<32x64xf32>
    %0 = "mhlo.dot"(%arg0, %arg1) : (tensor<32x1024xf32>, tensor<1024x64xf32>) -> tensor<32x64xf32>
    check.expect_almost_eq(%0, %cst) : tensor<32x64xf32>
    return
  }
}

@antiagainst

Copy link
Copy Markdown
Member Author

One question, do we expect blank lines before and after the IR?

It is a bit annoying to have those extra empty lines but to remove them it means we need to be smart in the bash script.. I'd prefer to not do that and keep the bash script simple to reduce maintenance cost.

@antiagainst
antiagainst requested a review from hanhanW July 27, 2020 16:34
@antiagainst

Copy link
Copy Markdown
Member Author

@ScottTodd: I'd like to also add the MNIST as an example but I find that it's outdated. Could you refresh it?

@antiagainst

Copy link
Copy Markdown
Member Author

Note that now this compiles iree-opt with GitHub Actions.. I'll have a follow-up pull request to change the action to be on schedule instead of running for every commit. Doc publication lagging a bit behind is fine.

@hanhanW

hanhanW commented Jul 27, 2020 •

Copy link
Copy Markdown
Contributor

One question, do we expect blank lines before and after the IR?

It is a bit annoying to have those extra empty lines but to remove them it means we need to be smart in the bash script.. I'd prefer to not do that and keep the bash script simple to reduce maintenance cost.

Sounds good to me. This is optional, how about adding sed '/^$/N;/^\n$/D' to replace multiple empty lines with exactly one empty line? Ie, replace l.116 with ${tmpfile} | sed ... >> ${filepath} in build_docs.sh

-mlir-disable-threading \
${example} 1>/dev/null 2>${tmpfile}
sed 's!^// \*\*\* IR Dump After \(.*\) \*\*\*$!```\n### IR Dump After \1\n```!' \
${tmpfile} >> ${filepath}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How large are these files? I expect we'll run into limits both in git and gh-pages if we're regularly updating multi-megabyte files.

I see that you want to keep the pipeline simple, but some details in the IR could be elided to keep the webpage size manageable (for automation and reading)

Think anyone will be scrolling horizontally to read each value in this vector<8220xi8>?

    vm.rodata @_predict_ex_dispatch_119_ex_dispatch_0_binary_llvm dense<"0x100000004C4C564D08000C000400080008000000D41F000004000000C61F00003B204D6F64756C654944203D20274C4C564D4469616C6563744D6F64756C65270A736F757263655F66696C656E616D65203D20224C4C564D4469616C6563744D6F64756C65220A0A3B2046756E6374696F6E2041747472733A206E6F66726565206E6F72656375727365206E6F756E77696E640A646566696E6520766F69642040707265646963745F65785F64697370617463685F3131395F65785F64697370617463685F302869382A2A206E6F6361707475726520726561646F6E6C792025302C206936342A206E6F6361707475726520726561646E6F6E6520253129206C6F63616C5F756E6E616D65645F616464722023302021646267202133207B0A2E70726568656164657231343A0A2020252E656C74203D20626974636173742069382A2A20253020746F20666C6F61742A2A2C20216462672021370A2020252E756E7061636B203D206C6F616420666C6F61742A2C20666C6F61742A2A20252E656C742C20616C69676E20382C20216462672021370A2020252E656C7432203D20676574656C656D656E7470747220696E626F756E64732069382A2C2069382A2A2025302C2069363420312C20216462672021370A20202532203D20626974636173742069382A2A20252E656C743220746F20666C6F61742A2A2C20216462672021370A2020252E756E7061636B33203D206C6F616420666C6F61742A2C20666C6F61742A2A2025322C20616C69676E20382C20216462672021370A2020252E656C7434203D20676574656C656D656E7470747220696E626F756E64732069382A2C2069382A2A2025302C2069363420322C20216462672021370A20202533203D20626974636173742069382A2A20252E656C743420746F20666C6F61742A2A2C20216462672021370A2020252E756E7061636B35203D206C6F616420666C6F61742A2C20666C6F61742A2A2025332C20616C69676E20382C20216462672021370A202025736365766765703138203D206269746361737420666C6F61742A20252E756E7061636B3520746F2069382A0A202063616C6C20766F696420406C6C766D2E6D656D7365742E703069382E6936342869382A206E6F6E6E756C6C20616C69676E20342064657265666572656E636561626C65283130303335322920257363657667657031382C20693820302C20693634203130303335322C2069312066616C7365292C20216462672021370A20206272206C6162656C20252E707265686561646572392C20216462672021370A0A2E707265686561646572393A20202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20252E70726568656164657231342C20253130360A20202534203D2070686920693634205B20302C20252E7072656865616465723134205D2C205B2025372C2025313036205D0A20202535203D206D756C206E7577206E7377206936342025342C20333538342C20216462672021390A20202536203D206D756C206E7577206E7377206936342025342C20343630382C20216462672021390A20202537203D20616464206E7577206E7377206936342025342C20312C20216462672021390A20202538203D206D756C206E7577206E7377206936342025372C20343630382C20216462672021390A20202539203D206D756C206936342025342C20343630382C20216462672021390A2020253130203D20616464206936342025392C20393231362C20216462672021390A20206272206C6162656C20252E707265686561646572382C20216462672021370A0A2E707265686561646572383A20202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20252E707265686561646572392C20253130340A2020253131203D2070686920693634205B20302C20252E70726568656164657239205D2C205B202531342C2025313034205D0A2020253132203D2073686C20693634202531312C20392C20216462672021390A2020253133203D20616464206E7577206E7377206936342025352C202531322C20216462672021390A2020253134203D20616464206E7577206E737720693634202531312C20312C20216462672021390A2020253135203D2073686C20693634202531342C20392C20216462672021390A2020253136203D2073686C20693634202531312C20392C20216462672021390A2020253137203D2061646420693634202531362C20313032342C20216462672021390A20206272206C6162656C20252E707265686561646572372C20216462672021370A0A2E707265686561646572373A20202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20252E707265686561646572382C20253130310A2020253138203D2070686920693634205B20302C20252E70726568656164657238205D2C205B20253130322C2025313031205D0A2020253139203D20616464206E7577206E737720693634202531332C202531382C20216462672021390A2020253230203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B352C20693634202531392C20216462672021390A2020252E707265203D206C6F616420666C6F61742C20666C6F61742A202532302C20616C69676E20342C20216462672021370A20206272206C6162656C20252E707265686561646572362C20216462672021370A0A2E707265686561646572363A20202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20252E707265686561646572372C20252E707265686561646572360A2020253231203D2070686920666C6F6174205B20252E7072652C20252E70726568656164657237205D2C205B202539382C20252E70726568656164657236205D2C20216462672021370A2020253232203D2070686920693634205B20302C20252E70726568656164657237205D2C205B202539392C20252E70726568656164657236205D0A2020253233203D2073686C20693634202532322C20392C20216462672021390A2020253234203D20616464206E7577206E737720693634202532332C202531382C20216462672021390A2020253235203D20616464206E7577206E737720693634202532322C2025362C20216462672021390A2020253236203D20616464206E7577206E737720693634202532352C202531322C20216462672021370A2020253237203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202532362C20216462672021370A2020253238203D206C6F616420666C6F61742C20666C6F61742A202532372C20616C69676E20342C20216462672021370A2020253239203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202532342C20216462672021370A2020253330203D206C6F616420666C6F61742C20666C6F61742A202532392C20616C69676E20342C20216462672021370A2020253331203D20666D756C20666C6F6174202532382C202533302C20216462672021370A2020253332203D206661646420666C6F6174202532312C202533312C20216462672021370A202073746F726520666C6F6174202533322C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253333203D20616464206E7577206E737720693634202532352C202531352C20216462672021370A2020253334203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202533332C20216462672021370A2020253335203D206C6F616420666C6F61742C20666C6F61742A202533342C20616C69676E20342C20216462672021370A2020253336203D20616464206E7577206E737720693634202532342C203236323134342C20216462672021370A2020253337203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202533362C20216462672021370A2020253338203D206C6F616420666C6F61742C20666C6F61742A202533372C20616C69676E20342C20216462672021370A2020253339203D20666D756C20666C6F6174202533352C202533382C20216462672021370A2020253430203D206661646420666C6F6174202533322C202533392C20216462672021370A202073746F726520666C6F6174202534302C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253431203D20616464206E7577206E737720693634202532352C202531372C20216462672021370A2020253432203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202534312C20216462672021370A2020253433203D206C6F616420666C6F61742C20666C6F61742A202534322C20616C69676E20342C20216462672021370A2020253434203D20616464206E7577206E737720693634202532342C203532343238382C20216462672021370A2020253435203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202534342C20216462672021370A2020253436203D206C6F616420666C6F61742C20666C6F61742A202534352C20616C69676E20342C20216462672021370A2020253437203D20666D756C20666C6F6174202534332C202534362C20216462672021370A2020253438203D206661646420666C6F6174202534302C202534372C20216462672021370A202073746F726520666C6F6174202534382C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253439203D20616464206E7577206E737720693634202532322C2025382C20216462672021390A2020253530203D20616464206E7577206E737720693634202532342C203738363433322C20216462672021390A2020253531203D20616464206E7577206E737720693634202534392C202531322C20216462672021370A2020253532203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202535312C20216462672021370A2020253533203D206C6F616420666C6F61742C20666C6F61742A202535322C20616C69676E20342C20216462672021370A2020253534203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202535302C20216462672021370A2020253535203D206C6F616420666C6F61742C20666C6F61742A202535342C20616C69676E20342C20216462672021370A2020253536203D20666D756C20666C6F6174202535332C202535352C20216462672021370A2020253537203D206661646420666C6F6174202534382C202535362C20216462672021370A202073746F726520666C6F6174202535372C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253538203D20616464206E7577206E737720693634202534392C202531352C20216462672021370A2020253539203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202535382C20216462672021370A2020253630203D206C6F616420666C6F61742C20666C6F61742A202535392C20616C69676E20342C20216462672021370A2020253631203D20616464206E7577206E737720693634202532342C20313034383537362C20216462672021370A2020253632203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202536312C20216462672021370A2020253633203D206C6F616420666C6F61742C20666C6F61742A202536322C20616C69676E20342C20216462672021370A2020253634203D20666D756C20666C6F6174202536302C202536332C20216462672021370A2020253635203D206661646420666C6F6174202535372C202536342C20216462672021370A202073746F726520666C6F6174202536352C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253636203D20616464206E7577206E737720693634202534392C202531372C20216462672021370A2020253637203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202536362C20216462672021370A2020253638203D206C6F616420666C6F61742C20666C6F61742A202536372C20616C69676E20342C20216462672021370A2020253639203D20616464206E7577206E737720693634202532342C20313331303732302C20216462672021370A2020253730203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202536392C20216462672021370A2020253731203D206C6F616420666C6F61742C20666C6F61742A202537302C20616C69676E20342C20216462672021370A2020253732203D20666D756C20666C6F6174202536382C202537312C20216462672021370A2020253733203D206661646420666C6F6174202536352C202537322C20216462672021370A202073746F726520666C6F6174202537332C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253734203D20616464206E7577206E737720693634202532322C202531302C20216462672021390A2020253735203D20616464206E7577206E737720693634202532342C20313537323836342C20216462672021390A2020253736203D20616464206E7577206E737720693634202537342C202531322C20216462672021370A2020253737203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202537362C20216462672021370A2020253738203D206C6F616420666C6F61742C20666C6F61742A202537372C20616C69676E20342C20216462672021370A2020253739203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202537352C20216462672021370A2020253830203D206C6F616420666C6F61742C20666C6F61742A202537392C20616C69676E20342C20216462672021370A2020253831203D20666D756C20666C6F6174202537382C202538302C20216462672021370A2020253832203D206661646420666C6F6174202537332C202538312C20216462672021370A202073746F726520666C6F6174202538322C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253833203D20616464206E7577206E737720693634202537342C202531352C20216462672021370A2020253834203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202538332C20216462672021370A2020253835203D206C6F616420666C6F61742C20666C6F61742A202538342C20616C69676E20342C20216462672021370A2020253836203D20616464206E7577206E737720693634202532342C20313833353030382C20216462672021370A2020253837203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202538362C20216462672021370A2020253838203D206C6F616420666C6F61742C20666C6F61742A202538372C20616C69676E20342C20216462672021370A2020253839203D20666D756C20666C6F6174202538352C202538382C20216462672021370A2020253930203D206661646420666C6F6174202538322C202538392C20216462672021370A202073746F726520666C6F6174202539302C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253931203D20616464206E7577206E737720693634202537342C202531372C20216462672021370A2020253932203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B2C20693634202539312C20216462672021370A2020253933203D206C6F616420666C6F61742C20666C6F61742A202539322C20616C69676E20342C20216462672021370A2020253934203D20616464206E7577206E737720693634202532342C20323039373135322C20216462672021370A2020253935203D20676574656C656D656E7470747220666C6F61742C20666C6F61742A20252E756E7061636B332C20693634202539342C20216462672021370A2020253936203D206C6F616420666C6F61742C20666C6F61742A202539352C20616C69676E20342C20216462672021370A2020253937203D20666D756C20666C6F6174202539332C202539362C20216462672021370A2020253938203D206661646420666C6F6174202539302C202539372C20216462672021370A202073746F726520666C6F6174202539382C20666C6F61742A202532302C20616C69676E20342C20216462672021370A2020253939203D20616464206E7577206E737720693634202532322C20312C20216462672021370A202025313030203D2069636D7020756C7420693634202532322C203531312C20216462672021370A2020627220693120253130302C206C6162656C20252E707265686561646572362C206C6162656C20253130312C20216462672021370A0A3130313A202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20252E707265686561646572360A202025313032203D20616464206E7577206E737720693634202531382C20312C20216462672021370A202025313033203D2069636D7020756C7420693634202531382C203531312C20216462672021370A2020627220693120253130332C206C6162656C20252E707265686561646572372C206C6162656C20253130342C20216462672021370A0A3130343A202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20253130310A202025313035203D2069636D7020756C7420693634202531312C20362C20216462672021370A2020627220693120253130352C206C6162656C20252E707265686561646572382C206C6162656C20253130362C20216462672021370A0A3130363A202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20253130340A202025313037203D2069636D7020756C74206936342025342C20362C20216462672021370A2020627220693120253130372C206C6162656C20252E707265686561646572392C206C6162656C20253130382C20216462672021370A0A3130383A202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020203B207072656473203D20253130360A202072657420766F69642C20216462672021370A7D0A0A3B2046756E6374696F6E2041747472733A206172676D656D6F6E6C79206E6F756E77696E642077696C6C72657475726E2077726974656F6E6C790A6465636C61726520766F696420406C6C766D2E6D656D7365742E703069382E6936342869382A206E6F636170747572652077726974656F6E6C792C2069382C206936342C20693120696D6D617267292023310A0A61747472696275746573202330203D207B206E6F66726565206E6F72656375727365206E6F756E77696E64207D0A61747472696275746573202331203D207B206172676D656D6F6E6C79206E6F756E77696E642077696C6C72657475726E2077726974656F6E6C79207D0A0A216C6C766D2E6462672E6375203D20217B21307D0A216C6C766D2E6D6F64756C652E666C616773203D20217B21327D0A0A2130203D2064697374696E637420214449436F6D70696C65556E6974286C616E67756167653A2044575F4C414E475F432C2066696C653A2021312C2070726F64756365723A20226D6C6972222C2069734F7074696D697A65643A20747275652C2072756E74696D6556657273696F6E3A20302C20656D697373696F6E4B696E643A2046756C6C4465627567290A2131203D2021444946696C652866696C656E616D653A20224C4C564D4469616C6563744D6F64756C65222C206469726563746F72793A20222F22290A2132203D20217B69333220322C202122446562756720496E666F2056657273696F6E222C2069333220337D0A2133203D2064697374696E63742021444953756270726F6772616D286E616D653A2022707265646963745F65785F64697370617463685F3131395F65785F64697370617463685F30222C206C696E6B6167654E616D653A2022707265646963745F65785F64697370617463685F3131395F65785F64697370617463685F30222C2073636F70653A206E756C6C2C2066696C653A2021342C206C696E653A20322C20747970653A2021352C2073636F70654C696E653A20322C207370466C6167733A2044495350466C6167446566696E6974696F6E207C2044495350466C61674F7074696D697A65642C20756E69743A2021302C2072657461696E65644E6F6465733A202136290A2134203D2021444946696C652866696C656E616D653A2022697265652F73616D706C65732F6F70732F6D686C6F2D636F6E762E6D6C6972222C206469726563746F72793A20222F686F6D652F72756E6E65722F776F726B2F697265652F6972656522290A2135203D20214449537562726F7574696E65547970652874797065733A202136290A2136203D20217B7D0A2137203D202144494C6F636174696F6E286C696E653A20322C20636F6C756D6E3A20382C2073636F70653A202138290A2138203D202144494C65786963616C426C6F636B46696C652873636F70653A2021332C2066696C653A2021342C206469736372696D696E61746F723A2030290A2139203D202144494C6F636174696F6E286C696E653A20302C2073636F70653A202138290A0000010000000400000025000000707265646963745F65785F64697370617463685F3131395F65785F64697370617463685F30000000"> : vector<8220xi8>

Even being more judicious about which passes are included and how the IR is presented, we could still end up with large files that may make more sense to store on GCS, git LFS, or some other place outside of this git repo.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. I'll change this to elide large element attributes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Even with -mlir-elide-elementsattrs-if-larger, the full IR dump produces large files, which will change on the website after most changes to the compiler (in MLIR or in IREE). Large, frequently updated files should be avoided in git, and GitHub Pages has pretty low usage limits.

We recommend repositories remain small, ideally less than 1 GB, and less than 5 GB is strongly recommended.

Some rough math: 1MB of autogenerated IR updated every commit over 1000 commits will be 1 GB. Compression helps, limiting the number of files helps, and using -mlir-elide-elementsattrs-if-larger to trim those files down in size helps, but we're still within reach of the limits of git and GitHub pages.

If gh-pages was updated less frequently (e.g. weekly) and we monitor the size of these files, I think we could make it work (until GitHub support notices our usage has started to reach the limits and asks us to scale back). Otherwise, these sorts of autogenerated artifacts should live outside of git.

@antiagainst antiagainst Aug 5, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good math, Scott! :D

Yeah I do have plans to reduce the frequency of updating gh-pages as noted earlier. It provides little value to be always up to date with the tip; some lagging behind is fine. I think GitHub Actions also provides a way to manually trigger if we really want to have something updated quickly.

I just checked: for the only example we want at the moment (dot.mlir), three generated files total at ~1.5MB. I'd assume subsequent changes be much smaller than this; it's not like we are gonna change the IR dramatically every round. Let's still estimate 1MB change every update because we might want multiple examples. Updating daily (excluding weekends) means 260 times per year. And let's assume 1/3 of the time it triggers real changes (which is probably still a very high estimation.) Then reading the 1GB limit gives us roughly 11 years.

Of course we can further reduce the frequency for the IR example dump and even detach it from the main doc update cycle by creating another GitHub Action. Or do shell smarts to filter CSE/etc. They can all buy us more time. I think it should also be possible to completely erase the history of a particular branch from Git when it become very large? We don't really care about the history on gh-pages.

But overall it does not seem that pressing to me to address these issues immediately. Having this content up online would be more helpful at the moment. I'll immediately reduce the update frequency down to daily afterwards, and we can monitor for a while how large per commit it is. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

SGTM. Please do reduce the frequency of updates.

Comment thread build_tools/cmake/build_docs.sh Resolved
${BUILD_DIR}/iree/tools/iree-opt \
-iree-transformation-pipeline \
-iree-hal-target-backends=${target} \
-print-ir-after-all \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

print-ir-after-all is certainly easiest to set up, but I have a few concerns with using it for demonstration:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd prefer to keep the full picture of all the passes run there so it's easier to contrast with the pipeline in source and also clear to see how the IR is being transformed. Deleting certain stages might be confusing for following the steps there.

Good point regarding adding comments to the passes! Also probably linking to the source code.. It needs some shell script magic though I think we can defer to the next step. :)

Comment thread build_tools/cmake/build_docs.sh Resolved
@antiagainst

Copy link
Copy Markdown
Member Author

Sounds good to me. This is optional, how about adding sed '/^$/N;/^\n$/D' to replace multiple empty lines with exactly one empty line? Ie, replace l.116 with ${tmpfile} | sed ... >> ${filepath} in build_docs.sh

Aha, thanks for the script! I'll add it.

@antiagainst
antiagainst merged commit 3863d14 into iree-org:main Aug 6, 2020
@antiagainst
antiagainst deleted the gen-flow-doc branch August 6, 2020 15:29
@hanhanW hanhanW mentioned this pull request Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation ✏️ Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an auto-generated doc for "the lifetime of a model in IREE compiler"

4 participants