TUNGKOL SA EPISODE NA ITO
What is mobile selective build? Why are we so obsessed with reducing binary size? How does selective build work? Why doesn't static linking just work? Why can't you just read out the ops used in a TorchScript model to determine what operators you actually need? What are the tradeoffs of statically determining the operator dependency graph versus tracing? What's up with the SELECTIVE_NAME macro? How the heck does selective build work at all when you have multiple mobile apps in a single Buck build system? What takeaways should I have as a regular PyTorch developer?
Further reading:
- Official open source mobile documentation on custom selective builds https://pytorch.org/mobile/android/#custom-build
- How to rebuild the op dependency yaml https://github.com/pytorch/pytorch/blob/master/tools/code_analyzer/build.sh
Liner notes:
binary size is premium; ship only what you actually need
big idea:
- get the ops your model needs -> apply this to build of pytorch
get the ops your model needs
- TorchScript ~> read it out directly from the model itself
- but what if ops use other ops?
- need a dependency graph. done with static analysis llvm (jiakai) ~> with a (possibly inaccurate) yaml checked in for easy kickstart if you don't want to run the pass (updated by bot, not operational since Feb, recommend rebuilding from scratch if you run into trouble)
- other possibility: dynamic tracing
- pro: no need for dependency graph, just look at what was called; works for dtypes
- con: need representative inputs, if control flow might not cover everything
apply this to build of pytorch
- ordinarily: static linking ensures stuff that isn't used gets pruned
- but this doesn't work with distributed operator registration based on static initializers
- how?
- codegen - just don't generate it
- no codegen - SELECTIVE_NAME - C++ doesn't support string in macro
- build system integration
- buck constraint: only one library
- therefore: generate multiple copies of glue library
- alt: atomize library into each operator. caffe2 used to do this; each library takes a long time to build (1m) and crashes xcode because there's too many
- buck constraint: only one library
- ordinarily: static linking ensures stuff that isn't used gets pruned
common hiccups
- modify implementation details, some op is/isn't called anymore ~> error! usually just means some yaml needs regenerating. PyTorch Edge developers are very friendly and can help
Ingles
Estados Unidos
SA EPISODE NA ITO
KOPYA NG SALIN 🔗
Are you the producer of this podcast?
Add a podcast transcript
Need Audio-to-Text?
Transcribe with Listen411 in Just 60 Seconds
I-SEARCH ANG MGA NAKARAANG EPISODE
I-search ang mga nakaraang episode ng PyTorch Developer Podcast.
IBA PANG MGA EPISOD SA PODCAST NA ITO
We discuss some extension points for customizing PT2 behavior across Dynamo, AOTAutograd and Inductor.
Inductor IR is an intermediate representation that lives between ATen FX graphs and the final Triton code generated by Inductor. It was designed to faithfully represent PyTorch semantics and accordingly models views, mutation and striding. When you write a lowering from ATen operators to Inductor I…
Traditionally, unsigned integer support in PyTorch was not great; we only support uint8. Recently, we added support for uint16, uint32 and uint64. Bare bones functionality works, but I'm entreating the community to help us build out the rest. In particular, for most operations, we plan to use PT2 t…
Define-by-run IR is how Inductor defines the internal compute of a pointwise/reduction operation. It is characterized by a function that calls a number of functions in the 'ops' namespace, where these ops can be overridden by different handlers depending on what kind of semantic analysis you need t…
Compiled autograd is an extension to PT2 that permits compiling the entirety of a backward() call in PyTorch. This allows us to fuse accumulate grad nodes as well as trace through arbitrarily complicated Python backward hooks. Compiled autograd is an important part of our plans for compiled DDP/FSD…
Paunawa: Ang podcast at artwork na naka-embed sa page na ito ay mula sa Edward Yang, Team PyTorch, na pag-aari ng may-ari nito at hindi kaakibat o ineendorso ng Listen Notes, Inc.
I-EDIT
Salamat sa pagtulong na mapanatiling naka-update ang database ng podcast.