-
Notifications
You must be signed in to change notification settings - Fork 410
add torch-tensorrt-executorch-delegate wheel build #4398
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
Open
lanluo-nvidia
wants to merge
19
commits into
main
Choose a base branch
from
lluo/executorch_wheel_build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f215c0c
add torch-tensorrt-executorch-delegate wheel
lanluo-nvidia f1339a0
fix the test error
lanluo-nvidia e3a8f27
test
lanluo-nvidia 5ccbfcd
Merge branch 'main' into lluo/executorch_wheel_build
lanluo-nvidia 14c9c71
resolve review comments
lanluo-nvidia e6a6f7a
resolve review commits
lanluo-nvidia 680b0f4
change cmake build to bazel build
lanluo-nvidia 2f50374
Merge branch 'main' into lluo/executorch_wheel_build
lanluo-nvidia e77dcbe
resolve comments: seperate the save and load in the different package
lanluo-nvidia aa33e13
fix load error
lanluo-nvidia 8f83c8e
fix lint
lanluo-nvidia bdf3d73
add aarch64 support
lanluo-nvidia 91e7eab
move build executorch-delegate as a downstream job
lanluo-nvidia cc8035b
fix the executorch commit mismatch in MODULE.bazel.tmpl
lanluo-nvidia 32d7dd9
rename delegate to runtime, add rpath
lanluo-nvidia 9a466e6
add the documentation suggested by anthony
lanluo-nvidia bf3fa62
resolve comments
lanluo-nvidia 8aab31b
fix the upload executorch-runtime package path
lanluo-nvidia 589df36
fix the test issue
lanluo-nvidia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: ExecuTorch Delegate Linux Test | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| build-matrix: | ||
| description: "Build matrix to utilize" | ||
| default: "" | ||
| type: string | ||
| repository: | ||
| description: 'Repository to checkout, defaults to ""' | ||
| default: "" | ||
| type: string | ||
| ref: | ||
| description: 'Reference to checkout, defaults to ""' | ||
| default: "" | ||
| type: string | ||
| test-infra-repository: | ||
| description: "Test infra repository to use" | ||
| default: "pytorch/test-infra" | ||
| type: string | ||
| test-infra-ref: | ||
| description: "Test infra reference to use" | ||
| default: "" | ||
| type: string | ||
|
|
||
| jobs: | ||
| select-matrix: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.pick.outputs.matrix }} | ||
| steps: | ||
| - id: pick | ||
| env: | ||
| FULL_MATRIX: ${{ inputs.build-matrix }} | ||
| run: | | ||
| set -euo pipefail | ||
| python - <<'PY' >> "${GITHUB_OUTPUT}" | ||
| import json | ||
| import os | ||
|
|
||
| matrix = json.loads(os.environ["FULL_MATRIX"]) | ||
| include = matrix.get("include", []) | ||
| if not include: | ||
| raise SystemExit("build-matrix include[] is empty") | ||
|
|
||
| preferred = None | ||
| for entry in include: | ||
| if entry.get("python_version") == "3.11": | ||
| preferred = entry | ||
| break | ||
|
|
||
| if preferred is None: | ||
| preferred = include[0] | ||
|
|
||
| print("matrix=" + json.dumps({"include": [preferred]})) | ||
| PY | ||
|
|
||
| test: | ||
| needs: select-matrix | ||
| uses: ./.github/workflows/linux-test.yml | ||
| with: | ||
| job-name: executorch-runtime-test | ||
| repository: ${{ inputs.repository }} | ||
| ref: ${{ inputs.ref }} | ||
| test-infra-repository: ${{ inputs.test-infra-repository }} | ||
| test-infra-ref: ${{ inputs.test-infra-ref }} | ||
| build-matrix: ${{ needs.select-matrix.outputs.matrix }} | ||
| pre-script: packaging/pre_build_script.sh | ||
| additional-artifact: torch-tensorrt-executorch-runtime | ||
| script: | | ||
| set -euo pipefail | ||
| mkdir -p "${RUNNER_TEMP}/bin" | ||
| curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-linux-amd64" \ | ||
| -o "${RUNNER_TEMP}/bin/bazel" | ||
| chmod +x "${RUNNER_TEMP}/bin/bazel" | ||
| export PATH="${RUNNER_TEMP}/bin:${PATH}" | ||
|
|
||
| python -m pip install pyyaml executorch | ||
| python -c 'from torch_tensorrt_executorch_runtime import get_runtime; assert get_runtime().backend_registry.is_available("TensorRTBackend")' | ||
|
|
||
| source tests/py/utils/ci_helpers.sh | ||
| trt_tier_executorch | ||
|
|
||
| bazel build //:libtorchtrt --compilation_mode opt --config=linux | ||
| executorch_cmake_location="$(bazel query @executorch//:executorch/CMakeLists.txt --output=location)" | ||
| export EXECUTORCH_SOURCE_DIR="$(dirname "${executorch_cmake_location%%:*}")" | ||
| export EXECUTORCH_ROOT="${EXECUTORCH_SOURCE_DIR}" | ||
| python examples/torchtrt_executorch_example/export_static_shape.py \ | ||
| --model_path="${RUNNER_TEMP}/torchtrt-python.pte" | ||
| .github/scripts/verify-executorch-reference-runner.sh \ | ||
| "${RUNNER_TEMP}/torchtrt-python.pte" | ||
| python examples/executorch_reference_runner/load_model.py \ | ||
| --model_path="${RUNNER_TEMP}/torchtrt-python.pte" --num_runs=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.