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

Github action to update PyTorch version #1419

Merged
merged 6 commits into from
Sep 28, 2022
Merged

Github action to update PyTorch version #1419

merged 6 commits into from
Sep 28, 2022

Conversation

ashay
Copy link
Collaborator

@ashay ashay commented Sep 26, 2022

This PR contains four commits:

  • build: allow upgrading pip modules (that adds the --upgrade flag to pip)
  • build: [nfc] clarify source versus binary PyTorch builds (minor variable name change)
  • build: create RollPyTorch to update PyTorch version in Torch-MLIR
  • build: checkout Pytorch using either branch name or commit hash

@ashay ashay force-pushed the RollPyTorch branch 16 times, most recently from 0f706a8 to eae7f52 Compare September 27, 2022 19:55
Without this, if an earlier nightly PyTorch module exists, then pip
skips installing the new nightly PyTorch module.
As a matter of slight clarity, this patch renames the variable
`torch_from_src` to `torch_from_bin`, since that variable is initialized
to `TM_USE_PYTORCH_BINARY`.
@ashay ashay changed the title [do not review / do not merge] Github action to update PyTorch version Github action to update PyTorch version Sep 27, 2022
@ashay ashay marked this pull request as ready for review September 27, 2022 22:15
@ashay ashay requested a review from powderluv September 27, 2022 22:18
@ashay
Copy link
Collaborator Author

ashay commented Sep 27, 2022

When this GHA runs, it will produce a commit similar to 22a2a1c.

ashay and others added 2 commits September 28, 2022 17:53
This patch fetches the most recent nightly (binary) build of PyTorch,
before pinning it in pytorch-requirements.txt, which is referenced in
the top-level requirements.txt file.  This way, end users will continue
to be able to run `pip -r requirements.txt` without worrying whether
doing so will break their Torch-MLIR build.

This patch also fetches the git commit hash that corresponds to the
nightly release, and this hash is passed to the out-of-tree build so
that it can build PyTorch from source.

If we were to sort the torch versions as numbers (in the usual
descending order), then 1.9 appears before 1.13.  To fix this problem,
we use the `--version-sort` flag (along with `--reverse` for specifying
a descending order).  We also filter out lines that don't contain
version numbers by only considering lines that start with a digit.
Copy link
Collaborator

@powderluv powderluv left a comment

Choose a reason for hiding this comment

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

As discussed on discord we can auto-approve when tests pass so there is no human in the loop when tests are good. When it fails we will need it to be fixed and rolled.

pytorch-requirements.txt Outdated Show resolved Hide resolved
@ashay ashay merged commit 53e76b8 into main Sep 28, 2022
@ashay ashay deleted the RollPyTorch branch September 28, 2022 20:38
AmosLewis pushed a commit to AmosLewis/torch-mlir that referenced this pull request Sep 28, 2022
…vm#1419)

This patch fetches the most recent nightly (binary) build of PyTorch,
before pinning it in pytorch-requirements.txt, which is referenced in
the top-level requirements.txt file.  This way, end users will continue
to be able to run `pip -r requirements.txt` without worrying whether
doing so will break their Torch-MLIR build.

This patch also fetches the git commit hash that corresponds to the
nightly release, and this hash is passed to the out-of-tree build so
that it can build PyTorch from source.

If we were to sort the torch versions as numbers (in the usual
descending order), then 1.9 appears before 1.13.  To fix this problem,
we use the `--version-sort` flag (along with `--reverse` for specifying
a descending order).  We also filter out lines that don't contain
version numbers by only considering lines that start with a digit.

As a matter of slight clarity, this patch renames the variable
`torch_from_src` to `torch_from_bin`, since that variable is initialized
to `TM_USE_PYTORCH_BINARY`.

Co-authored-by: powderluv <powderluv@users.noreply.github.com>
sjain-stanford added a commit that referenced this pull request Sep 29, 2022
…tainer (#1439)

Updates the bazel Dockerfile to match changes from #1419. This should get the bazel build back to green.

Also triggered bazel build on GHA here: https://github.com/sjain-stanford/torch-mlir/actions/runs/3154741943. Let's wait for it to complete before landing this.
qedawkins pushed a commit to nod-ai/torch-mlir that referenced this pull request Oct 3, 2022
Fuse an ONNXMulOp when one of the input is a the result of a ONNXConvOp and the other input is a produced by a ONNXConstantOp if the ONNXConvOp weights is produced by a ONXConstantOp`

Signed-off-by: Ettore Tiotto <etiotto@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants