Training demo (#5445)
Summary:
Allows the XOR model training demo to be runnable in OSS. Will follow up with a documentation PR about training and how to run this demo.
Im sure my cmakelist.txt changes have issues so if anyone sees ways to improve them please let me know.
Only hack I had to do was the optimizer was calling an ET op directly. I don't think we have enabled this in OSS yet so I will follow up with larryliu0820 when hes back and in the meantime open up an issue.
Repro of demo:
Pull Request resolved: https://github.com/pytorch/executorch/pull/5445
Test Plan:
python3 extension/training/examples/XOR/export_model.py --outdir /tmp/xor
rm -rf cmake-out
mkdir cmake-out
cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_EXTENSION_TRAINING=ON \
-DEXECUTORCH_ENABLE_LOGGING=ON \
-DPYTHON_EXECUTABLE=python \
-Bcmake-out .
cmake --build cmake-out -j9 --target install --config Release
./cmake-out/extension/training/train_xor --model_path=/tmp/xor/xor.pte
Reviewed By: dvorjackz
Differential Revision: D62905840
Pulled By: JacobSzwejbka
fbshipit-source-id: 622e68637ee7a0bb1b323e777d60e9516be115cd J
Jacob Szwejbka committed
26c736ee1116c8612a7d551bfe4827092a6a1250
Parent: 53c1a5f
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 9/18/2024, 6:35:50 AM