From 515a2adc134651c51d866237e4c046f65ac4f717 Mon Sep 17 00:00:00 2001 From: Akshay Subramaniam <6964110+akshaysubr@users.noreply.github.com> Date: Fri, 30 May 2025 16:50:51 -0700 Subject: [PATCH 1/6] Adding basic CI workflow --- .github/workflows/ci.yaml | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6ea6dd4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,53 @@ +name: Test CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pre-commit + + - name: Install pre-commit hooks + run: | + pre-commit install + + - name: Run lint + run: | + pre-commit run --all-files + build: + + runs-on: ubuntu-latest + container: + image: pytorch/pytorch:latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Build package + run: | + apt-get update && apt-get install -y build-essential + python -m pip install --upgrade pip + pip install --no-build-isolation . + python setup.py build_ext --inplace + - name: Run tests + run: make unittest + - name: coverage + run: make coverage From 15ef5c9114fdea4e61d96c4ac423a39551078210 Mon Sep 17 00:00:00 2001 From: Akshay Subramaniam <6964110+akshaysubr@users.noreply.github.com> Date: Fri, 30 May 2025 17:00:40 -0700 Subject: [PATCH 2/6] Linting --- .github/ISSUE_TEMPLATE/bug_report.md | 6 ++++-- cuhpx/hpx_sht.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 40ff40f..4045daa 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,6 +12,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,8 +25,9 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Environment (please complete the following information):** - - Container: [e.g. `nvcr.io/nvidia/pytorch:25.04-py3`] - - Bare metal: [e.g. Ubuntu 22.04, PyTorch v2.0.6, CUDA 12.6, etc.] + +- Container: [e.g. `nvcr.io/nvidia/pytorch:25.04-py3`] +- Bare metal: [e.g. Ubuntu 22.04, PyTorch v2.0.6, CUDA 12.6, etc.] **Additional context** Add any other context about the problem here. diff --git a/cuhpx/hpx_sht.py b/cuhpx/hpx_sht.py index 2a2f041..bb77bb2 100644 --- a/cuhpx/hpx_sht.py +++ b/cuhpx/hpx_sht.py @@ -642,7 +642,7 @@ def backward(ctx, grad_output): class SHTCUDA(nn.Module): - def __init__(self, nside, lmax=None, mmax=None, quad_weights="ring", norm = "ortho", csphase=True): + def __init__(self, nside, lmax=None, mmax=None, quad_weights="ring", norm="ortho", csphase=True): super().__init__() self.nside = nside @@ -693,7 +693,7 @@ def forward(self, x): class iSHTCUDA(nn.Module): - def __init__(self, nside, lmax=None, mmax=None, quad_weights="ring", norm = "ortho", csphase=True): + def __init__(self, nside, lmax=None, mmax=None, quad_weights="ring", norm="ortho", csphase=True): super().__init__() self.nside = nside From 946c8219f81e751918e3854ad292661156df785b Mon Sep 17 00:00:00 2001 From: Akshay Subramaniam <6964110+akshaysubr@users.noreply.github.com> Date: Fri, 30 May 2025 17:06:25 -0700 Subject: [PATCH 3/6] Switching to NGC PyTorch container --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6ea6dd4..87693e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest container: - image: pytorch/pytorch:latest + image: nvcr.io/nvidia/pytorch:25.04-py3 steps: - name: Checkout repository From 654a91ba82535c866c8d6d70c58b67b92c5d45a9 Mon Sep 17 00:00:00 2001 From: Akshay Subramaniam <6964110+akshaysubr@users.noreply.github.com> Date: Fri, 30 May 2025 17:29:07 -0700 Subject: [PATCH 4/6] Removing build tests due to container size constraints --- .github/workflows/ci.yaml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 87693e2..94ddeae 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,22 +32,3 @@ jobs: - name: Run lint run: | pre-commit run --all-files - build: - - runs-on: ubuntu-latest - container: - image: nvcr.io/nvidia/pytorch:25.04-py3 - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Build package - run: | - apt-get update && apt-get install -y build-essential - python -m pip install --upgrade pip - pip install --no-build-isolation . - python setup.py build_ext --inplace - - name: Run tests - run: make unittest - - name: coverage - run: make coverage From 9b80fc9bbdeae3468a89a6ee8350cf4d4213df2c Mon Sep 17 00:00:00 2001 From: Akshay Subramaniam <6964110+akshaysubr@users.noreply.github.com> Date: Fri, 30 May 2025 17:42:28 -0700 Subject: [PATCH 5/6] Updating the README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 061e1b2..55dafb7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # cuHPX - GPU-Accelerated utilities for data on HEALPix grids +[![img](https://github.com/NVlabs/cuHPX/actions/workflows/ci.yaml/badge.svg?branch=ci)](https://github.com/NVlabs/cuHPX/actions/workflows/ci.yaml) +[![license][cuhpx_license_img]][cuhpx_license_url] +[![format][cuhpx_format_img]][cuhpx_format_url] +[![ruff][cuhpx_ruff_img]][cuhpx_ruff_url] + cuHPX is a library for performing transformations and analysis on HEALPix using the GPU. Currently, it supports data shuffling between the RING/NESTED layout and the flat index layout used in the earth-2 grid. Other features include @@ -121,3 +126,13 @@ python3 test/harmonic_transform_test.py python3 test/differentiability_test.py python3 test/regridding_test.py ``` + + + +[cuhpx_license_img]: https://img.shields.io/badge/License-Apache%202.0-green?style=flat-square +[cuhpx_format_img]: https://img.shields.io/badge/Code%20Style-Black-black?style=flat-square +[cuhpx_ruff_img]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=flat-square + +[cuhpx_license_url]: ./LICENSE +[cuhpx_format_url]: https://github.com/psf/black +[cuhpx_ruff_url]: https://github.com/astral-sh/ruff From 31332b38f0778265e9d18fdb7aa636975ea11130 Mon Sep 17 00:00:00 2001 From: Akshay Subramaniam <6964110+akshaysubr@users.noreply.github.com> Date: Fri, 30 May 2025 17:43:45 -0700 Subject: [PATCH 6/6] Updating README --- .github/workflows/ci.yaml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 94ddeae..03feab3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Test CI +name: CI on: push: diff --git a/README.md b/README.md index 55dafb7..ebe873b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # cuHPX - GPU-Accelerated utilities for data on HEALPix grids -[![img](https://github.com/NVlabs/cuHPX/actions/workflows/ci.yaml/badge.svg?branch=ci)](https://github.com/NVlabs/cuHPX/actions/workflows/ci.yaml) +[![img](https://github.com/NVlabs/cuHPX/actions/workflows/ci.yaml/badge.svg)](https://github.com/NVlabs/cuHPX/actions/workflows/ci.yaml) [![license][cuhpx_license_img]][cuhpx_license_url] [![format][cuhpx_format_img]][cuhpx_format_url] [![ruff][cuhpx_ruff_img]][cuhpx_ruff_url]