Skip to content

[ROCm] Use CI env variable instead of Githubactions and CircleCI. #7501

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

Closed
wants to merge 1 commit into from

Conversation

lcskrishna
Copy link

@lcskrishna lcskrishna commented Apr 6, 2023

This PR fixes the ROCm CI to run same tests as CUDA CI.

Summary:
Both the Circle CI environment and Github enviornment uses "CI" env variable set to true, as per the documentation below:
The same has been already used in PyTorch CI as well.

https://circleci.com/docs/variables/
https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

cc: @jithunnair-amd

cc @jeffdaily @jithunnair-amd

@pytorch-bot
Copy link

pytorch-bot bot commented Apr 6, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7501

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

❌ 2 Failures

As of commit c6cb28c:

NEW FAILURES - The following jobs have failed:

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

@facebook-github-bot
Copy link

Hi @lcskrishna!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

Copy link
Collaborator

@pmeier pmeier left a comment

Choose a reason for hiding this comment

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

Hey @lcskrishna and thanks for the PR. I'm a little confused about the purpose of it though: you state

This PR fixes the ROCm CI to run same tests as CUDA CI.

but as of now, we aren't running any ROCm CI. What is your use case here as this patch won't do anything for us?

@@ -28,7 +28,7 @@
from torchvision.transforms.v2.functional import convert_dtype_image_tensor, to_image_tensor


IN_OSS_CI = any(os.getenv(var) == "true" for var in ["CIRCLECI", "GITHUB_ACTIONS"])
IN_OSS_CI = bool(os.getenv('CI'))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not using "CI" was a intentional choice: #6970 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @lcskrishna and thanks for the PR. I'm a little confused about the purpose of it though: you state

This PR fixes the ROCm CI to run same tests as CUDA CI.

but as of now, we aren't running any ROCm CI. What is your use case here as this patch won't do anything for us?

Hi @pmeier,

You are right that there is no ROCm CI on torchvision currently (we hope to change that in the near future!). However, the use-case is us trying to run internal CI on Jenkins for torchvision, and observing that some unit tests are not skipped for ROCm but skipped for upstream because of the above logic specific to CI platforms.

Copy link
Contributor

@jithunnair-amd jithunnair-amd Apr 6, 2023

Choose a reason for hiding this comment

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

Not using "CI" was a intentional choice: #6970 (comment)

Honestly, that comment seems to be based on uncertainty/doubt rather than an actual issue with using the "CI" env variable :). We have some real examples of the PyTorch project using the "CI" env var without it interfering with Meta internal systems (afaik):
https://github.com/pytorch/pytorch/blob/master/tools/test/test_upload_test_stats.py#L6
https://github.com/pytorch/pytorch/blob/master/torch/testing/_internal/common_utils.py#L100

I'm not sure if Meta internal systems for torch and torchvision are different, but could we investigate it a bit more before concluding that "CI" won't work? It would make this code more "standard" and CI-vendor-agnostic. Thanks for considering!

Copy link
Collaborator

Choose a reason for hiding this comment

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

You are right that there is no ROCm CI on torchvision currently (we hope to change that in the near future!). However, the use-case is us trying to run internal CI on Jenkins for torchvision, and observing that some unit tests are not skipped for ROCm but skipped for upstream because of the above logic specific to CI platforms.

If this is just temporary and internal issue, can't you simply set one of the environment variables to fake being in such an environment?

I'm not sure if Meta internal systems for torch and torchvision are different, but could we investigate it a bit more before concluding that "CI" won't work? It would make this code more "standard" and CI-vendor-agnostic.

I'm in no position to perform such an investigation as I don't have access to Meta internal CI. However, I know that is was very deliberate to separate OSS, i.e. external, and internal CI. This is why we have this flag in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

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

@malfet @fmassa Would you be able to help here? We are trying to figure out if using the CI env var instead of vendor-specific env vars would be a feasible solution to keep Meta internal CI systems working?

Copy link
Collaborator

@pmeier pmeier Apr 11, 2023

Choose a reason for hiding this comment

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

@NicolasHug added this logic. But before we start any investigations, could you please answer my question above?

If this is just temporary and internal issue, can't you simply set one of the environment variables to fake being in such an environment?

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is just temporary and internal issue, can't you simply set one of the environment variables to fake being in such an environment?

@pmeier Yes, most certainly. This PR is just meant to use a more standard approach of identifying a CI environment in general. in line with what is done in upstream PyTorch, which also uses Meta internal CI.

Copy link
Member

Choose a reason for hiding this comment

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

@lcskrishna @jithunnair-amd thanks for the PR.

The pytorch and torchvision CIs are setup somewhave differently both in OSS and internally, so something that works in pytorch core may not work the same way for torchvision.

As @pmeier mentioned, the explicit use of "CIRCLECI", "GITHUB_ACTIONS" instead of just "CI" is here to prevent any potential conflict with the internal CI. For example the internal CI may at some point decide to also set that variable on internal infra; that could lead to silent error or tests being skipped and it could take a while to diagnose, so we want to avoid such a scenario.

Copy link
Contributor

Choose a reason for hiding this comment

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

@NicolasHug Thanks for the explanation. We'll close this PR.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants