Skip to content

Commit

Permalink
Edited the Action file and the recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
sdy623 committed Oct 1, 2023
1 parent f05e8e1 commit b695e24
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 37 deletions.
86 changes: 52 additions & 34 deletions .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,67 @@ jobs:
build_ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Set GIT_TAG and GIT_COMMIT
run: |
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Setup Miniconda
id: setup-miniconda
# You may pin to the exact commit or the version.
# uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
uses: conda-incubator/[email protected]

- name: Configure Miniconda
run: |
conda install --yes -n base conda-libmamba-solver conda-build conda-verify
conda config --set solver libmamba
- name: Setup CUDA
- uses: Jimver/[email protected]
run: conda install --yes -c nvidia -c conda-forge cudatoolkit=11.8 cudnn nvcc_win-64=11.8 cuda-tools=11.8 cuda-nvcc=11.8
id: cuda-toolkit
with:
cuda: '11.8.0'

- name: Check CUDA Version
- name: Conda Build and Publish
run: |
echo "Installed cuda version is: ${{ steps.cuda-toolkit.outputs.cuda }}"
echo "Cuda install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}"
nvcc -V
- name: Checkout Code
uses: actions/checkout@v2

- name: Conda Build and Publish on Ubuntu
uses: fcakyon/[email protected]
with:
subdir: ./recipe # Sub-directory with conda recipe, optional, default is .
anacondatoken: ${{ secrets.ANACONDA_TOKEN }} # Anaconda access token, optional
platforms: 'linux' # Platforms to publish [osx/linux/win], optional, default is osx linux
export TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6+PTX"
export CUDA_HOME="/usr/miniconda3"
conda build ./recipe -c pytorch -c nvidia -c conda-forge
build_windows:
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Fetch all history for all tags and branches
run: git fetch --unshallow

- name: Set GIT_TAG and GIT_COMMIT
run: |
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Setup Miniconda
id: setup-miniconda
# You may pin to the exact commit or the version.
# uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
uses: conda-incubator/[email protected]

- name: Configure Miniconda
run: |
conda install --yes -n base conda-libmamba-solver conda-build conda-verify
conda config --set solver libmamba
- name: Setup CUDA
- uses: Jimver/[email protected]
run: conda install --yes -c nvidia -c conda-forge cudatoolkit=11.8 cudnn nvcc_win-64=11.8 cuda-tools=11.8 cuda-nvcc=11.8
id: cuda-toolkit
with:
cuda: '11.8.0'

- name: Check CUDA Version
- name: Conda Build and Publish
run: |
echo "Installed cuda version is: ${{ steps.cuda-toolkit.outputs.cuda }}"
echo "Cuda install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}"
nvcc -V
- name: Checkout Code
uses: actions/checkout@v2

- name: Conda Build and Publish on Windows
uses: fcakyon/[email protected]
with:
subdir: ./recipe # Sub-directory with conda recipe, optional, default is .
anacondatoken: ${{ secrets.ANACONDA_TOKEN }} # Anaconda access token, optional
platforms: 'win' # Platforms to publish [osx/linux/win], optional, default is osx linux
$Env:TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6+PTX"
$Env:CUDA_HOME="C:/miniconda3"
conda build ./recipe -c pytorch -c nvidia -c conda-forge
shell: powershell
6 changes: 3 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: detectron2
version: {{ environ['GIT_TAG'] }}+{{ environ['GIT_COMMIT'][:8] }}
version: {{ GIT_DESCRIBE_TAG|replace('v', '') }}+{{ GIT_DESCRIBE_HASH[:8] }}

source:
git_url: https://github.com/facebookresearch/detectron2.git
Expand All @@ -18,11 +18,11 @@ outputs:
- name: detectron2
build:
number: 0
string: "py{{ py }}_cpu"
string: "py{{ py }}_{{ target_platform }}_cpu"
- name: detectron2
build:
number: 1
string: "py{{ py }}_cuda{{ cuda_compiler_version }}" # [cuda_compiler_version == '11.8']
string: "py{{ py }}_{{ target_platform }}_cuda{{ cuda_compiler_version }}" # [cuda_compiler_version == '11.8']

requirements:
build:
Expand Down

0 comments on commit b695e24

Please sign in to comment.