-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into faster_to
- Loading branch information
Showing
51 changed files
with
926 additions
and
931 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. | ||
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. | ||
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
python-source-and-configs: | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
repository: pytorch/tensordict | ||
script: | | ||
set -euo pipefail | ||
echo '::group::Setup environment' | ||
CONDA_PATH=$(which conda) | ||
eval "$(${CONDA_PATH} shell.bash hook)" | ||
conda create --name ci --quiet --yes python=3.8 pip | ||
conda activate ci | ||
echo '::endgroup::' | ||
echo '::group::Install lint tools' | ||
pip install --progress-bar=off pre-commit | ||
echo '::endgroup::' | ||
echo '::group::Lint Python source and configs' | ||
set +e | ||
pre-commit run --all-files | ||
if [ $? -ne 0 ]; then | ||
git --no-pager diff | ||
exit 1 | ||
fi | ||
echo '::endgroup::' | ||
c-source: | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
repository: pytorch/tensordict | ||
script: | | ||
set -euo pipefail | ||
echo '::group::Setup environment' | ||
CONDA_PATH=$(which conda) | ||
eval "$(${CONDA_PATH} shell.bash hook)" | ||
conda create --name ci --quiet --yes -c conda-forge python=3.8 ncurses=5 libgcc | ||
conda activate ci | ||
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" | ||
echo '::endgroup::' | ||
echo '::group::Install lint tools' | ||
curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format | ||
chmod +x ./clang-format | ||
echo '::endgroup::' | ||
echo '::group::Lint C source' | ||
set +e | ||
./.github/unittest/linux/scripts/run-clang-format.py -r torchrl/csrc --clang-format-executable ./clang-format | ||
if [ $? -ne 0 ]; then | ||
git --no-pager diff | ||
exit 1 | ||
fi | ||
echo '::endgroup::' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: Unit-tests on Linux | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
workflow_dispatch: | ||
|
||
env: | ||
CHANNEL: "nightly" | ||
|
||
concurrency: | ||
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. | ||
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. | ||
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-gpu: | ||
strategy: | ||
matrix: | ||
python_version: ["3.8"] | ||
cuda_arch_version: ["12.1"] | ||
fail-fast: false | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
runner: linux.g5.4xlarge.nvidia.gpu | ||
repository: pytorch/tensordict | ||
gpu-arch-type: cuda | ||
gpu-arch-version: ${{ matrix.cuda_arch_version }} | ||
script: | | ||
# Set env vars from matrix | ||
export PYTHON_VERSION=${{ matrix.python_version }} | ||
# Commenting these out for now because the GPU test are not working inside docker | ||
export CUDA_ARCH_VERSION=${{ matrix.cuda_arch_version }} | ||
export CU_VERSION="cu${CUDA_ARCH_VERSION:0:2}${CUDA_ARCH_VERSION:3:1}" | ||
export TORCH_VERSION=nightly | ||
# Remove the following line when the GPU tests are working inside docker, and uncomment the above lines | ||
#export CU_VERSION="cpu" | ||
export ARCH=x86_64 | ||
echo "PYTHON_VERSION: $PYTHON_VERSION" | ||
echo "CU_VERSION: $CU_VERSION" | ||
## setup_env.sh | ||
bash .github/unittest/linux/scripts/setup_env.sh | ||
bash .github/unittest/linux/scripts/install.sh | ||
bash .github/unittest/linux/scripts/run_test.sh | ||
bash .github/unittest/linux/scripts/post_process.sh | ||
test-cpu: | ||
strategy: | ||
matrix: | ||
python_version: ["3.8", "3.9", "3.10", "3.11"] | ||
fail-fast: false | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
runner: linux.12xlarge | ||
repository: pytorch/tensordict | ||
timeout: 90 | ||
script: | | ||
# Set env vars from matrix | ||
export PYTHON_VERSION=${{ matrix.python_version }} | ||
export CU_VERSION="cpu" | ||
export TORCH_VERSION=nightly | ||
export ARCH=x86_64 | ||
echo "PYTHON_VERSION: $PYTHON_VERSION" | ||
echo "CU_VERSION: $CU_VERSION" | ||
## setup_env.sh | ||
bash .github/unittest/linux/scripts/setup_env.sh | ||
bash .github/unittest/linux/scripts/install.sh | ||
bash .github/unittest/linux/scripts/run_test.sh | ||
bash .github/unittest/linux/scripts/post_process.sh | ||
test-stable-gpu: | ||
strategy: | ||
matrix: | ||
python_version: ["3.8"] | ||
cuda_arch_version: ["12.1"] | ||
fail-fast: false | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
runner: linux.g5.4xlarge.nvidia.gpu | ||
repository: pytorch/tensordict | ||
gpu-arch-type: cuda | ||
gpu-arch-version: ${{ matrix.cuda_arch_version }} | ||
timeout: 90 | ||
script: | | ||
# Set env vars from matrix | ||
export PYTHON_VERSION=${{ matrix.python_version }} | ||
# Commenting these out for now because the GPU test are not working inside docker | ||
export CUDA_ARCH_VERSION=${{ matrix.cuda_arch_version }} | ||
export CU_VERSION="cu${CUDA_ARCH_VERSION:0:2}${CUDA_ARCH_VERSION:3:1}" | ||
export TORCH_VERSION=stable | ||
# Remove the following line when the GPU tests are working inside docker, and uncomment the above lines | ||
#export CU_VERSION="cpu" | ||
export ARCH=x86_64 | ||
echo "PYTHON_VERSION: $PYTHON_VERSION" | ||
echo "CU_VERSION: $CU_VERSION" | ||
## setup_env.sh | ||
bash .github/unittest/linux/scripts/setup_env.sh | ||
bash .github/unittest/linux/scripts/install.sh | ||
bash .github/unittest/linux/scripts/run_test.sh | ||
bash .github/unittest/linux/scripts/post_process.sh | ||
test-stable-cpu: | ||
strategy: | ||
matrix: | ||
python_version: ["3.8", "3.11"] | ||
fail-fast: false | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
runner: linux.12xlarge | ||
repository: pytorch/tensordict | ||
timeout: 90 | ||
script: | | ||
# Set env vars from matrix | ||
export PYTHON_VERSION=${{ matrix.python_version }} | ||
export CU_VERSION="cpu" | ||
export TORCH_VERSION=stable | ||
export ARCH=x86_64 | ||
echo "PYTHON_VERSION: $PYTHON_VERSION" | ||
echo "CU_VERSION: $CU_VERSION" | ||
## setup_env.sh | ||
bash .github/unittest/linux/scripts/setup_env.sh | ||
bash .github/unittest/linux/scripts/install.sh | ||
bash .github/unittest/linux/scripts/run_test.sh | ||
bash .github/unittest/linux/scripts/post_process.sh |
Oops, something went wrong.