Skip to content

[BE] Add in-place collect_env execution#176904

Closed
malfet wants to merge 1 commit intogh/malfet/763/basefrom
gh/malfet/763/head
Closed

[BE] Add in-place collect_env execution#176904
malfet wants to merge 1 commit intogh/malfet/763/basefrom
gh/malfet/763/head

Conversation

@malfet
Copy link
Contributor

@malfet malfet commented Mar 9, 2026

Stack from ghstack (oldest at bottom):

First of all, fewer systems now how wget installed by default, but almost all Linux/MacOS comes with curl

If script with such name already exists, wget will download it with .${NUM} suffixed alias, which results in reporter posting results from something else, for example see #176829

wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
python collect_env.py
--2026-03-08 23:35:37--  https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8001::154, 2606:50c0:8003::154, 2606:50c0:8000::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31107 (30K) [text/plain]
Saving to: ‘collect_env.py.1’

collect_env.py.1            100%[==========================================>]  30.38K  --.-KB/s    in 0.04s

2026-03-08 23:35:38 (707 KB/s) - ‘collect_env.py.1’ saved [31107/31107]

Traceback (most recent call last):
  File "/mnt/d/my/work/study/ai/kaggle_code/aimo2/collect_env.py", line 15, in <module>

[ghstack-poisoned]
@malfet malfet requested a review from a team as a code owner March 9, 2026 17:52
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 9, 2026

🔗 Helpful Links

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

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

✅ No Failures

As of commit 2a79084 with merge base eee7a9d (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Mar 9, 2026
malfet added a commit that referenced this pull request Mar 9, 2026
First of all, fewer systems now how `wget` installed by default, but almost all Linux/MacOS comes with curl

If script with such name already exists, `wget` will download it with `.${NUM}` suffixed alias, which results in reporter posting results from something else, for example see #176829
```
wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
python collect_env.py
--2026-03-08 23:35:37--  https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8001::154, 2606:50c0:8003::154, 2606:50c0:8000::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31107 (30K) [text/plain]
Saving to: ‘collect_env.py.1’

collect_env.py.1            100%[==========================================>]  30.38K  --.-KB/s    in 0.04s

2026-03-08 23:35:38 (707 KB/s) - ‘collect_env.py.1’ saved [31107/31107]

Traceback (most recent call last):
  File "/mnt/d/my/work/study/ai/kaggle_code/aimo2/collect_env.py", line 15, in <module>
```


ghstack-source-id: a854b21
Pull-Request: #176904
@malfet malfet requested a review from Skylion007 March 9, 2026 17:53
@vadimkantorov
Copy link
Contributor

Also, can the same script be run as python -m torch.utils.collect_env? (if PyTorch is somewhat installed)

@malfet
Copy link
Contributor Author

malfet commented Mar 9, 2026

@pytorchbot merge -f "Lint is green"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@malfet
Copy link
Contributor Author

malfet commented Mar 9, 2026

Also, can the same script be run as python -m torch.utils.collect_env? (if PyTorch is somewhat installed)

Yes, but this have a downside of not being able to get any info if import torch fails for one reason or another. Also, it would never include any improvements, i.e. if user are on torch-2.7, one would never get any info added later to it

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