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

Add VSCode devcontainer instructions to CONTRIBUTING.md #7072

Merged
merged 4 commits into from
May 17, 2024

Conversation

will-cromar
Copy link
Collaborator

@will-cromar will-cromar commented May 16, 2024

Tested these instructions because I broke my build environment and had to start from scratch.

Remove extra GPU instructions because this should be handled by dev container.

@will-cromar will-cromar requested a review from JackCaoG May 16, 2024 18:39
@@ -42,10 +87,6 @@ We recommend you to use our prebuilt Docker image to start your development work
python setup.py develop
```

### Build PyTorch/XLA from source with GPU support

Please refer to this [guide](https://github.com/pytorch/xla/blob/master/docs/gpu.md#develop-pytorchxla-on-a-gpu-instance-build-pytorchxla-from-source-with-gpu-support).
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is actually useful, user has to run

echo "export PATH=\$PATH:/usr/local/cuda-12.1/bin" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/cuda-12.1/lib64" >> ~/.bashrc
source ~/.bashrc

to build on GPU docker.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've needed to do that before inside containers in GKE (which uses a different container runtime), but never with Docker with nvidia-container-toolkit installed. Are you sure that's still necessary?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Last time I tried(~1 month ago) I still need it with the GPU docker.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it. I'll revert this change for now and give it an update next time I break my GPU build machine

@will-cromar
Copy link
Collaborator Author

I also added some small fixes to the common VSCode config:

  • Add yapf formatter extension (no longer included in main Python extension
  • Specify clang-format as formatter for C++
  • Instructions to symlink correct configs
  • Make git ignore submodules (avoids adding all of PyTorch's unrelated submodules to the sidebar by default)
  • Make Pylance ignore generated code/build artifacts so it doesn't OOM

@will-cromar will-cromar merged commit 56c2368 into master May 17, 2024
19 of 20 checks passed
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