pytorch/.github/requirements
angelayi cd9ee49a69 [aoti] Add cpp loader (#135374)
* Added a cpp loader, AOTIModelPackageLoader, which can load the .pt2, build the .so, and create a runner. The python-facing API is that users can directly call the `run` function, whereas in cpp users can directly access the `runner_` if they are more familiar with that. I couldn't figure out how to bind the `get_runner()` function to python...
* Added a new config, `aot_inductor.package_cpp_only` which will **not** package the so. This means that whenever the package is loaded, we will need to build the so. This is turned off by default so that new environments do not need to rebuild their so. The `package_cpp_only` is a feature which torchchat intends to use to provide flexibility to users.
* Added a new config, `aot_inductor.metadata` which stores user-provided metadata, serialized to the pt2 as a json file. It also stores the device used when exporting, "cuda" or "cpu", so that during load time, we can use that data to determine which AOTIModelContainerRunner to use. The metadata can be accessed through `loader.get_metadata()`. TODO is to move this metadata to the toplevel `package_aoti` function so that we can remove the metadata as a config.
* Separated out `package_aoti` as a standalone function, instead of it automatically being called in inductor. This is to prepare for the case where users will compile multiple models, and want to bundle it in one package. The specific use case is in torchchat, where we want to package the separately-exported encoder and decoder layers. An example of how to use this is in `test_multiple_methods`.
* `load_package` will load a singular model, given the model name.
* The loader doesn't support windows for now, I think I need to add some more casing to make the build commands work on windows?

Differential Revision: [D62329906](https://our.internmc.facebook.com/intern/diff/D62329906)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/135374
Approved by: https://github.com/desertfire, https://github.com/malfet
2024-09-11 03:00:01 +00:00
..
conda-env-iOS.txt Update conda-env-iOS.txt (#134068) 2024-08-21 18:47:14 +00:00
conda-env-Linux-X64.txt [BE] wrap deprecated function/class with typing_extensions.deprecated (#127689) 2024-06-02 12:30:43 +00:00
conda-env-macOS-ARM64 [BE] wrap deprecated function/class with typing_extensions.deprecated (#127689) 2024-06-02 12:30:43 +00:00
conda-env-macOS-X64 [BE] wrap deprecated function/class with typing_extensions.deprecated (#127689) 2024-06-02 12:30:43 +00:00
pip-requirements-iOS.txt [BE] bump optree version to 0.12.1 (#130139) 2024-07-20 02:41:10 +00:00
pip-requirements-macOS.txt [aoti] Add cpp loader (#135374) 2024-09-11 03:00:01 +00:00
README.md
regenerate-requirements.txt

Cached requirements and consolidation of conda and pip installation

At the moment, the installation of conda and pip dependencies happens at different places in the CI depending at the whim of different developers, which makes it very challenging to handle issues like network flakiness or upstream dependency failures gracefully. So, this center directory is created to gradually include all the conda environment and pip requirement files that are used to setup CI jobs. Not only it gives a clear picture of all the dependencies required by different CI jobs, but it also allows them to be cached properly to improve CI reliability.

The list of support files are as follows:

  • Conda:
    • conda-env-iOS. This is used by iOS build and test jobs to setup the conda environment
    • conda-env-macOS-ARM64. This is used by MacOS (m1, arm64) build and test jobs to setup the conda environment
    • conda-env-macOS-X64. This is use by MacOS (x86-64) build and test jobs to setup the conda environment
    • conda-env-Linux-X64. This is used by Linux buck build and test jobs to setup the conda environment
  • Pip:
    • pip-requirements-iOS.txt. This is used by iOS build and test jobs to setup the pip environment
    • pip-requirements-macOS.txt. This is used by MacOS build and test jobs to setup the pip environment