Skip to content

allow -E to be in any spot in the compiler command#142813

Closed
wdvr wants to merge 4 commits intomainfrom
wdvr/loop-e
Closed

allow -E to be in any spot in the compiler command#142813
wdvr wants to merge 4 commits intomainfrom
wdvr/loop-e

Conversation

@wdvr
Copy link
Copy Markdown
Contributor

@wdvr wdvr commented Dec 10, 2024

Follow up of TODO in #140614

It was found experimentally, that for one GPU architecture, sccache passes -E as 1st, 2nd or 3rd argument, but it's much better to do this if -E is passed as any argument

No need to worry about exit or elif chains, as exec aborts script execution

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Dec 10, 2024
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Dec 10, 2024

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 12f8d98 with merge base 393cf46 (image):

NEW FAILURE - The following job has failed:

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

pytorchmergebot pushed a commit that referenced this pull request Dec 11, 2024
Instead of an ancient prebuilt binary

This is a followup from #121323
For some reason, newer `sccache` does not work when `gcc` is invoked with `-E` option, so one have to special-case `-E` case in `/opt/ccache/bin/gcc` wrapper, which had to be special cased to work with  `nvcc` by checking whether `-E` is passed not only as first or second, but as 3rd argument as well(to be followed up by a generic #142813 ), i.e. to generate following wrapper:
```shell
#!/bin/sh

if [ "$1" = "-E" ] || [ "$2" = "-E" ] || [ "$3" = "-E" ]; then
  exec /usr/bin/gcc "$@"
elif [ $(env -u LD_PRELOAD ps -p $PPID -o comm=) != sccache ]; then
  exec sccache /usr/bin/gcc "$@"
else
  exec /usr/bin/gcc "$@"
fi
```

Without it `sccache nvcc hello.cu` failed with no-descriptive
```
    sccache: error: failed to execute compile
    sccache: caused by: Compiler not supported: ""
```
Pull Request resolved: #140614
Approved by: https://github.com/wdvr

Co-authored-by: Wouter Devriendt <wouterdevriendt@meta.com>
@wdvr wdvr changed the base branch from malfet-patch-28 to main December 11, 2024 01:02
@wdvr
Copy link
Copy Markdown
Contributor Author

wdvr commented Dec 11, 2024

@pytorchmergebot rebase main

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Dec 11, 2024

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: unrecognized arguments: main

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci,cherry-pick,close} ...

Try @pytorchbot --help for more info.

@wdvr
Copy link
Copy Markdown
Contributor Author

wdvr commented Dec 11, 2024

@pytorchbot -h rebase

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Successfully rebased wdvr/loop-e onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout wdvr/loop-e && git pull --rebase)

@wdvr wdvr marked this pull request as ready for review December 11, 2024 01:07
@wdvr wdvr requested a review from jeffdaily as a code owner December 11, 2024 01:07
@wdvr wdvr requested review from malfet and removed request for jeffdaily December 11, 2024 01:08
@malfet
Copy link
Copy Markdown
Contributor

malfet commented Dec 11, 2024

@pytorchbot merge -f "If it works for pull, will work for trunk as well"

@pytorchmergebot
Copy link
Copy Markdown
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

@github-actions github-actions bot deleted the wdvr/loop-e branch January 11, 2025 02:11
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.

3 participants