@@ -22,17 +22,64 @@ jobs:
2222 benchmark_cpu :
2323 name : CPU Pytest benchmark
2424 runs-on : linux.g5.4xlarge.nvidia.gpu
25+ defaults :
26+ run :
27+ shell : bash -l {0}
28+ container :
29+ image : nvidia/cuda:12.3.0-base-ubuntu22.04
30+ options : --gpus all
2531 steps :
26- - uses : actions/checkout@v3
27- - uses : actions/setup-python@v4
32+ - name : Who triggered this?
33+ run : |
34+ echo "Action triggered by ${{ github.event.pull_request.html_url }}"
35+ - name : Install deps
36+ run : |
37+ export TZ=Europe/London
38+ export DEBIAN_FRONTEND=noninteractive # tzdata bug
39+ apt-get update -y
40+ apt-get update -y
41+ apt-get upgrade -y
42+ apt-get -y install gcc curl g++ unzip wget sudo git cmake
43+ - name : Check ldd --version
44+ run : ldd --version
45+ - name : Checkout
46+ uses : actions/checkout@v3
47+ with :
48+ fetch-depth : 50 # this is to make sure we obtain the target base commit
49+ - name : Python Setup
50+ uses : actions/setup-python@v4
2851 with :
2952 python-version : ' 3.10'
53+ - name : Setup conda
54+ run : |
55+ rm -rf $HOME/miniconda
56+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
57+ bash ~/miniconda.sh -b -p $HOME/miniconda
58+ - name : setup Path
59+ run : |
60+ echo "$HOME/miniconda/bin" >> $GITHUB_PATH
61+ echo "CONDA=$HOME/miniconda" >> $GITHUB_PATH
62+ - name : create and activate conda env
63+ run : |
64+ $HOME/miniconda/bin/conda create --name build_binary python=${{ matrix.python-version }}
65+ $HOME/miniconda/bin/conda info
66+ $HOME/miniconda/bin/activate build_binary
67+ - name : Setup git
68+ run : git config --global --add safe.directory /__w/tensordict/tensordict
69+ - name : setup Path
70+ run : |
71+ echo /usr/local/bin >> $GITHUB_PATH
3072 - name : Setup Environment
3173 run : |
32- apt-get -y install gcc curl g++ unzip wget sudo git cmake
33- pip install ninja -U
34- pip install -e .
35- pip install pytest pytest-benchmark
74+ python -m pip install ninja pybind11 -U
75+ python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu121
76+ python -m pip install -e .
77+ python -m pip install pytest pytest-benchmark
78+ - name : check GPU presence
79+ run : |
80+ python -c """import torch
81+ assert torch.cuda.device_count()
82+ """
3683 - name : Run benchmarks
3784 run : |
3885 cd benchmarks/
4491 uses : benchmark-action/github-action-benchmark@v1
4592 if : ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
4693 with :
47- name : CPU Benchmark Results
94+ name : GPU Benchmark Results
4895 tool : ' pytest'
4996 output-file-path : benchmarks/output.json
5097 fail-on-alert : true
55102 gh-pages-branch : gh-pages
56103 auto-push : true
57104
58-
59105 benchmark_gpu :
60106 name : GPU Pytest benchmark
61107 runs-on : linux.g5.4xlarge.nvidia.gpu
@@ -108,7 +154,7 @@ jobs:
108154 echo /usr/local/bin >> $GITHUB_PATH
109155 - name : Setup Environment
110156 run : |
111- python -m pip install ninja -U
157+ python -m pip install ninja pybind11 -U
112158 python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu121
113159 python -m pip install -e .
114160 python -m pip install pytest pytest-benchmark
0 commit comments