Skip to content
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

Migrate torch::deploy test infra to pytorch/test-infra #274

Closed
wants to merge 1 commit into from
Closed

Migrate torch::deploy test infra to pytorch/test-infra #274

wants to merge 1 commit into from

Conversation

hatala91
Copy link
Member

@hatala91 hatala91 commented Dec 7, 2022

With this PR, I propose to migrate runtime_nightly.yaml and runtime_tests.yaml to use pytorch/test_infra.

For this, I introduce a new reusable workflow in build_test_release.yaml which is called from both the runtime tests and nightly build pipeline. The workflow then uses pytorch/test_infra's linux_job.yml to build, test, run examples and benchmark.

Example runs:

Issue: #254

@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 Dec 7, 2022
pip install -e .
python multipy/runtime/example/generate_examples.py

# Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to split these up into different jobs? You should be able to create a dependency from the build and the other jobs. Just make sure tarball creation + distribution is dependent on the tests passing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that would be possible! However, each step using the linux-job from pytest/test-infra begins with a plain conda-builder image. Therefore, each would need to install dependencies and build MultiPy separately which is quite expensive I'm afraid.

I added what I believe to be the next best thing which is log groups (sections that can be collapsed):

image

Copy link
Contributor

Choose a reason for hiding this comment

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

ohh that's great. We just want to make sure we have a good way to split things up :)

# Create artefact to be uploaded
mkdir dist
mv ${{ inputs.release-artefact }}.tar.gz \
${{ inputs.release-artefact }}.whl
Copy link
Contributor

Choose a reason for hiding this comment

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

Just add a comment for why you are doing the renaming as its not intuitive and relies on an implementation detail. I'll bug the code owner (@seemethere) to see if I can add tar support to simplify this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, great idea! I added a comment with a todo to remove the renaming once pytorch/test-infra#1262 is merged.

@hatala91 hatala91 marked this pull request as ready for review December 15, 2022 14:19
@hatala91 hatala91 requested a review from PaliC December 15, 2022 14:19
@facebook-github-bot
Copy link
Contributor

@hatala91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@hatala91 has updated the pull request. You must reimport the pull request before landing.

Copy link
Contributor

@PaliC PaliC left a comment

Choose a reason for hiding this comment

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

This is almost there. You just need to address the distribution bit.

Overall great work! This is a major improvement to our test infra in terms of better engineering :)

runs-on: ubuntu-latest
if: ${{ inputs.release }}
steps:
- name: Download artefact
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo

Copy link
Member Author

Choose a reason for hiding this comment

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

🦅👀

@@ -67,6 +67,14 @@
#include <multipy/runtime/loader.h>
#include <multipy/runtime/mem_file.h>

/* Linux traditionally doesn't have the trailing 64 that BSD has on these. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this for CentoOS 7? Can you a bit more clear on why its needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch, I copied the whole block and forgot to adapt the comment.

echo "::endgroup::"

echo "::group::Move artifact for upload"
mv multipy_runtime_python${python_version}.tar.gz ${RUNNER_ARTIFACT_DIR}/
Copy link
Contributor

Choose a reason for hiding this comment

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

@seemethere had some comments on your test-infra PR as a way to improve this. Happy to approve after you fix that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Adopted (even pushed that commit shortly before you commented) and can confirm that moving the artifact directly to that folder works excellent:

image

@facebook-github-bot
Copy link
Contributor

@hatala91 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@hatala91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@hatala91 hatala91 requested a review from PaliC December 15, 2022 21:40
Copy link
Contributor

@PaliC PaliC left a comment

Choose a reason for hiding this comment

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

Nice! This is amazing.

As some logistical asides before landing. Please add a summary to describe your changes. (I think the issue should give decent motivation, but its generally good practice to add a few sentences or more describing what you did.)

Also add some jobs to the summary to show that release and build-test work as intended.

Copy link
Member

@seemethere seemethere left a comment

Choose a reason for hiding this comment

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

This is awesome!

@facebook-github-bot
Copy link
Contributor

@hatala91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:
With this PR, I propose to migrate [runtime_nightly.yaml](https://github.com/pytorch/multipy/blob/main/.github/workflows/runtime_nightly.yaml) and [runtime_tests.yaml](https://github.com/pytorch/multipy/blob/main/.github/workflows/runtime_tests.yaml) to use [pytorch/test_infra](https://github.com/pytorch/test-infra/wiki/).

For this, I introduce a new reusable workflow in [build_test_release.yaml](https://github.com/pytorch/multipy/pull/274/files#diff-e9376faa19019165b5c9299c6e79ef11820184ea067877dd574bf357b7a7e01b) which is called from both the runtime tests and nightly build pipeline. The workflow then uses `pytorch/test_infra's` [linux_job.yml](https://github.com/pytorch/test-infra/blob/main/.github/workflows/) to build, test, run examples and benchmark.

Example runs:
 - py37: https://github.com/pytorch/multipy/actions/runs/3708138595/jobs/6285368845
 - py38: https://github.com/pytorch/multipy/actions/runs/3708138595/jobs/6285368958
 - py39: https://github.com/pytorch/multipy/actions/runs/3708138595/jobs/6285369062
 - py310: https://github.com/pytorch/multipy/actions/runs/3708138595/jobs/6285368633

Issue: #254

Pull Request resolved: #274

Reviewed By: seemethere, PaliC

Differential Revision: D42069719

Pulled By: hatala91

fbshipit-source-id: b24162f9436809a5688e835d50f18212214b5c48
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D42069719

@facebook-github-bot
Copy link
Contributor

@hatala91 merged this pull request in 10cc663.

@hatala91 hatala91 deleted the gh/sebastianhatala/migrate_to_test-infra branch December 16, 2022 12:11
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. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants