Skip to content

Commit 0300a59

Browse files
author
Vincent Moens
committed
[Setup] Making tensordict pytorch-agnostic
ghstack-source-id: b2a9c72 Pull Request resolved: #1256
1 parent cb81b5e commit 0300a59

File tree

13 files changed

+156
-47
lines changed

13 files changed

+156
-47
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
yum update gcc
4+
yum update libstdc++
5+
6+
${CONDA_RUN} conda install -c conda-forge pybind11 -y

.github/scripts/version_script.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
set TENSORDICT_BUILD_VERSION=0.7.0
33
echo TENSORDICT_BUILD_VERSION is set to %TENSORDICT_BUILD_VERSION%
44

5+
if "%CONDA_RUN%"=="" (
6+
echo CONDA_RUN is not set. Please activate your conda environment or set CONDA_RUN.
7+
exit /b 1
8+
)
9+
10+
:: Run the pip install command
11+
%CONDA_RUN% conda install -c conda-forge pybind11 -y
12+
513
@echo on
614

715
set VC_VERSION_LOWER=17

.github/scripts/version_script.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/bin/bash
22

33
export TENSORDICT_BUILD_VERSION=0.7.0
4+
5+
${CONDA_RUN} conda install -c conda-forge pybind11 -y

.github/scripts/win-pre-script.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
:: Check if CONDA_RUN is set, if not, set it to a default value
3+
if "%CONDA_RUN%"=="" (
4+
echo CONDA_RUN is not set. Please activate your conda environment or set CONDA_RUN.
5+
exit /b 1
6+
)
7+
8+
:: Run the pip install command
9+
%CONDA_RUN% conda install -c conda-forge pybind11 -y
10+
11+
:: Check if the installation was successful
12+
if errorlevel 1 (
13+
echo Failed to install cmake and pybind11.
14+
exit /b 1
15+
) else (
16+
echo Successfully installed cmake and pybind11.
17+
)

.github/unittest/linux/scripts/environment.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ dependencies:
1919
- coverage
2020
- h5py
2121
- orjson
22+
- ninja
23+
- pybind11
24+
- cmake

.github/unittest/linux_torchrec/scripts/environment.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ dependencies:
1818
- coverage
1919
- h5py
2020
- orjson
21+
- cmake
22+
- ninja
23+
- pybind11

.github/unittest/rl_linux_optdeps/scripts/environment.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ dependencies:
1616
- pyyaml
1717
- scipy
1818
- orjson
19+
- cmake
20+
- ninja
21+
- pybind11

.github/workflows/build-wheels-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
include:
3434
- repository: pytorch/tensordict
3535
smoke-test-script: test/smoke_test.py
36+
pre-script: .github/scripts/linux-pre-script.sh
3637
post-script: .github/scripts/linux-post-script.sh
3738
package-name: tensordict
3839
name: pytorch/tensordict

.github/workflows/build-wheels-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
matrix:
3333
include:
3434
- repository: pytorch/tensordict
35-
pre-script: ""
35+
pre-script: .github/scripts/win-pre-script.bat
3636
env-script: .github/scripts/version_script.bat
3737
post-script: "python packaging/wheel/relocate.py"
3838
smoke-test-script: test/smoke_test.py

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ possible.
66
Install the library as suggested in the README. For advanced features,
77
it is preferable to install the nightly built of pytorch.
88

9+
You will need the following packages to be installed:
10+
```bash
11+
pip install ninja cmake pybind11 -U
12+
```
13+
914
Make sure you install tensordict in develop mode by running
1015
```
1116
python setup.py develop

0 commit comments

Comments
 (0)