Skip to content

Add cmake support for flat tensor #8349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Add cmake support for flat tensor #8349

merged 1 commit into from
Feb 11, 2025

Conversation

lucylq
Copy link
Contributor

@lucylq lucylq commented Feb 10, 2025

Summary

Add cmake support for flat tensor

Test plan

PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON CMAKE_ARGS="-DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" .ci/scripts/setup-linux.sh cmake

sh test/run_oss_cpp_tests.sh 
cmake .     -DCMAKE_INSTALL_PREFIX=cmake-out     -DEXECUTORCH_USE_CPP_CODE_COVERAGE=ON     -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON     -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON     -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON     -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON     -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON     -DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON     -DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON     -DEXECUTORCH_BUILD_DEVTOOLS=ON     -DEXECUTORCH_BUILD_XNNPACK=ON     -DEXECUTORCH_BUILD_TESTS=ON     -Bcmake-out

cmake --build cmake-out -j9 --target install

(executorch) [[email protected] /data/users/lfq/executorch/cmake-out (lfq.flat-tensor-cmake)]$ ctest -R flat_tensor
Test project /data/users/lfq/executorch/cmake-out
    Start 54: extension_flat_tensor_test
1/1 Test #54: extension_flat_tensor_test .......   Passed    0.00 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.01 sec

Copy link

pytorch-bot bot commented Feb 10, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8349

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit dba39e0 with merge base 71b8b75 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 10, 2025
@lucylq lucylq force-pushed the lfq.flat-tensor-cmake branch from 4d3aad8 to 1021cba Compare February 10, 2025 22:42
@lucylq lucylq requested a review from JacobSzwejbka February 10, 2025 22:43
@lucylq lucylq marked this pull request as ready for review February 10, 2025 22:52
@lucylq lucylq force-pushed the lfq.flat-tensor-cmake branch from 1021cba to dba39e0 Compare February 10, 2025 23:01
@lucylq lucylq merged commit 160e5b6 into main Feb 11, 2025
45 checks passed
@lucylq lucylq deleted the lfq.flat-tensor-cmake branch February 11, 2025 00:37
@lucylq lucylq restored the lfq.flat-tensor-cmake branch February 11, 2025 00:58
@lucylq lucylq deleted the lfq.flat-tensor-cmake branch February 11, 2025 01:05
lucylq added a commit that referenced this pull request Feb 11, 2025
Pull Request resolved: #8200

Add NamedDataMap as an arg to:
- Method
- load_method
- parseTensor

Use NamedDataMap to resolve external tensors in parseTensor.

Test that the PTE + PTD file run well inside method_test.

TODO: additional test cases. also, tests for mutable case with load_data_into when that is landed, see D69148652.

Land after: #8349, which adds CMake support for FlatTensor.

Note: dependency on D66580784, which fixes some failing RL tests exposed by this diff from inclusion of portable and aten headers.
https://www.internalfb.com/code/fbsource/[2b74908ed03c34fbfd53fb57575eba0964fe0136][history]/arvr/projects/depthsensing/products/depthmanager/depth/stereo/MlStereoDisparityModelExecutorchBackend.h?lines=13-15


ghstack-source-id: 265828564
@exported-using-ghexport

Differential Revision: [D67127327](https://our.internmc.facebook.com/intern/diff/D67127327/)
lucylq added a commit that referenced this pull request Feb 12, 2025
Pull Request resolved: #8200

Add NamedDataMap as an arg to:
- Method
- load_method
- parseTensor

Use NamedDataMap to resolve external tensors in parseTensor.

Test that the PTE + PTD file run well inside method_test.

TODO: additional test cases. also, tests for mutable case with load_data_into when that is landed, see D69148652.

Land after: #8349, which adds CMake support for FlatTensor.

Note: dependency on D66580784, which fixes some failing RL tests exposed by this diff from inclusion of portable and aten headers.
https://www.internalfb.com/code/fbsource/[2b74908ed03c34fbfd53fb57575eba0964fe0136][history]/arvr/projects/depthsensing/products/depthmanager/depth/stereo/MlStereoDisparityModelExecutorchBackend.h?lines=13-15


ghstack-source-id: 265828564
@exported-using-ghexport

Differential Revision: [D67127327](https://our.internmc.facebook.com/intern/diff/D67127327/)

Co-authored-by: lucylq <[email protected]>
"${CMAKE_CURRENT_BINARY_DIR}/_default_external_constant.ptd"
)

set(test_env_
Copy link
Contributor

Choose a reason for hiding this comment

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

stuff in this file seems to get clobbered if I rerun python test/utils/generate_gtest_cmakelists.py

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I guess she manually wrote it instead of having it generated @lucylq can you take a look, or if its faster we can just black list this dir in the script

Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't need to be blocklisted, just drop it from the config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I generated it and then edited it to create the example pte files. I'll remove it from OSSTestConfig.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants